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
| Comment | File | Size | Author |
|---|---|---|---|
| content_taxonomy_empty_multiselect.patch | 513 bytes | bluetegu |
Comments
Comment #1
wim leersAre you using the latest dev snapshot of content_taxonomy?
Comment #2
bluetegu commentedYes, 5.x.1.x-dev.
Comment #3
wim leersYes, 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…
Comment #4
bluetegu commentedNo. 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.
Comment #5
mpaler commentedJust applied the patch and I can confirm that it removed identical errors I was getting.
Comment #6
wim leersThis 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