Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [flags]

Use it for the module implementing a flexible flagging system, completely customizable by the administrator users: the Flag module.

Filter by
Sorted by
Tagged with
0 votes
0 answers
16 views

Flagging users of another role to not see me in a user listing

I am looking for a way to achieve this: Everything happens with logged in users User with Role A can flag users of Role B User with Role B can see a views list of users with Role A EXCLUDING the users ...
Matthias's user avatar
0 votes
0 answers
19 views

Flag event is invoked twice on double submission of flag confirmation form

The method invoked during the flagging event is implemented in Symfony\Component\EventDispatcher\EventSubscriberInterface. class JIEventSubscriber implements EventSubscriberInterface{ protected $...
peebs124's user avatar
0 votes
1 answer
47 views

Is it possible to favorite/bookmark Search API results using Flags or similar?

We are using the Flag module to create favorites of Nodes and this works great for allowing users to bookmark specific Nodes. The client also wants to bookmark search results from the Search API Views ...
quantumized's user avatar
  • 1,227
0 votes
1 answer
46 views

For ECA, how can I create a flag that unpublishes a comment, using 'classic modeller'?

Rules and Rules_flag is not working well in Drupal 10.1, though I had a solution working in Drupal 9.5. The goal: a flag on each comment that unpublishes the comment, when a user clicks the flag. ...
aharown07's user avatar
  • 392
0 votes
0 answers
253 views

How create a custom views contextual filter?

I've a site using Drupal 10.1.x. I need to implement the following requisites: Let the users choose their "most liked" nodes (bundle product). This bundle has a entity reference field to ...
Giuseppe's user avatar
  • 971
0 votes
1 answer
21 views

How to move on to the next profile page in views after flagging a profile within the view?

I created a view that current user can use to search/view user profiles. The view lists user profiles and shows one at a time. A profile page can be either flagged “Like” or “Pass” (dating website ...
Dee's user avatar
  • 512
0 votes
1 answer
86 views

Can a Rules action send an email to all users that have set a flag?

I've found some older Drupal 7 info on this, but not much for Drupal 8+ yet. What I want to do: Give users the ability to set a 'notify me' flag on nodes When a comment is added to the flagged node, ...
aharown07's user avatar
  • 392
0 votes
0 answers
30 views

Where to implement CSS previously implemented by CSS_editor now deprecated

Views with tables have a Flag that changes from Pending to Complete when the row is completed. The background of the entire row changes color depending upon the word. Working css_editor code (theme ...
DStrider's user avatar
  • 135
1 vote
1 answer
78 views

How can I set a Rules action to unpublish a comment when a specific flag is set?

I'm attempting to create a flag that will unpublish a comment when the flag is set on that comment. I'm attempting to use Rules, Flag, and Rules Flag to achieve this. The comment type is default '...
aharown07's user avatar
  • 392
0 votes
1 answer
33 views

How can I use Feeds to import flaggings with Flag 4.x?

I'm trying to set up the Feeds module to import flaggings with the Flag module on Drupal 9. However, I keep getting errors. What is the minimum necessary configuration to import flaggings?
Patrick Kenny's user avatar
1 vote
1 answer
68 views

Call to undefined function flag_get_flag() with Flag 4.x

I'm using the 8.x-4.0-beta3 release of the Flag module in a custom D9 module to flag a newly programmatically created node using a flag I created in the UI. $flag = flag_get_flag('new_call'); $flag-&...
Riley Lutz's user avatar
1 vote
1 answer
26 views

How can I use a different dialog for flag removal than for setting the flag?

My project has a special flag with an entity reference field in it to nodes of a content type I'll call here "bucket." How it works: The flag "add to bucket" appears on nodes of ...
aharown07's user avatar
  • 392
0 votes
1 answer
18 views

Disabling Flag link access on view

I have a custom entity displayed in a view. If some field is of a certain value, the Flag link should not be available and replaced by some text. function my_module_preprocess_flag(&$vars){ $f = ...
ProjectAlice's user avatar
1 vote
1 answer
34 views

Custom Flag not appearing in "Configure Relationship: Flags"

I am building a community site to link former co-workers. I have used the Flags module to allow users to tag locations/teams. I am trying to use views to now list all the users who have flagged a ...
After the Mouse's user avatar
1 vote
0 answers
40 views

Separate templates for flag links on views and node page

I have a flag called bookmark. The link to this flag is available on a View and the node page. On the view, I would like this flag link to only display as an icon as the link. On the node page, I ...
ymdahi's user avatar
  • 630
1 vote
0 answers
28 views

Is it possible to create a view of a user's content and content they've flagged?

I'm trying to build a view that displays nodes authored by a user AND nodes flagged by the user (but are authored by other users). All the nodes are the same content type. I can create the two views ...
cofihouse's user avatar
3 votes
1 answer
221 views

Custom AJAX Response not firing on Flag action

I'm trying to run custom javascript functions at the same time as people interact with certain flags on my site, I have followed this tutorial on how to respond to both Flag/Unflag actions, and this ...
Andrew Morris's user avatar
3 votes
0 answers
409 views

How to refresh/rebuild block without reloading the page?

I have a custom block which displays the number of events added to favorites(Flag module). I am using the TWIG template to display those results. I want to refresh the block contents right after the ...
ProjectAlice's user avatar
1 vote
0 answers
100 views

How to reload flagging form via ajax?

My task is to ajaxify complex flag form (with additional fields). I need this because the default ajax flag does not dupport fiedls. I need to have the flagging form for create flag and then update it ...
Sergey Kravchenko's user avatar
0 votes
1 answer
446 views

How do I programmatically set a flag's custom entity reference field when programmatically setting the flag?

Some background: I'm new to Drupal 8/9 module building. I need a particular content type's nodes to be automatically flagged. I have this working using the code below. However, the flag involved also ...
aharown07's user avatar
  • 392
0 votes
1 answer
738 views

How to use hook_node_insert to automatically flag nodes of a specific content type

All nodes of one content type in my project need to get automatically flagged (by the Flags module) when created. I'm aware that there is probably a way to accomplish this using Rules module, but I'm ...
aharown07's user avatar
  • 392
0 votes
0 answers
26 views

Views: count flaggings per entity-referenced node

I have a flag called Collect. (Flag is individual, and enabled on multiple content types.) The flag has an entity reference field to a content type called Bucket. When users flag nodes, they go to a ...
aharown07's user avatar
  • 392
0 votes
2 answers
472 views

How to create a taxonomy term from a webform

New to Webform. What I'm trying to do is build a somewhat simple site content-collecting tool using Webform. So users would 'collect' nodes by submitting forms on them. This appears to be easy to do. ...
aharown07's user avatar
  • 392
0 votes
2 answers
619 views

How to create a view showing Users who have flagged AND are flagged by the current user

I'm trying to display a list of users who have flagged the current user, and are flagged by the current user. So a two-way flagging. I've tried using different relationships and arguments in views, ...
Yuckle's user avatar
  • 116
0 votes
1 answer
1k views

Success with cookie, fails with JWT: RuntimeException: Failed to start the session because headers have already been sent

My Controller is working with cookie auth but failing with JWT. This Controller is supposed to flag an entity for the logged-in user. If I am using cookie auth, there are no errors and everything ...
Patrick Kenny's user avatar
0 votes
1 answer
330 views

How to unflag/reset a flag again, when matching some conditions in onFlag event?

in my custom module I have an event subscriber service for flag module. I used the tutorial here as a base for learning: Link to Tutorial Here is my code: namespace Drupal\MYMODULE\EventSubscriber; ...
dercheffe's user avatar
  • 151
1 vote
0 answers
102 views

Flag commerce product variation breaks page

I am building a shop on Drupal 9 ,Commerce 2, and want to implement a "my favorite products"-bookmark, so that a user can bookmark products and save them for later. So, I installed flag ...
user avatar
1 vote
1 answer
194 views

In hook_form_alter(), how can I access the entity that is being flagged?

In hook_form_alter(), I want to load the entity being flagged so that I can do some processing based on the field values of that entity. However, I can't find an entity object using kint($form). I ...
Patrick Kenny's user avatar
0 votes
1 answer
93 views

How to have users set a value for a flag field upon flagging?

I added a field (Text list of options) to my flag. But, when a user flags the content, they don't get a chance to set the value for the field (the flagging form does not show the field to edit). ...
Patrick Kenny's user avatar
2 votes
1 answer
301 views

With a view of flaggings, how do I get the flagged entity?

I want to create a view of flaggings and show content from the flagged entity. However, on a flaggings view (Flag 4.x, Drupal 8/9), when I try to add a relationship, I can only add a relationship to ...
Patrick Kenny's user avatar
-1 votes
1 answer
94 views

How to update the TWIG flag conditions?

I have this code in my sub theme : bootstrap_subtheme_front_office_old.theme <?php /** * Implements hook_preprocess_HOOK() for user.html.twig. */ function ...
fire's user avatar
  • 87
1 vote
2 answers
232 views

How do I redirect on flag save programmatically?

I want to redirect users to a view when they flag a taxonomy term. This question is about how to use Rules to redirect on flag save. I want to do this programmatically. I tried to use hook_form_alter(...
Patrick Kenny's user avatar
-3 votes
1 answer
76 views

Unable to display message when account is flagged

I have this code in my sub theme : bootstrap_subtheme_front_office_old.theme <?php /** * Implements hook_preprocess_HOOK() for user.html.twig. */ function ...
fire's user avatar
  • 87
0 votes
0 answers
67 views

Send email notifications to Users who have flagged a node

For a site, I 'Events' which have a datetime field for the start time of the event. We also have 'Flags' to allow Users to add specific events to their calendar. Now, we would like to send Users email ...
Darcy's user avatar
  • 145
-2 votes
1 answer
273 views

How to put a condition in TWIG "if the user is flagged"?

I have a site with Drupal 8 and the Flag module. I would like to display a text when the user has the association role and when it is flagged with the following flag (his machine name): ...
user avatar
-1 votes
1 answer
101 views

How to automatically flag entities once (without PHP error)?

I created a custom module to automatically flag new entities and update entities. It works :-) Here is the problem : If I update a neud it is flagged. Perfect that's what I want to do, but if I update ...
sdfff's user avatar
  • 61
-2 votes
1 answer
94 views

How do I flag new user accounts or updated accounts?

I created a custom module to automatically flag new user accounts and updated accounts. When I create a new user or update an existing account, it is not automatically flagged and there is no error ...
sdfff's user avatar
  • 61
0 votes
2 answers
264 views

How do you target a specific type of content?

I have the content type (node), article, page, recipe. The code below can be used to flag any type of content. How do you target a specific type of content ? For example I only want to flag the ...
sdfff's user avatar
  • 61
1 vote
1 answer
75 views

How do I get the administrator to automatically flag?

I created a module for flagging entities automatically when created or updated. There are some errors in my code because only nodes work. If a user "user1" creates a node, the flag will be ...
sdfff's user avatar
  • 61
-1 votes
1 answer
85 views

How do I flag the update store automatically?

I created a flag to flag the stores. I want when a user updates a store, the store is automatically flagged. The code below does not work and there is no error message. I don't want to use the Rules ...
sdfff's user avatar
  • 61
-2 votes
1 answer
67 views

Cannot flag nodes and comments automatically

I created a code to automatically flag nodes and comments. When I put only the code to flag the nodes, it works. But when I add the code to flag the comments it doesn't work anymore. Which code should ...
sdfff's user avatar
  • 61
0 votes
1 answer
196 views

How can I automatically flag new comments?

I have a Drupal 8 site with Flag and Rules modules. How to flag a new comment ? I want that when a user creates a comment, the comment should be automatically flagged. I created a type of Flag on the ...
sdfff's user avatar
  • 61
0 votes
1 answer
388 views

How to flag an entity when it is created or updated?

I have a Drupal 8 site with the Flag module. I want when a user creates or updates a node, product, store, group, ... the updated entity is flagged. How to flag an entity when it is created or updated ...
sdfff's user avatar
  • 61
0 votes
1 answer
40 views

How do I get low level data from the Flag module?

Is it possible to get the following raw, low level data from the Flag Module and/or it's services? Flagging count as integer URL to flag/unflag as a string Current user's flagging status as boolean ...
oliver_siegel's user avatar
0 votes
1 answer
119 views

How can I programmatically flag a user?

I am creating a new user programmatically in drupal7. At the time of user creation is there any way to flag the user automatically. I am using flags module. I tried in the hook_user_presave function ...
Jaseer Kinangattil's user avatar
2 votes
1 answer
459 views

How can I show the flagging field edit form on a node?

On a flagged node, instead of showing the flag/unflag link, I want to show the flag edit form. Here's my setup. Basic page content type can be flagged with the flag Bookmark. Bookmark is a per-user ...
Patrick Kenny's user avatar
1 vote
2 answers
138 views

How do I make a link to a flagging edit page?

I'm using Drupal 8 with Flag 4.0-beta1. On my flag, I have several fields. I want users to be able to edit these fields after making the flag. How can I make a link to edit the flagging? I tried ...
Patrick Kenny's user avatar
0 votes
1 answer
132 views

How do I make a link to a flag edit page?

I'm using Drupal 8 with Flag 4.0-beta1. On my flag, I have several fields. I want users to be able to edit these fields after making the flag. How can I make a link to the flag edit page? I found ...
Patrick Kenny's user avatar
1 vote
1 answer
355 views

Invalid CSRF token using flag.link_builder service (Flag module)

I have a REST route that returns a list of user accounts. I have a flag setup called 'following' as you can follow and unfollow other members. In my REST route, I use: $flag_link = \Drupal::service('...
Ronnie's user avatar
  • 487
3 votes
1 answer
331 views

How can I write into a Flag's custom field programmatically?

I successfully managed to save a flag programmatically in Drupal 8 thanks to this help but I cannot manage to save data into a custom field I added to the flag entity. The following code saves the ...
Davide Catani's user avatar

1
2 3 4 5
10