Trying to setup Image FUpload to work with Views Gallery, running into an issue that can't find any information on.

After uploading my images, I am prompted to go to the "next step" to edit the fields I want to on my new image nodes. I have removed the node body and the node title is being generated via Auto Nodetitles. The only field that I want to be able to edit is the CCK node reference field that links my new images to a gallery node.

However, at the moment I'm getting a white screen with the following message:

Fatal error: Unsupported operand types in (...)sites/all/modules/imagecache/imagecache.module on line 902

Probably more related to the Imagecache module, but has anybody else come across this before?

Comments

henno.gous’s picture

Assigned: henno.gous » Unassigned
sandrewj’s picture

Image FUpload needs to call the imagecache theme function with the attributes as an array.

mattcasey’s picture

Here's a simple loop that converts the attributes into an array from a string. They should be input like so:

class="my-custom-class" alt="alternative text"

Add this on line 58 of images.previewlist.imagefield.inc

  // prepare image attributes (convert attributes from a string to array)
  // source: stackoverflow.com/questions/1991607/convert-a-string-to-an-associative-array
  $n = preg_match_all('/(\w+)="([^"]*)"/', $field_image['widget']['fupload_previewlist_img_attributes'], $matches);
  for($i=0; $i<$n; $i++)
  {
      $field_image['widget']['fupload_previewlist_img_attributes'][$matches[1][$i]] = $matches[2][$i];
  }

I tried to store the $attributes as an array() but could not figure it out. :/

hozt’s picture

I made the change suggested to the file /image_fupload/includes/images.previewlist.imagefield.inc, but am still getting the same error.

Has this worked for anyone else?

sinuz’s picture

Yes, unfortunately i have the same problem.

travist’s picture

Status: Active » Needs review
StatusFileSize
new6.69 KB

We were having the same problem. Fixed it with the following patch.

Thanks,

Travis.

mezitlab’s picture

travist: this worked for me. Thank you!

sinuz’s picture

works here also!

mattcasey’s picture

I tried the patch last night, was having troubles.. today it seems to work!

vishnu.kumar7’s picture

Hi Travis... More information on the usage of this patch will be highly appreciated... We are facing the same issue...

Regards
Vishnu Kumar

senzaesclusiva’s picture

I don't konow if it is the right way , but i had applied this patch and runs:

" Unsupported operand types in (...)sites/all/modules/imagecache/imagecache.module on line 902"
changed line 902 from
return '<img' . drupal_attributes($ours + $attributes) . '/>';
in
return '<img' . drupal_attributes($ours) . $attributes . '/>';

joshuautley’s picture

Patch #6 worked for removing the WSOD however when editing the page I am still no longer able to drag and drop the images into order. Error occurred when I updated tot he latest RC-2

rituraj.gupta’s picture

Thanks travist #6. It works for me ....

hanskuiters’s picture

Status: Needs review » Reviewed & tested by the community

Patch #6 works for me too. Thanks.

eiriksm’s picture

Priority: Normal » Major

Works for me as well.

gngn’s picture

Applied patch #6 to 6.x-3.0-rc2 and it works for me too. Thanks.

gngn’s picture

Maybe someone would like to have the patch for 6.x-3.0-rc2....

rhimes’s picture

Issue summary: View changes

recently udated site from D6.17 to D6.35 and from Image FUpload 3.x-dev 2-1-10 to 9-30-13.

was getting same WSOD Fatal error: Unsupported operand types @ "Next" problem

patch #6 solved prob., at least so far - haven't yet made #11 changes to imagecache.module - & won't unless same issue or other arises- looks like patch s/b RTBC

- and THANKS! -