I am working on converting my Cloudflare module from Drupal 6 to Drupal 7.
http://drupal.org/project/cloudflare
One of the features of this module is to perform additional operations to the comments via adding options the drop down list in the comment administration section. Some of these operations involve reporting spam data to the Cloudflare service, then deleting the comment. Adding items to the drop down is easy, no problem there. But there appears to be issues with deleting comments. And by "issue", I don't mean that the comment.module isn't deleting the comments, it is; rather there are seven PHP errors that show up no matter how I go about deleting the comments:
Warning: Creating default object from empty value in comment_save() (line 1454 of .../Sites/drupal7/modules/comment/comment.module).
Notice: Undefined property: stdClass::$nid in comment_save() (line 1459 of .../Sites/drupal7/modules/comment/comment.module).
Notice: Trying to get property of non-object in comment_save() (line 1460 of .../Sites/drupal7/modules/comment/comment.module).
Notice: Undefined property: stdClass::$cid in comment_save() (line 1474 of .../Sites/drupal7/modules/comment/comment.module).
Notice: Undefined property: stdClass::$pid in comment_save() (line 1497 of .../Sites/drupal7/modules/comment/comment.module).
Notice: Undefined property: stdClass::$nid in comment_save() (line 1500 of .../Sites/drupal7/modules/comment/comment.module).
Notice: Undefined property: stdClass::$uid in comment_save() (line 1547 of .../Sites/drupal7/modules/comment/comment.module).
I will concede, maybe I'm going about deleting the comments incorrectly. I have tried three techniques with identical results. $cid is the comment id (integer).
TECHNIQUE 1:
comment_delete($cid);
TECHNIQUE 2:
comment_delete_multiple(array($cid));
TECHNIQUE 3:
$num_deleted = db_delete('comment')
->condition('cid', $cid)
->execute();
PHP 5.3.14 & PHP 5.4.4 both have the same result.
Thoughts?
Peace,
Brian
Comment | File | Size | Author |
---|---|---|---|
Screen shot 2012-08-28 at 6.13.49 PM.png | 146.04 KB | Brian294 |
Comments
Comment #1
valthebaldI couldn't reproduce the issue with vanilla installation of 7.15, 7.16 or latest 7.x-dev
Can you try to leave only cloudfire and core modules, and then only core modules, to see if messages still appear?
Comment #1.0
valthebaldadded an error message