How can I simplify the use of flags with Views Bulk Operations? I have an administrative display (made with views) that lists content that is pending approval.

In the case of my site, approval means flagging with the approval_for_pub flag (which triggers a custom rule).

VBO allows nodes to be flagged/unflagged all at once by clicking a handy button:



However, upon clicking this button, by default it shows all possible flags and the flag/unflag option:



This is a problem on my site because some of the people responsible for approval get confused by the names of the flags and select the wrong option.  So, what I would like to do is create a VBO option that, when the button is pressed, automatically flags all applicable content with the approval_for_pub flag.

How can I approach this?

It seems like a small detail, but this step happens several times a day, so the chance of making a mistake is quite high.
Instead of using the "Flag (or unflag) a node" action directly, create new a rules component and show it in your administrative view.


Navigate to Configuration » Workflow » Rules » Components
Click on Add new component , choose Rule from the components plugin drop-down menu.
Choose a name (e.g. Approve), add a parameter with the type node.
Add a condition, choose Node is flagged from the drop-down menu.
Choose the appropriate flag, select the node-parameter for the node, choose site:current-user for the user on whose behalf the flagging-action will be performed, select negate such that the condition will evaluate to true when the node is not flagged.
Add an action, choose Flag a node from the drop-down menu.
Choose the appropriate flag, select the node-parameter for the node, choose site:current-user for the user on whose behalf the flagging-action will be performed.


Edit your administrative view, configure bulk operations such that the Approve operation is shown instead of the Flag (or unflag) a node