warning: Invalid argument
Duke Nukem - May 2, 2009 - 18:48
| Project: | Relevant Content |
| Version: | 6.x-1.4 |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | postponed (maintainer needs more info) |
Jump to:
Description
Hi, Thanks for great module.
But there is a problem in my site. When i try to show relevant content in CCK type. It shows a warning message. What can i do for solve this problem. Thank you.
warning: Invalid argument supplied for foreach() in /opt/modules/relevant_content/relevant_content_cck/relevant_content_cck.module on line 226.

#1
Hi,
I'm getting similar errors with D5 version:
...warning: Invalid argument supplied for foreach() in /var/www/drupal/sites/all/modules/relevant_content/relevant_content_cck/relevant_content_cck.module on line 99.
warning: Invalid argument supplied for foreach() in /var/www/drupal/sites/all/modules/relevant_content/relevant_content_cck/relevant_content_cck.module on line 211.
...
When this error appears, no related content is displayed. I'm using the CCK "relaed content" field, embedded into a fieldgroup. Node type: vanilla "article" (plus a bunch of CCK fields), one term from one vocabulary; the error appears also, when the node is tagged with two terms from two vocabularies.
I think, the reason for this error message is that no exactly matching content is available (the "related content" algorithm seems to be pretty simple; as far as I understand it, it does not evaluate text from the node's title or body to evaluate similarity (like the "Similar" module does, resulting in far better results).
Try adding content in the same category and have a look if the error disappears. If I'm right, maybe the error message simply should be suppressed or changed to a translatable string like "There is no related content available".
Greetings, -asb
#2
errors upon activating both modules:
warning: Invalid argument supplied for foreach() in path_to_drupal_root_directory\includes\form.inc on line 1200.warning: Invalid argument supplied for foreach() in path_to_drupal_root_directory\includes\form.inc on line 1200.
step two, add the relevant content cck field, get about two of these for each post on visiting the homepage with all the teasers, field set to display teasers.
warning: Invalid argument supplied for foreach() in /home1/reptilew/public_html/plasticapple/sites/all/modules/cck/content.module on line 1284Goes away when display set to 'title-link'.
#3
I'll have to take a look at this. Thanks.
#4
Possible dupe of #331625: foreach/sql errors when creating CCK fields
#5
Hi,
I'm setting this issue to "critical" since it breaks a lot of widely used other modules, e.g. "Views Bulk Operations" (VBO), and
relevant_content_cck.modulehas to be disabled every time they're being used.The patch provided in #331625: foreach/sql errors when creating CCK fields fixes the issue for D5 sites, but doesn't work for D6. However, even for D5 a new release including the patch would be nice ;)
Greetings, -asb
#6
I'm getting this error too with Relevant Content CCK module but only for nodes that DO NOT have related nodes.