If you add conditions to any rule component executed by Views bulk operations chances are that any conditions are not met. By default VBO shows a message after the operation is performed, either the message you created in the rule component says it failed or not.
If both messages are displayed it could be confusing for the user, because the operation was not performed completely, but the default message hints that it was.

So I think it is useful to have an option in each rule component available to hide the default message. It is a form item added to the rest of the options like "skip confirmation step" and "Enqueue the operation instead of executing it directly". With this added option you only modify the messages displayed when certain rules components are executed, and with the aid of rules conditional you can show different messages depending on the conditions.

I have created a sample patch to achieve this.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Anthony Goode’s picture

Issue summary: View changes

I have created a sample patch to achieve this.

Anthony Goode’s picture

This is the sample patch. It works for me as long as I have tried with the Drupal commerce module. I have not tried it in every options combination, so feel free to provide some feedback.

Anthony Goode’s picture

Here I upload graphical examples.

citricguy’s picture

This would make for an awesome feature. How can I help?

Anthony Goode’s picture

Hi citricguy, have you tried the patch in any context?, I have not tried it since I first posted this issue.

Anthony Goode’s picture

Issue summary: View changes

Spelling corrections

W.M.’s picture

Issue summary: View changes

Any updates / news regarding this issue? Thanks.

kenorb’s picture

Status: Active » Needs review
kerasai’s picture

Version: 7.x-3.1 » 7.x-3.x-dev
FileSize
3.7 KB

Here's a different take on solving this, I believe it's a cleaner solution.

A few changes in here:

  • Default message creation was removed from the 2 different places where it was being created. This now passes off the creation to a new method on the operation object, described next.
  • Default message is now created in a new method, ViewsBulkOperationsBaseOperation::completeMessage(). In theory it can be customized by implementing a class extending the operation class and overriding this method.
  • ViewsBulkOperationsBaseOperation::completeMessage() analyzes a the adminOptions property of the operation, and it will return NULL indicating the message should not be displayed.
  • An additional configuration is available in the Views field handler for the VBO, which will allow the message to be hidden via the method described above.
kerasai’s picture

Found a bug causing all of the messaging to be hidden.

New patch and interdiff provided.

kerasai’s picture

A bit of testing indicates that it wasn't quite working.

Here is an updated version, with the views handler reworked to pass along the option to the operation.

kerasai’s picture

After working with this VBO messaging a bit further, I propose we get #1327632: Support action specific status message reporting. in first as it would restructure the way messaging is handled a bit, then this issue.

The patch attached here is the same changes from #9 except it is applicable after the #1327632: Support action specific status message reporting. changes are in.