Hello,

thank you for this module !
I have a notice "Trying to get property of non-object in comment_notify_get_user_node_notify_preference()"

This is actuel code:

function comment_notify_get_user_node_notify_preference($uid) {
  $setting = comment_notify_get_user_notification_setting($uid);
  if (!$setting) {
    $settings = comment_notify_get_default_notification_setting();
  }
  return $setting->node_notify;
}

After fix, I just rename the variable (settings->setting) :

function comment_notify_get_user_node_notify_preference($uid) {
  $setting = comment_notify_get_user_notification_setting($uid);
  if (!$setting) {
    $setting = comment_notify_get_default_notification_setting();
  }
  return $setting->node_notify;
}

I do a patch for this right now.

CommentFileSizeAuthor
#1 wrong_variable_name-1774894-1.patch545 bytespoukram
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

poukram’s picture

Status: Active » Needs review
FileSize
545 bytes

This is the patch

OddJob’s picture

When and how did you experience the error?

I am using 7 and I have experienced no errors, I can see the difference in code. However I do not see any errors.

Could you specify when and how the error occurred, which circumstances?

greggles’s picture

Status: Needs review » Fixed

Makes sense, @poukram. Thanks for the issue and patch - now committed http://drupalcode.org/project/comment_notify.git/commit/71fa5a5

Status: Fixed » Closed (fixed)

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