I have added/modified taxonomy terms since initial installation of the module, and now am returned this warning at a node:
warning: implode() [function.implode]: Invalid arguments passed in sites/all/modules/nodeterms/nodeterms.module on line 37.
I've deactivated the module, cleared caches, deleted and reconstructed taxonomies, reactivated the module, etc., but cannot seem to find the cause. Perhaps there is a remnant of a previous taxonomy instance remaining in a database, but I don't know how to access it.
BTW, this module is exactly what I was looking for - thanks for your work.
Comments
Comment #1
lelizondo commentedIf I'm not wrong, that problem was caused when showing a nodeterms block for certain vocabulary on a node that has no terms of that vocabulary.
I think the problem was fixed in the last dev version or maybe this is just another problem and I'll need more info to replicate the problem. You don't have to but please run update.php after updating the module.
Comment #2
andr3bil commentedVerified that I'm using the latest release. No improvement with update.php.
I think I am getting what you've described as an issue with the previous dev version: if I find a vocabulary with no terms selected on a node that shows the block for the corresponding vocabulary, the error appears.
I had deleted an entire vocabulary and then rebuilt it. Each of the nodes that contain a term from the previous vocabulary shows an error. When I open the node, there are no terms from that vocabulary selected. If I edit the node and select the term(s) and save, there is no error. All terms unselected also works, but "none" doesn't work as an option unless selected for all vocabularies - when one term is selected in one vocabulary, each other vocabulary present has to have at least one term selected to display without an error.
Comment #3
andr3bil commentedInterestingly, nodes that were created after the initial installation of the module do not show an error when a term is unselected. If, however, I edit one of those nodes, select a term and save, then reopen and unselect the term (so its back to its original state), leaving the vocabulary with no selected terms, the error displays as for the other nodes.
Comment #4
lelizondo commentedcan you please post the code around line 36 of nodeterms.module, it should be something like:
the
if($node->taxonomy)should be there, if not that's the problem, if it is there, then it's not working and I'll start trying some other optionsComment #5
andr3bil commentedthat's it exactly:
Comment #6
andr3bil commentedI was thinking that it may have something to do with the Pathauto module that is also installed. When I add a new taxonomy vocab and term, and assign it to a node, the error is generated when I navigate to ../taxonomy/term/[termID], a URL that is listed for the new taxonomy term in Pathauto in ../admin/build/path/list. If I go and delete the automatically generated alias, and then create a new alias to the termID, like "system path: ../taxonomy/term/[termID]" and "path alias: ../deleteme", then there is no error. I can create any alias, like ../deleteme, but creating ../taxonomy/term/[termID] works and restores what we want. But now all other nodes in the content type that was available for the new taxonomy vocab and term show an error unless I hide the block or select a term. This leads me to think that my issue doesn't really have anything to do with the Nodeterms module, does it? But it does reveal an issue somewhere else. I'll soon try a clean install and see if I can get it all functioning correctly together without hiding blocks.
Comment #7
lelizondo commenteddid you find any reason for this error?
try using the context module to see if that works, is so much better than using admin/build/blocks
Also try disabling the blocks from Node Terms and then create a block manually and add this to the body of the block:
Where $vid is the vocabulary which terms you want to show.
If the error goes away and everything works as it should, then is probably an issue with node terms, that function is very stable so I don't think it will give you problems. Remember it will only show up on node/nid and not on taxonomy/term/tid or something like that.
If the problem fixes then I'll have to reconsider using that function to create the blocks.
Comment #8
jbiechele commenteduoops sorry for that one.
Only found now the other issue with the same pb and solution.
http://drupal.org/node/770392
Please delete this comment. Thank you.
------------
I think the problem is that you allow NULL to get passed to "implode"
when a vocabulary is not "required" and does not contain any term for that vocabulary in a certain node.
When I change your original line 37
to that one
the optionally NULL vocabulary terms won't get passed in to "implode".
Not sure whether this is the best way to solve that.
May be it would be much better to not get NULL into the $vars variable.