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.
I am getting this error while using hook_heartbeat_message_alter()
Recoverable fatal error: Argument 2 passed to hook_heartbeat_messages_alter() must be an instance of HeartbeatStream, null given, called in basesite/sites/all/modules/contrib/heartbeat/includes/heartbeatstream.inc
Comments
Comment #1
chhavik CreditAttribution: chhavik commentedStalski,
I am getting the same error. I tried to alter the messages for default "Node Activity" stream using hook_heartbeat_messages_alter
I am using dev version. Below is the error:-
Notice: Undefined property: FavoritesActivity::$_heartbeatState in HeartbeatStream->checkAccess() (line 731 of /var/www/dr7/sites/all/modules/heartbeat/includes/heartbeatstream.inc).
Recoverable fatal error: Argument 2 passed to custom_heartbeat_messages_alter() must be an instance of HeartbeatStream, null given, called in /var/www/dr7/sites/all/modules/heartbeat/includes/heartbeatstream.inc on line 731 and defined in custom_heartbeat_messages_alter() (line 157 of /var/www/dr7/sites/all/modules/custom/custom.module).
Comment #2
Stalski CreditAttribution: Stalski commentedJust pushed the fix to git a moment ago.
Comment #3
prashantgoel CreditAttribution: prashantgoel commentedthanks stalski