Hi,
I'm trying to change the activity messages by changing the message template in $context, but I found it is not working. You may suggest to use hook_activity_messages_alter instead. But the information available via parameters are limited.

function mymodule_activity_record_alter(&$record, &$context){
    $context['comment-pattern-en'] = 'Hi, [user] commented on [activity-node-link]';
}

Above code is only a test. My actual requirement is to change the user_relationships activities depending on the relationship type. This is not possible with the template configurations provided by default.

Thank you

Comments

Scott Reynolds’s picture

Title: hook_activity_record_alter to alter activity messages » hook_activity_messages_alter to alter activity messages

context isn't passed by reference, so what you are trying will not work. In order to change the messages you must use hook_activity_messages_alter.

Please provide a proposed solution to adjusting hook_actiivity_messages_alter to meet your requirements.

_shy’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

D6 reached its EOL back in February 2016, and there is no active release for D6 for this module anymore.
Development or support is not planned for D6. All D6-related issues are marked as outdated in a bunch.

If the issue remains relevant for D10+ versions, merge requests with proposed solutions for a new module version (D10+) are welcome in a new follow-up issue.

Thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.