Error when editing / submitting a node without categories
UnderDesign - August 1, 2006 - 12:42
| Project: | Taxonomy Limit |
| Version: | 4.7.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
I have a node type that doesn't have any categories at all. When I try to edit a node of this type, I receive the following error message at the top of the page:
Warning: Invalid argument supplied for foreach() in /var/www/modules/taxonomy_limit/taxonomy_limit.module on line 19
If I make changes and then submit that node, I receive the following errors:
Warning: Invalid argument supplied for foreach() in /var/www/modules/taxonomy_limit/taxonomy_limit.module on line 19
Warning: Cannot modify header information - headers already sent by (output started at /var/www/modules/taxonomy_limit/taxonomy_limit.module:19) in /var/www/includes/common.inc on line 266The page remains on edit (e.g., /node/edit/1290) but the changes are saved.
Also, the node type in question is a book page from the book.module so I'm not sure if this error is a general one for category-less nodes or if it is specific to the book node type - I haven't had a chance to do further testing.

#1
I've changed this to critical because the module cannot be used with this error present.
The line of code that seems to be causing the problem is:
foreach($tax_limit AS $vid => $data){#2
I have committed the changed code to CVS, a fresh version of the downloadable module should be available soon.
If you want to get it right now, you can browse the Web CVS repository and download the module only, and overwrite
your copy manually.
Thanks for the submission, did you at one point have categories on the content type that has the problem? If so, that
would explain why the error was happening. A hole in the checking for actual limit rules, my bad...
Cheers!
Gord.
#3
That seems to work fine now. I've tested it pretty thoroughly (all content types that I have) and there have been no problems.
RE: "did you at one point have categories on the content type that has the problem?", not that easy to say because, I noticed, since posting the issue that the error would appear regardless of what content type I was editing.
Hope that helps.
Regards
Patrick
#4