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

jwilson3’s picture

Title: WSOD during DOI Import in image_attach module after biblio upgrade from 6.x-1.17 to 6.x-1.18 » Cannot unset string offsets in image_attach.module on line 457
Project: Bibliography Module » Image Attach
Version: 6.x-1.18 » 7.x-1.x-dev
Issue summary: View changes

I'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.

jwilson3’s picture

Project: Image Attach » Image
Version: 7.x-1.x-dev » 6.x-1.x-dev
Component: Code » image_attach

Hrm. looks like Image_Attach is a drupal 7 module, the Drupal 6 Image_Attach module is a submodule that comes with the image module.

jwilson3’s picture

Issue summary: View changes
StatusFileSize
new663 bytes

This solution wraps the unset() function in an if (isset()) code block.

jwilson3’s picture

Status: Active » Needs review
StatusFileSize
new704 bytes

Looks like this actually needs an !empty() as well.

jwilson3’s picture

Status: Needs review » Closed (duplicate)
Related issues: +#589428: clean up form data in submit handler, not hook_nodeapi -- produces PHP Fatal Error

Well, 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.