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?

CommentFileSizeAuthor
#6 comment_cck.patch1.21 KBagentrickard

Comments

gerhard killesreiter’s picture

Status: Active » Fixed

Presumably fixed by http://drupal.org/node/281587, reopen if problem still occurs.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

agentrickard’s picture

Title: It doesn't work, error messages. » NULL values set for users without permission
Status: Closed (fixed) » Active

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.

agentrickard’s picture

Status: Active » Closed (fixed)

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.
agentrickard’s picture

Status: Closed (fixed) » Active
agentrickard’s picture

Status: Active » Needs review
StatusFileSize
new1.21 KB

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.

gerhard killesreiter’s picture

Status: Needs review » Fixed

Comitted

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.