diff options
author | David Rothstein <drothstein@gmail.com> | 2015-03-29 16:31:39 -0400 |
---|---|---|
committer | David Rothstein <drothstein@gmail.com> | 2015-03-29 16:31:39 -0400 |
commit | ab192786436ba867cc84ad4caca26372561845fd (patch) | |
tree | 423ab2a12263818043bca90324263e09e9485eab /modules/comment/comment.module | |
parent | 26d794fac95c9bfbdffe24cd9028d7e338717159 (diff) | |
download | brdo-ab192786436ba867cc84ad4caca26372561845fd.tar.gz brdo-ab192786436ba867cc84ad4caca26372561845fd.tar.bz2 |
Issue #1461732 by filijonka, Cottser, dcam, marcingy, swentel, udaksh: Fatal error when using the Comment module's "Unpublish comment containing keyword(s)" action
Diffstat (limited to 'modules/comment/comment.module')
-rw-r--r-- | modules/comment/comment.module | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/comment/comment.module b/modules/comment/comment.module index 2972474c0..6f0df6cae 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -2607,7 +2607,7 @@ function comment_unpublish_action($comment, $context = array()) { /** * Unpublishes a comment if it contains certain keywords. * - * @param $comment + * @param object $comment * Comment object to modify. * @param array $context * Array with components: @@ -2619,10 +2619,13 @@ function comment_unpublish_action($comment, $context = array()) { * @see comment_unpublish_by_keyword_action_submit() */ function comment_unpublish_by_keyword_action($comment, $context) { + $node = node_load($comment->nid); + $build = comment_view($comment, $node); + $text = drupal_render($build); foreach ($context['keywords'] as $keyword) { - $text = drupal_render($comment); if (strpos($text, $keyword) !== FALSE) { $comment->status = COMMENT_NOT_PUBLISHED; + comment_save($comment); watchdog('action', 'Unpublished comment %subject.', array('%subject' => $comment->subject)); break; } |