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

Gerhard Killesreiter - July 14, 2008 - 20:33
Status:active» fixed

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

#2

Anonymous (not verified) - July 31, 2008 - 04:47
Status:fixed» closed

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

#3

agentrickard - September 8, 2008 - 19:03
Title:It doesn't work, error messages.» NULL values set for users without permission
Status:closed» 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.

#4

agentrickard - September 8, 2008 - 19:31
Status:active» closed

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

agentrickard - September 8, 2008 - 19:31
Status:closed» active

#6

agentrickard - September 8, 2008 - 21:24
Status:active» needs review

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.

AttachmentSize
comment_cck.patch 1.21 KB

#7

Gerhard Killesreiter - September 8, 2008 - 21:37
Status:needs review» fixed

Comitted

#8

Anonymous (not verified) - September 22, 2008 - 21:42
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.