Problem statement
PHP Fatal error occurs in Image_Attach submodule when saving a node that has no images attached, the error message is:
PHP Fatal error: Cannot unset string offsets in image_attach.module on line 457
Proposed solution
Wrap the unset() in an if (isset()).
Original Issue
Hi,
After upgrading the biblio Module from 6.x-1.17 to 6.x-1.18 I get a WSOD when I try to create a new biblio-entry by DOI-import.
The error log says:
PHP Fatal error: Cannot unset string offsets in image_attach.module on line 457
referer: https://www.test....de/de/node/add/biblio
I'm using image-module 6.x-1.2, which is up to date.
After downgrading to biblio 6.x-1.17 everything is doing well again.
Jan
Comments
Comment #1
jwilson3I'm seeing this issue without using the biblio module, so I don't believe this issue is related to the biblio module but rather is a bug in the image_attach module.
Comment #2
jwilson3Hrm. looks like Image_Attach is a drupal 7 module, the Drupal 6 Image_Attach module is a submodule that comes with the image module.
Comment #3
jwilson3This solution wraps the
unset()function in anif (isset())code block.Comment #4
jwilson3Looks like this actually needs an
!empty()as well.Comment #5
jwilson3Well, sheeeeeeaaaat.
Just found another patch. this looks like a duplicate of #589428: clean up form data in submit handler, not hook_nodeapi -- produces PHP Fatal Error.