Can't manage to create a flag

Created on 27 June 2025, about 1 month ago

I want to flag a content with a specific user.
I have the nid of the content and the uid of the user.
I've tried to create the flag with ECA flag after switching to the user and loading the content. But it doesn't work.
Is there any other way to do this ?

💬 Support request
Status

Active

Version

2.0

Component

Code

Created by

🇫🇷France alex.amtr

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

Comments & Activities

  • Issue created by @alex.amtr
  • 🇩🇪Germany jurgenhaas Gottmadingen

    A flag is a content entity, isn't it? So, you should create such an entity and set all the necessary fields values. Or which other way have you tried doing this?

    Side note: a screenshot of a log list doesn't help much. If logs contain important information, then copy & paste them so that one can search in it etc, but an image is not helping much.

  • 🇫🇮Finland anaconda777

    I am also trying this, I try to flag the current user. (Similarly as the user whould click the flag link)

    Trigger is "presave profile" and then I selected the flag name from the ECA templates, there is a flag named "follow".
    I try to flag the user to follow himself. Not able to do it, I have tried all user related tokens but it does not flag the user.

    So flags just cant be fired from ECA, similarly like users are clicking them, they need to be created?

  • 🇫🇷France alex.amtr

    Dear jurgenhaas,
    It was the right solution.
    Thank you very much for your advice.

  • 🇩🇪Germany jurgenhaas Gottmadingen

    Thank you @alex.amtr and @anaconda777 for your feedback, glad it's working.

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

Production build 0.71.5 2024