There is an "Undefined offset: 0 in media_add_upload_submit() (line 140... in media/includes/" 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.

fix_undefined_offset_in_form_state_params.patch582 bytesbobodrone
PASSED: [[SimpleTest]]: [MySQL] 0 pass(es). View
Members fund testing for the Drupal project. Drupal Association Learn more


dddave’s picture

I 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?

bobodrone’s picture

Status: Needs review » Closed (fixed)

Yes, you are right. This issue is fixed in:

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

dzoll7’s picture

Status: Closed (fixed) » Active

I'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.)

ParisLiakos’s picture

Version: 7.x-2.x-dev » 7.x-1.x-dev

yeap we should get this patch in 1.x as well, if the bug exists there

Simon Georges’s picture

Status: Active » Patch (to be ported)
ParisLiakos’s picture

Status: Patch (to be ported) » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.