Hello,

I am getting the error below everytime I upload files with uploadify.

warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /.../sites/all/modules/uploadify/uploadify.module on line 672.

In my current configuration I have about 4 upload filefields on the node edit form, all using uploadify and all multivalue fields.

The files end up uploading ok, but the warning appears for every single file every time that I upload using uploadify.

Thanks,

KH

Comments

ircdirk’s picture

I edited file uploadify.module around line 672:

function uploadify_get_form_element($form, $field_name, &$form_parents, &$tree_parents) {
	if(is_array($form) || is_object($form)){
	  if (array_key_exists($field_name, $form)) {
	    $form_parents = array_merge($form_parents, array($field_name));
	    $tree_parents = array_merge($tree_parents, array($field_name));
	    return $form[$field_name];
	  }
	}

added "if(is_array($form) || is_object($form)){ ( existing php code) }" and it works...

makara’s picture

Status: Active » Fixed

Thanks ircdirk. Committed.

Status: Fixed » Closed (fixed)
Issue tags: -uploadify, -array key exists

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