#15655 closed defect (bug) (invalid)
Media Upload form does not pass tab name
Reported by: | jackcrosby | Owned by: | nacin |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.0.2 |
Component: | Upload | Keywords: | |
Focuses: | Cc: |
Description (last modified by )
The Media Upload form has an error (wp-admin/includes/media.php line #1538). It is not passing the tab name, which hinders adding actions based on which Upload tab is selected.
Error:
Get param 'tab' is being set to 'type' which is incorrect.
$form_action_url = admin_url("media-upload.php?type=$type&tab=type&post_id=$post_id");
Fix:
To top of function add:
global $tab;
Change the form action URL (line #1538) to:
$form_action_url = admin_url("media-upload.php?type=$type&tab=$tab&post_id=$post_id");
This change also impacts function media_upload_type_url_form (line #1591). Same fix applies.
Attachments (1)
Change History (12)
#4
@
14 years ago
- Milestone changed from 3.1 to Future Release
Punting all tickets that are not regressions in 3.1.
#7
@
13 years ago
Tested the output without the patch
function _ds_test_filter($form_action_url, $type) { debug($form_action_url); debug($type); debug($_REQUEST['tab']); debug($_GLOBALS['tab']); } add_filter('media_upload_form_url', 'ds_test_filter', 10, 2);
Output after first load, From Computer is active:
string(74) "http://wpms.dev/wp-admin/media-upload.php?type=image&tab=type&post_id=1244" string(5) "image" (Notice: Undefined index: tab) NULL string(4) "type"
From URL is active:
string(74) "http://wpms.dev/wp-admin/media-upload.php?type=image&tab=type&post_id=1244" string(5) "image" string(8) "type_url" string(8) "type_url"
Media Library is active:
string(76) "http://wpms.dev/wp-admin/media-upload.php?type=file&tab=library&post_id=1244" string(4) "file" string(7) "library" string(7) "library"
From Computer is active:
string(74) "http://wpms.dev/wp-admin/media-upload.php?type=image&tab=type&post_id=1244" string(5) "image" string(4) "type" string(4) "type"
#9
@
13 years ago
- Keywords needs-patch added; has-patch removed
- Milestone changed from 3.3 to Future Release
This is not a regression in 3.2 and needs some more review.
As you can see from my snippets $_GLOBALS['tab']
does work on all tabs.
Patch for jackcrosby's changes