Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
Stalski CreditAttribution: Stalski commentedThx , pushed to git. Weird mistake indeed.
Comment #2
KorbenDallas CreditAttribution: KorbenDallas commentedCool, thanks Stalski.