imagefield_js() expects $_POST to contain the submit button in the top level of the array, but when it's used on a noedprofile, and then edited from the user/#/edit/ url, it is actually contained below the form id like array('form_id' => array(... submit button ...)); instead of just array(... submit button ...);.

This is a patch that adds a function to search the $_POST array recursively for the submit button. Works, but not sure if this is the best approach; someone mentioned the possibility of flattening the $_POST array?

(see attached)

CommentFileSizeAuthor
imageprofile.module.patch1.59 KBms2011

Comments

dopry’s picture

Project: ImageField » Node Profile
Version: 5.x-2.x-dev » 5.x-1.x-dev

I would tell the nodeprofile module not to move this button.

fago’s picture

Status: Needs review » Needs work

hm, I won't add such a specific solution, as I prefer a general solution to the problem. I think this needs some investigation.

fago’s picture

Status: Needs work » Fixed

the problem is the subform element data separation, which fails because imagefield accesses $_POST, which it imho shouldn't. Anyway, I've fixed nodeprofile to disable data separation, which now let's imagefield find it's data in $_POST. However, there might be issues, if people add profile fields with overlapping field names. So people, don't do that! ;)

Anonymous’s picture

Status: Fixed » Closed (fixed)

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