Notice: Undefined variable: account in heartbeat_api_log() (line 792 of C:\xampp\htdocs\drupal\sites\all\modules\heartbeat\heartbeat.module).
Notice: Trying to get property of non-object in heartbeat_api_log() (line 792 of C:\xampp\htdocs\drupal\sites\all\modules\heartbeat\heartbeat.module).

This section looks to be the culprit:

function heartbeat_api_log($message_id, $uid, $uid_target = 0, $nid = 0, $nid_target = 0, $variables = array(), $access = NULL, $time = 0, $in_group = 0) {

  $template = heartbeat_message_template_load($message_id);

  // Access can be given but usually we calculate it from Template Permissions
  // and overridable with the setting of the user.
  if (!isset($access) || !is_numeric($access)) {
    $access = _heartbeat_activity_get_access($account->uid, $template);
  }

In this function the object $account is never created. Changing it to $uid fixed the error for me:

function heartbeat_api_log($message_id, $uid, $uid_target = 0, $nid = 0, $nid_target = 0, $variables = array(), $access = NULL, $time = 0, $in_group = 0) {

  $template = heartbeat_message_template_load($message_id);

  // Access can be given but usually we calculate it from Template Permissions
  // and overridable with the setting of the user.
  if (!isset($access) || !is_numeric($access)) {
    $access = _heartbeat_activity_get_access($uid, $template);
  }

Comments

Stalski’s picture

Status: Needs review » Closed (fixed)

Thx , pushed to git. Weird mistake indeed.

KorbenDallas’s picture

Cool, thanks Stalski.