If an activity in the activity stream has a group context, the token that renders the group url in the message is rendered wrong.

The token that is used is: [message:gurl]
What happens in activity_logger.tokens.inc on line 99 is

              // If it's a group.. add it in the arguments.
              if (isset($group) && $group instanceof Group) {
                if ($name === 'gtitle') {
                  $replacements[$original] = $group->label();
                }
                if ($name === 'gurl') {
                  $gurl = Url::fromRoute('entity.group.canonical', array(
                    'group' => $group->id(),
                    array()
                  ));
                  $replacements[$original] = $gurl->toString();
                }
              }

It tries to create an URL from a route but Url::fromRoute is used with an empty array, thus the Drupal URL generator thinks it should render an URL with a query. But nothing is provided. So we can get rid of the query and it will work.

screenshot

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ronaldtebrake created an issue. See original summary.

ronaldtebrake’s picture

Assigned: Unassigned » ronaldtebrake
ronaldtebrake’s picture

jochemvn’s picture

Status: Needs review » Fixed

This fixed the issue. It will be part of the 1.1 release

  • ronaldtebrake committed 2bd362e on 8.x-1.x
    #2892737 by ronaldtebrake: Render token for message:gurl without...
  • a4d75a3 committed on 8.x-1.x
    Merge pull request #466 from goalgorilla/feature/2892737-message-gurl-...

Status: Fixed » Closed (fixed)

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