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.
Comment | File | Size | Author |
---|---|---|---|
#10 | views_bulk_operations-hide_default_message-1963180-10.patch | 2.77 KB | kerasai |
#9 | interdiff-1963180-8-9.txt | 1.93 KB | kerasai |
#9 | views_bulk_operations-hide_default_message-1963180-9.patch | 3.15 KB | kerasai |
#2 | VBO_hide_default_message_form_item.png | 11.77 KB | Anthony Goode |
#2 | VBO_hide_default_message.png | 15.29 KB | Anthony Goode |
Comments
Comment #0.0
Anthony Goode CreditAttribution: Anthony Goode commentedI have created a sample patch to achieve this.
Comment #1
Anthony Goode CreditAttribution: Anthony Goode commentedThis 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.
Comment #2
Anthony Goode CreditAttribution: Anthony Goode commentedHere I upload graphical examples.
Comment #3
citricguy CreditAttribution: citricguy commentedThis would make for an awesome feature. How can I help?
Comment #4
Anthony Goode CreditAttribution: Anthony Goode commentedHi citricguy, have you tried the patch in any context?, I have not tried it since I first posted this issue.
Comment #4.0
Anthony Goode CreditAttribution: Anthony Goode commentedSpelling corrections
Comment #5
W.M. CreditAttribution: W.M. commentedAny updates / news regarding this issue? Thanks.
Comment #6
kenorb CreditAttribution: kenorb commentedComment #7
kerasai CreditAttribution: kerasai at Breakthrough Technologies, LLC commentedHere's a different take on solving this, I believe it's a cleaner solution.
A few changes in here:
ViewsBulkOperationsBaseOperation::completeMessage()
. In theory it can be customized by implementing a class extending the operation class and overriding this method.ViewsBulkOperationsBaseOperation::completeMessage()
analyzes a theadminOptions
property of the operation, and it will return NULL indicating the message should not be displayed.Comment #8
kerasai CreditAttribution: kerasai at Breakthrough Technologies, LLC commentedFound a bug causing all of the messaging to be hidden.
New patch and interdiff provided.
Comment #9
kerasai CreditAttribution: kerasai at Breakthrough Technologies, LLC commentedA 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.
Comment #10
kerasai CreditAttribution: kerasai at Breakthrough Technologies, LLC commentedAfter 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.