Closed (fixed)
Project:
Community Tags
Version:
6.x-1.0-beta1
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Created:
10 Apr 2008 at 17:43 UTC
Updated:
19 Feb 2011 at 13:10 UTC
In recent days I noticed that I keep getting this error
warning: Invalid argument supplied for foreach() in /home/sitename/public_html/sitename/sites/all/modules/tagadelic/tagadelic.module on line 285.
I often get it on aggregator pages.
also, I run a multilingual site with 3 enabled languages. (could it be a glitch related to taxonomies?)
I tend to get this error message more often, if not ONLY, when I submit content in the non-default language.
I've googled for this problem, but it looks like there are only 2 sites that seem to have it.
Comments
Comment #1
Bèr Kessels commentedthe functioncall theme('tagadelic_weighted', $terms), must always receive an array. It seems you are passing it invalid information. Did you install any 3rdparty tagadelic modules, or created any custom php blocks with tags?
Comment #2
drupalina commentedI'm not a programmer or coder (I just put modules together and hope that they will work together). Could you please explain what you mean in more detail.
I use Drigg module. And also Community Tags module -- these are the only modules that I can think of that might be related to Tagadelic.
The strange thing is that this error is displayed only to the Anonymous (logged out) readers. When user is logged in, he cannot see it.
Note: in my settings, Anonymous users can create some content types. Could that be a factor???
I have also noticed that this problem does not occur for all the nodes -- ONLY FOR THOSE NODES WHICH WERE CREATED BY ANONYMOUS USERS. I strongly suspect that this is where the problem is, but it is essential the the nature of my site that content is submitted anonymously.
Comment #3
pfaocleSimilar bug report
Comment #4
drupalina commentedYeah, there seems to be some strange incompatibility between Community Tags module and the Tagadelic (see also http://drupal.org/node/262119), even though Community Tags uses Tagadelic as a required module.
Comment #5
deverman commentedI have this problem and I also have the community tags module installed. Any fixes available?
Comment #6
alex-and-r commentedAnd I have the same when I'm viewing nodes under anonymous user.
My scenario is like this:
When I'm logged in everything is OK.
When I'm not logged and I am anonymous I can view nodes the same way (means no errors). But when I tag a node after that I see it only with that "Invalid argument supplied for foreach().." error and in place of tagging form I have "You have already tagged this post. Your tags:" so I can't tag this node naymore.
I believe there is some problem with anonymous user and this module!
So any suggestions how to fix it?
Comment #7
alex-and-r commentedSo, still no activity? Ok, let me show what I think.
I think it's a problem of Community_tags module and not Tagadelic. The first depends on the latter and on some points calls for functions from Tagadelic.
And now to what I found. Community_tags module (to be specific - "community_tags.module,v 1.32.2.6 2008/02/19 10:59:22") calls "theme_community_tags" function on lines #229 and #670 of community_tags.module file. And this "theme_community_tags" function in turn calls Tagadelic function "theme_tagadelic_weighted" (exactly THE function where the error on line #285 occurs).
But on line #229 the call for "theme_community_tags" function is like this:
theme('community_tags', 'user_node', NULL, $user->uid, $node->nid)while on line #670 the call is different:
theme('community_tags', $sorted_tags)And if we look at the "theme_community_tags" function definition we see the following:
function theme_community_tags($tags)So I believe the first call on line #229 of community_tags.module is incorrect or am I not right? And since incorrect argument is passed to "theme_community_tags" function the same incorrect argument is passed down to Tagadelic "theme_tagadelic_weighted" function and we receive an error.
Any comments?
May be I should post it in community_tags issues?
Comment #8
pfaocleYour reasoning seems correct - the string 'user_node' is passed, via theme_community_tags, to theme_tagadelic_weighted(), which expects an array as its first parameter.
The call on line #229 of community_tags.module does look incorrect, but perhaps theme_tagadelic_weighted() should do a quick check on its parameter? Eg:
If not, bump this issue from this queue into the Community Tags queue, rather than open a new issue?
Comment #9
dropcube commentedYes, it's seems to be a bug related to the Community Tags module.
I will take a look and will provide a fix.
Comment #10
dropcube commentedComment #11
dropcube commentedOk, I found a patch with a quick fix for this: #216853: Bad call to theme_community_tags causes error. However, a revamp to community_tags_node_view() is still is required.
Comment #12
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #13
drupalina commentedHow come this issue was automatically closed??? I'm using the 5x-1.0-beta1 and I'm still having these problems.
I'm reopening this issue and marking it under version 5x-1.0-beta1.
Please let us know what's the current status on this issue. Was this patch tested? Did it work? Was it committed to .dev version?
Thanks!
Comment #14
tierecke commentedI have it too with v6. After adding tags I get:
warning: Invalid argument supplied for foreach() in /srv/www/htdocs/sites/my.gemeentemuseum.nl.exp/modules/tagadelic/tagadelic.module on line 309.
And I can't see/edit my tags anymore.
Comment #15
dave reidCan you confirm that this is still valid in the 6.x-1.x release?
Comment #16
XerraX commentedsubscribing
Comment #17
syh commentedYes Dave; this is still valid in the 6.x-1.x release
Comment #18
Drupalized commentedsubscribing
Comment #19
chaps2 commentedI've tried quite hard to reproduce this bug and can't. It hasn't been reported for nearly 2 years so I'm marking as fixed.