I have a content type that has two taxonomy vocabs associated with it. If I use the autocategorise button on one then it gives an SQL error for each node:
warning: Invalid argument supplied for foreach() in /[folder names here]/sites/all/modules/autocategorise/auto_categorise.module on line 114.
And then clears all the terms set for the other vocabulary on each node.
So now I have to edit every single node and re-establish the term for that vocabulary.
Comments
Comment #1
the fatman commentedI'm getting the same error and have only one vocabulary defined.
I disabled the vocab index module, made no difference.
Comment #2
Daren Schwenke commentedSame error.
Edit: I think I get it. If you don't have any synonyms defined for your terms, you get this error.
auto_categorise_nodeapi calls
get_array_for_matching
which has the following code:
SELECT t.tid, s.name
FROM {term_data} AS t LEFT JOIN term_synonym AS s
ON t.tid = s.tid
WHERE vid = %d AND s.name IS NOT NULL
ORDER BY s.tid", $vid);
This pulls in the synonyms for matching.
Since function _apply_terms_to_node simply loops through the terms, it will error if you have no synonyms defined as the array passed in is then undefined.
Replaced
with:
and this error went away. You can also just add a synonym to a term and it will go away.
After all, this is the intention of the module.
Comment #3
Daren Schwenke commentedComment #4
matslats commentedThanks for all your contributions, I was absent for a while.
All these issues are sorted out in 1.3