I get this notice after adding a new comment to a node.

Notice: Undefined property: stdClass::$new i mothership_preprocess() (rad 469 av /path to drupal/sites/all/themes/mothership/mothership/template.php).

CommentFileSizeAuthor
#2 add-isset-1651292-2.patch546 bytesrichardj

Comments

richardj’s picture

Seems that the check is wrong, should be:

    if (isset($vars['elements']['#comment']->new) && $vars['elements']['#comment']->new) {
      $vars['classes_array'][] = ' new';
    }

Because Drupal will remove 'new' when a post is not considered new anymore, so check for true will fail because it doesn't exist.

richardj’s picture

Status: Active » Needs review
StatusFileSize
new546 bytes

added patch

mortendk’s picture

Status: Needs review » Fixed
mortendk’s picture

Status: Fixed » Closed (fixed)