Opened 2 years ago

Last modified 10 months ago

#17812 new defect (bug)

media_upload_form_handler runs twice when editing attachment from "From Computer" media upload tab (browser uploader)

Reported by: jeffstieler Owned by:
Priority: normal Milestone: Awaiting Review
Component: Upload Version: 3.1.3
Severity: normal Keywords: has-patch needs-refresh
Cc:

Description

After uploading a new media item "From Computer" using the browser uploader, you are presented with a form to edit its fields.

Clicking "Save all changes" from this form causes media_upload_form_handler to run, then media_upload_gallery (presumably to redirect to the gallery tab), which then causes media_upload_form_handler to run again.

This can cause problems for edit_attachment actions that only run once and alter the posts table row for that attachment (since the subsequent media_upload_form_handler could overwrite whatever changes were made in the action if they don't match whats in $_POST).

If the only reason media_upload_gallery is being called from the other type upload handler is to redirect to the gallery tab.. perhaps this patch is a better approach.

Attachments (1)

media.php.r18313.diff (1.4 KB) - added by jeffstieler 2 years ago.

Download all attachments as: .zip

Change History (2)

  • Keywords needs-refresh added
  • Version set to 3.1.3

Patch no longer applies cleanly against trunk as of r21435.

Note: See TracTickets for help on using tickets.