1

I have created a views list of users who are flagged offensive by other users.

I want a button in front of each user to clear that flag from him from every user. So if admin after checking the user decided that he was wrongly flagged he can simply remove that flag.

I have different view pages for each flag report like following

  • annoying
  • offensive
  • fake

So if I am on view page for list of annoying users, I need a link in front of each user to clear that flag from that user from all/any users.

  • any feedback about my answer? – Pierre.Vriens Dec 31 '17 at 19:00
0

I'm assuming this question is about D7 ...

Step 1

Start with creating an extremely basic Rules Component with a Rules Action to unflag (using the Flag module) a user, whereas you specify the user to be unflagged as a parameter for that Rules Component. And you pick one of the 3 flags you want to process (eg the "annoying"-flag).

Optionally include whatever Rules Conditions you might need (if any, eg to check if the user is flagged). FYI: this is really like a getting started with Rules ...

Step 2

Use the view of flagged user that you already have and transform that view into a view that uses Views Bulk Operations, and use the technique documented in "How to use Rules to create a custom bulk operation for a VBO view?".

In doing so, you'll then be able to use Rules Components (using the Rules module), in which you can then include the required logic to unflag a single user. I.e the Rules Component from Step 1.

Step 3

Use the checkmark in front of each user in your VBO view as the "button in front of each user to clear that flag" (as in your question), and select the custom VBO action that you created in Step 2.

Step 4

Repeat the previous steps for your additional flags, i.e. the "offensive"-flag and the "fake"-flag.

| improve this answer | |
  • Pierre, could you move the D7 assumption to the top? It would save others a lot of time if they know that before having read the entire answer ;) – Neograph734 Mar 27 '17 at 18:15
  • @Neograph734 : done .... – Pierre.Vriens Mar 27 '17 at 18:36
  • More user friendly this way, bedankt! :) – Neograph734 Mar 27 '17 at 18:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.