Hi,
I encountered these errors when trying to edit nodes. The screen just goes blank after I hit submit. No changes were saved when I tried to view the nodes after that.
This only occurred when using two user accounts - however I have not determined what was different with those user accounts as compared to other user accounts - both accounts have administer privileges so they can edit/delete nodes.
I looked at the line in the content module that was causing the problem - around line 710+ in the content.module file
...
// If there was an AHAH add more button in this field, don't save it.
// TODO: is it still needed ?
unset($items[$field['field_name'] .'_add_more']);
...
I modified the line to add some checks to the variable before performing the unset():
...
// If there was an AHAH add more button in this field, don't save it.
// TODO: is it still needed ?
if (isset($items[$field['field_name'] .'_add_more'])) {
unset($items[$field['field_name'] .'_add_more']);
}
...
Also edited another part of the module file - around line 1243+ of the content.module file
...
// Make sure AHAH 'add more' button isn't sent to the fields for processing.
unset($items[$field['field_name'] .'_add_more']);
...
I added a check as well to change it to the following:
...
// Make sure AHAH 'add more' button isn't sent to the fields for processing.
if (isset($items[$field['field_name'] .'_add_more'])) {
unset($items[$field['field_name'] .'_add_more']);
}
...
Editing nodes are now working and I don't get the unset errors anymore. However, I am not sure if this affects other parts of drupal - my guess is that it does not (because the variable is not set anyway) - am I wrong in this assumption?
I have tried also to look into what is causing the problem from user settings but don't know where to start.
Thanks for any info on this problem.
My setup is:
Drupal 6.12
CCK 6.x-2.2
Apache2
PHP5
Mysql5
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | export_event_content_type.txt | 27.85 KB | h3000 |
| #2 | profile_cck_export.txt | 38.53 KB | crashtest_ |
Comments
Comment #1
yched commentedThese changes shouldn't be needed unless someone (probably a field type module) is doing something wrong.
Please check you have the latest versions of the modules providing your fields and widgets.
If it doesn't fix it, please post an export of your content type (using the content_copy module)
Comment #2
crashtest_ commentedI am also having this problem, and I am not certain which module is sending info that is causing the error, so attached is a copy of my export.
Comment #3
h3000 commentedHi yched,
I'm still having these errors and to fix this, I just add the check before running the unset command (as mentioned in OP). However, I need to add the change everytime I upgrade my version of drupal.
I tried looking for the problem as well but its not clear where to start - it happens in multiple node types and for only a few users.
attached is an export of one content type
Comment #4
markus_petrux commentedIf $items is an array, PHP won't report such a notice.
if $items is not an array, it's probably caused by a CCK field that has not populated the field in the node as an array. Is that possible? <-- I think we need to know this. Otherwise, fixing this here could hide a bad implementation of CCK field.
Comment #5
kharbat commenteddo you have any module with a form_alter hook that modifies the field type or value ? probably that's the reason
Comment #6
viridisweb commentedI have this problem after changing the widget type from "Image" to "Image FUpload" for a File cck field that is storing multiple images.
I created a different content type and added a file field and used the "Image FUpload" widget and it worked fine.
But now I can't get the original content type to work with the "Image FUpload" widget. I tried deleting the File field all together and adding a new one, but I still get the same error.
Any ideas?