Missing actions
Darren Oh - June 12, 2009 - 17:44
| Project: | Views Bulk Operations (VBO) |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | closed |
Description
CVS commit 83377 introduced a serious problem. The intent was to make operation keys independent of callback names, but it uses an MD5 hash of the callback name for the operation key. This means that if the callback name changes, it is very difficult to figure out what the action was supposed to be. It also makes it impossible to write default views that include configurable actions. Patch to follow.

#1
See the patch in comment #3 of issue 489230 for an example of the problem.
#2
Thanks for your patch. I'll review it and commit it.
#3
This patch breaks the VBO settings page. If you try to checkmark node_operations with arguments, or saved actions, you will find that these items are not selectable and the settings don't get saved correctly. The problem is that the new keys now contain serialized arguments that break the HTML because they're used as form keys (which is the whole point of the patch). This won't work.
I wouldn't mind fixing the problem for saved actions (i.e. getting over the numeric callback issue) but unless you come up with a better scheme than this, I'll stick to md5.
#4
How about md5'ing the serialized parameters if any?
#5
That would still make it difficult to determine what the operation should be if the required parameters happen to change. The attached patch should fix the problem.
#6
Your patch did not resolve the issue. I now get "An illegal choice has been detected. Please contact the site administrator." when I select any new operation and try to update the view.
Before submitting a patch, please make sure that the affected functionality hasn't broken. In this case the smoke tests should include:
* Applying update and making sure it does not generate errors or warnings
* Opening an existing VBO such as admin/content/node2 and making sure the selected operations are still listed
* Selecting a few nodes and applying an operation on them
* Opening VBO settings > "Bulk operations" style settings and making sure the HTML generated for the operation checkboxes is valid
* Selecting/disabling a few operations, saving the view, and making sure the changes are reflected on the VBO page
This will avoid wasting my time and yours! No offense meant.
#7
This patch has been tested. It follows the suggestion in #4. I consider this a Drupal bug.
Further research reveals that the $_POST variable in PHP 5 has HTML entities decoded by default. It would require a rewrite of the forms system to ensure that it works with any filter.default setting, so we will probably need to work around this bug for the foreseeable future.
#8
I committed a fix to this issue. Your latest patch contained one last problem, namely that it broke the execution of saved actions (the ones with numeric callbacks). I fixed this.
#9
Automatically closed -- issue fixed for 2 weeks with no activity.