There is an "Undefined offset: 0 in media_add_upload_submit() (line 140... in media/includes/media.pages.inc" when you are using the workbench_media module to upload a file though the media_add_upload_form.
The $params = $form_state['build_info']['args'][0]; never checks if the the form_state build info is set or not and there is nothing in the following code that requires it to be set so we need to add a isset() around it.
Patch attached.
| Comment | File | Size | Author |
|---|---|---|---|
| fix_undefined_offset_in_form_state_params.patch | 582 bytes | bobodrone |
Comments
Comment #1
dddave commentedI wasn't able to recreate this with the latest dev of media and workbench_media 1.0. Do you still have this issue WITHOUT the patch? Or was this committed during the last weeks?
Comment #2
bobodrone commentedYes, you are right. This issue is fixed in: http://drupalcode.org/project/media.git/commitdiff/f69429bcc3ba979e803ec...
A slightly better variant than my suggestion with $params = isset($form_state['build_info']['args'][0]) ? $form_state['build_info']['args'][0] : array();
:) Closing this now.
/ bobodrone
Comment #3
dzoll7 commentedI'm experiencing the same bug with version 7.2-1.2, and it doesn't look like the changes mentioned in #2 were ever applied to 1.x.
What is the procedure for having this fixed in 1.x? (Sorry if reopening the issue was the wrong thing to do; I'm still learning procedures/etiquette here.)
Comment #4
ParisLiakos commentedyeap we should get this patch in 1.x as well, if the bug exists there
Comment #5
simon georges commentedComment #6
ParisLiakos commentedJust committed fix to 1.x
http://drupalcode.org/project/media.git/commit/b83f559