Image attach field in a CCK node gives the following error:

* warning: array_merge() [function.array-merge]: Argument #1 is not an array in ***/sites/all/modules/image/image.module on line 641.
* warning: array_filter() [function.array-filter]: The first argument should be an array in ***/sites/all/modules/image/image.module on line 643.

cheers,

.jon

Comments

veresdaniel’s picture

Same here..

joachim’s picture

Status: Active » Postponed (maintainer needs more info)

The field for attached images has changed completely due to multiple attachments now being possible.
There is no way to update your views, you will need to change your views by hand.
This is mentioned in the release notes!

Marking this as need info -- please confirm if changing your field fixes the problem.

joachim’s picture

Title: Images broken after update » Image_attach Views field causes error after update

Better title for other people to find this issue.

joachim’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)
caprenter’s picture

I got the same error message today, but not linked to CCK (I don't have it!). I was transferring a site over to a multi-site install, but I can't really tell what exactly was going on when I got the error.

A bit of googling and I found a 'fix' although I don't really know that it's the right thing.

I'm using PHP5 and I've seen it said that certain variables need to be marked as arrays. I changed line 641 from:

$image_attributes = array_merge($image_info,$attributes);

to

$image_attributes = array_merge((array)$image_info, (array)$attributes);

and my error messages went away - whether or not it is fixed is a different matter!

Hope that's of some use.

joachim’s picture

I think that's a different error that's also been fixed: #569526: Beta1 to Beta2 breaks Lightbox2 support

deg’s picture

Maybe I'm just tired and don't see it, but how do I "change your views by hand." I'm not seeing anything in the release notes to explain this. I've added another Image Attach > Attached Image field and it's still complaining of "Error: handler for image_attach > iid doesn't exist!"

joachim’s picture

'Change views by hand' means edit the view, remove the old version of the field it complains about, add the new version of the field.

deg’s picture

Is the new version of the field called "Image Attach > Attached Image" like the old one? What is its new name and location?

joachim’s picture

Erm... probably. I don't have the UI in front of me. I'm sure I called it something fairly clear.

deg’s picture

Status: Closed (works as designed) » Closed (fixed)

Thanks for helping me sort through this. Turns out there was some confusion and I wasn't using the latest version of the module as I had thought. I am now able to remove the old filter and place the new one.