Active
Project:
Image
Version:
6.x-1.0
Component:
image_attach
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
26 Oct 2010 at 02:24 UTC
Updated:
16 Nov 2011 at 20:41 UTC
Fatal error: Cannot unset string offsets in .../image/contrib/image_attach/image_attach/image_attach.module on line 397
I've updated to the latest version as of today, all modules up to date.
The error happens when i create a type of content node, with an image attached.
Any ideas?
Comments
Comment #1
victor.stan@gmail.com commentedThis is my temporary fix, I don't know if it's the right one or not, please check if it's correct, Thanks!
#390 of image_attach.module
/**
* Extra submit handler for node forms.
*/
function image_attach_node_form_submit(&$form, &$form_state) {
// Clear the 0 key in the iids array that arises from selecting the 'None'
// option. We do this here so image_attach_nodeapi() gets clean data.
if(isset($form_state['values']['iids'][0]))
{
// var_dump($form_state['values']['iids'][0]);
unset($form_state['values']['iids'][0]);
}
}
Comment #2
joachim commentedAll works fine for me (and for everyone else, I assume, otherwise the issue queue would be screaming with it).
Can you make sure you have the latest version of the code, as this sounds related to a recently-fixed bug. Also, can you try disabling other modules that interact with nodes, as they may be causing the problem.
Finally, can you give the precise steps to reproduce this bug?
Comment #3
colinmccabe commentedI get this message when using the Node Import module. The type of node I am importing has image attach enabled. Import works fine with content types that don't have image attach enabled.
Comment #4
colinmccabe commentedAlso, when I add nodes of the offending content type manually everything works fine.
Comment #5
joachim commentedThere's an existing bug about node import. And IIRC it's node import's problem ;)
Comment #6
colinmccabe commentedAnyway, I tried victor.stan's code and it seems to be working.
Comment #7
Drupal Centric commentedI've a similar problem: Fatal error: Cannot unset string offsets in... /httpdocs/sites/all/modules/image/contrib/image_attach/image_attach.module on line 402 when updating/saving a page.
Using 6.x-1.0beta5 and I also tried the updated 6.x-1.0 using Drupal 6.19 but not fixed.
I tried this fix http://drupal.org/node/747900 and the code above but no joy. I don't have the node import module in use.
Comment #8
alexbk66- commentedI had the same problem when I had the Form module enabled.
After disabling form - the error is gone. Not sure if it's the cause though, as always with Drupal.
Comment #9
Screenack commentedThe change in #1 is working for me for now (WSOD without it)
Comment #10
dimitriseng commentedI am also using Node Import with Ubercart and I am getting this error at the final step of the import process. I can confirm that after applying #1 this error is resolved. Can somebody confirm if the solution in #1 could have any side effects and if not could this be commited? Thank you.
Comment #11
joachim commented*sigh* All these modules should be doing node_save(), not pretending to save forms. But it looks like we may need to babysit.
Can someone actually roll this change as a patch please?
Comment #12
jonathan1055 commentedHi Joachim,
Long time since I was on this board. Just started using Node Import today and got hit with WSOD in step 7 of 8. Eventually traced the error
PHP Fatal error: Cannot unset string offsets in .../sites/all/modules/image/contrib/image_attach/image_attach.module on line 408
then found #875224: Import wizard breaks when content type has image attach and was directed to this thread.
It is obviously still a problem in Node Import. Has it been fixed in any of the other reported modules above? If it is just node import I'll try to fix it there, but if there are many other modules, then yes we may have to babysit and cater for it here.
Jonathan
Comment #13
aproka commentedI believe that this addresses this issue: