This error drove me nuts and there are numerous threads about imagefield behaving strangly by not showing uploaded images or stopping to work.
I had a simple content type using imagefield and it worked fine. After adding both videofield and audiofield, the imagefield upload stopped working, while video- and audiofiled still worked fine.
For reasons I do not know, the &$node_field reference in the widget might be some kind of unpersistent under special circumstances.
'prepare form values' pulls in the images from the session, but when it comes to displaying the upload form, there are no images at all, and $node_field is empty.
(BTW this does only occur for normal users, not for admins! strange...)
I added the following code to _imagefield_widget_form()
if (is_array($_SESSION['imagefield'][$fieldname])) {
foreach ($_SESSION['imagefield'][$fieldname] as $delta => $file) {
$node_field[$delta] = $file;
}
}
It just does the same job, that *should* be done by 'prepare form values'.
I don't create a patch here, as my version is way behind the current development and I even don't know, if this problem still exists.
I just wanted to write it down somewhere to keep it in the community's mind.
Maybe someone likes to check for this issue in higher versions.
Comments
Comment #1
quicksketchThe 4.7 version is no longer supported.