NULL values set for users without permission
ktleow - July 5, 2008 - 02:03
| Project: | Comment CCK |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
I get this error after submitting a comment with comment cck:
warning: Invalid argument supplied for foreach() in D:\Server Root\WWW\demo\sites\all\modules\cck\content.module on line 1112.
Another thing is, if the cck field is set to Optional (not required), i can't submit any comment.
And there is two of the same field appearing in comment there. Probably due to CCK problem?

#1
Presumably fixed by http://drupal.org/node/281587, reopen if problem still occurs.
#2
Automatically closed -- issue fixed for two weeks with no activity.
#3
Apparently, the problem is actually that if a user posts a comment but cannot alter CCK fields, then the CCK fields are accidentally erased, which causes the empty foreach().
Researching.
#4
Hm. Commenting without being able to edit CCK fields causes bad errors.
warning: array_merge() [function.array-merge]: Argument #2 is not an array in /*/sites/all/modules/comment_cck/comment_cck.module on line 124.warning: Invalid argument supplied for foreach() in /*/modules/cck/content.module on line 853.
warning: Invalid argument supplied for foreach() in /*/modules/cck/content.module on line 895.
warning: Invalid argument supplied for foreach() in /*/modules/cck/includes/content.token.inc on line 18.
#5
#6
The problem occurs during hook_comment, when the module assumes that all users can edit cck through comments, which is not always true.
Patch also removes a redundant node_load() during the array_merge on the 'insert' $op.
#7
Comitted
#8
Automatically closed -- issue fixed for two weeks with no activity.