WordPress.org

Make WordPress Core

Opened 17 months ago

Last modified 6 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:

Description

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 6 months ago.

Download all attachments as: .zip

Change History (6)

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


7 months ago

#2 @desrosj
7 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.

upload.php?p=123&mode=list

Are you interested in tackling this @bencroskery?

@tomdude
6 months ago

#3 @tomdude
6 months ago

  • Keywords needs-patch removed

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

#4 @tomdude
6 months ago

  • Keywords has-patch added

#5 @DrewAPicture
6 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.