How to add a token with the flag to the Message module ?

Created on 14 June 2019, over 5 years ago
Updated 19 February 2025, 18 days ago

I have the [Message]( https://www.drupal.org/project/message ) module in Drupal 8 and I have created a Flag to mark the Message.

The machine name of my flag is mark_message

How can I display the Flag token (the link of the flag to mark and stand out) on my message ?

Here is the code in message_activity_stream.tokens.inc, but it does not end :

    foreach ($tokens as $name => $original) {
      switch ($name) {
        // Simple key values on the comment.
        case 'flag-mark-message-link':
          $replacements[$original] = $message->field_mark_message();
          break;

My problem :

The flag is not a field and it appears only in :

/admin/structure/message/manage/mas_create_node/display

How to create a flag link token ?

https://imgur.com/a/y595VTn

💬 Support request
Status

Closed: outdated

Version

4.0

Component

Flag core

Created by

🇫🇷France zenimagine

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024