Closed (fixed)
Project:
Drupal core
Version:
4.7.x-dev
Component:
taxonomy.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
2 Jul 2006 at 16:32 UTC
Updated:
24 Nov 2006 at 18:05 UTC
During cron runs, I sometimes get a watchdog error like:
Message
Invalid argument supplied for foreach() in /home/site/public_html/modules/taxonomy.module on line 1184.
I think this is due to my use of taxonomy_access which rewrites the taxonomy selction query in node_load(), etc.
Attached patch adds an if clause around the foreach(). This patch works to eliminate the watchdog errors during cron runs.
Also fixes taxonomy_nodeapi to use pass-by-reference as per Drupal API (just noticed this while tracking the other error).
| Comment | File | Size | Author |
|---|---|---|---|
| taxonomy_foreach_patch0.txt | 831 bytes | pwolanin |
Comments
Comment #1
Alex Schenkman commentedI get the same error but I don't use taxonomy_access, I use og.
Any hints on how to fix it?
Thanks!
Comment #2
pwolanin commentedIf you're getting exactly the same error message, then I would think that applying the patch above will prevent the error from occuring. It may be a side effect of various access control schemes (including OG), not just TAC.
Comment #3
drummThe way to fix these bugs (in almost all cases) is to make sure the $node->taxonomy variable is properly initialized as an array (
... = array();)Comment #4
pwolanin commented@drumm - is there somewhere else to look to change the code to insure this initialization? For example, in taxonomy_nodeapi?
Comment #5
pwolanin commentedI'm not seeing this error any longer