I have a cck node with content taxonomy optional field which is set to use HS with multiple values. when I create a node and do not select any value for the taxonomy field, I get the following warnings during preview:

# warning: Cannot use a scalar value as an array in /srv/www/creedia.net/sites/all/modules/cck/content.module on line 621.
# warning: Cannot use a scalar value as an array in /srv/www/creedia.net/sites/all/modules/cck/content.module on line 622.

And during save:

warning: reset() [function.reset]: Passed variable is not an array or object in /srv/www/creedia.net/sites/all/modules/content_taxonomy/content_taxonomy.module on line 279.

I spent several hours trying to understand what is going on there, but couldn't figure this out. Eventually what helped was the following patch. It has some logic behind it, but I can't say I understand what's going on. In any case, with this patch I get no warnings and everything else is working.

The patch should be applied from the hierarchical_select/modules directory

Feedback appreciated

CommentFileSizeAuthor
content_taxonomy_empty_multiselect.patch513 bytesbluetegu

Comments

wim leers’s picture

Are you using the latest dev snapshot of content_taxonomy?

bluetegu’s picture

Yes, 5.x.1.x-dev.

wim leers’s picture

Yes, of course, but of which date? You want the latest one, the one from July 7.

I think you're using the old version of HS that was included in content_taxonomy itself for a while…

bluetegu’s picture

No. It took me a while to figure out why I don't see the firebug printing in the hs file under the content taxonomy folder. The printing I added in the hs_content_taxonomy file in the HS folder gave me the hint for the patch I'm using. I checked again and compared the info file - I am using the 7-7-2008 content taxonomy version.

mpaler’s picture

Just applied the patch and I can confirm that it removed identical errors I was getting.

wim leers’s picture

Title: HS and contet_taxonomy, multiple values, non-selected valued fields cause warnings during preview and save » HS and content_taxonomy, multiple values, non-selected valued fields cause warnings during preview and save
Status: Needs work » Fixed

This code makes no sense, which none of the content_taxonomy code did. So … I'm just going to trust you here, bluetegu, that it doesn't cause any *new* problems.

http://drupal.org/cvs?commit=179998

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.