Make WordPress Core

Opened 20 months ago

Last modified 9 months ago

#38221 assigned defect (bug)

Incorrect page id/name search blocks future searches

Reported by: bencroskery Owned by: tomdude
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.4.2
Component: Media Keywords: good-first-bug has-patch
Focuses: javascript Cc:


After an incorrect page id or name search in the media library, ex upload.php?p=123 or upload.php?name=noexist, future searches get blocked in js.

Steps to reproduce:

  1. go to upload.php?p=123 (or use another id which doesn't exist)
  2. should see 'No media files found.'
  3. submit a search in the search box (nothing will happen)

Submitting the form is blocked by wp-admin/js/media.js:90, preventing the submit for (an unrelated?) search #find-posts.

Attachments (1)

38221.diff (672 bytes) - added by tomdude 9 months ago.

Download all attachments as: .zip

Change History (6)

This ticket was mentioned in Slack in #core-media by desrosj. View the logs.

10 months ago

#2 @desrosj
10 months ago

  • Keywords needs-patch good-first-bug added

Welcome to trac, @bencroskery! I was able to reproduce this, but it did take one change. This only happens in the list view in the media library, not the grid view. To reproduce, you must add mode=list to the URL.


Are you interested in tackling this @bencroskery?

9 months ago

#3 @tomdude
9 months ago

  • Keywords needs-patch removed

Created patch to fix this. Adds check if any posts exist for preventDefault conditional.

#4 @tomdude
9 months ago

  • Keywords has-patch added

#5 @DrewAPicture
9 months ago

  • Owner set to tomdude
  • Status changed from new to assigned

Assigning to mark the good-first-bug as "claimed".

Note: See TracTickets for help on using tickets.