Opened 13 years ago
Closed 13 years ago
#13810 closed defect (bug) (fixed)
media form errors not displaying on /wp-admin/media.php?action=edit&attachment_id=##
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 3.1 | Priority: | normal |
Severity: | normal | Version: | 3.0 |
Component: | Administration | Keywords: | has-patch commit |
Focuses: | Cc: |
Description
form errors not showing on the single media edit page:
/wp-admin/media.php?action=edit&attachment_id=##
This is due to the $errors array being passed incorrectly to the get_media_item() function in /wp-admin/media.php. The $errors array is sent back from media_upload_form_handler() as an array of error arrays having attachment ids as the key for each. Was simply an accident of passing the full array ($errors) rather than just the key needed ($errors[$attachment->ID]) causing a bad array merge later which is why the errors don't display. Probably happened because the full $errors array is passed to the plural get_media_items() function.
Looks like this bug has gone unnoticed since at least early 2008.
Patch included.
Attachments (1)
Change History (5)
#2
@
13 years ago
an easy way to add an error for testing is to make the required 'title' field blank in the media form, triggering the error: "Empty Title filled from filename."
If you don't see that error underneath the field, things aren't working properly.
In the modal popup version, just click 'show' on the new item in the gallery list after an upload->save to see the error message. This is another bug I submitted a patch for (#13838) which is css related, if there are errors in this form it should show by default (css class 'startopen') but that class oddly has 'display:none' attached to it in a few places in the css breaking that functionality.
patch for /wp-admin/media.php