This is a bug involving integration with the core actions module and the Views Bulk Operations module.
Steps to reproduce:
0. Have a few taxonomy terms to work with.
1. Enable VBO, actions, flag module and actions integration for flag module.
2. Add a flag for nodes at /admin/build/flags/add.
3. Add an action for that flag, select "Modify node taxonomy terms."
4. Leave the default selection of "Add the selected terms" and choose one or more existing terms, submit the page.
5. Edit the action. The terms will have reverted black to blank/None/None Selected in each vocabulary, regardless of previous selection.
Using: Drupal 6.16, Views 2.8, VBO 1.9, Flag 1.2
At first I thought this was an issue with VBO, but infojunkie established that it's not in the related issue #674864: "Modify node taxonomy terms" changes are not taking effect:
In flag_actions.module, the code in flag_actions_form_submit() does:
$parameters = $form_state['values'];
unset($parameters['flag']);while the correct handling for actions parameters should be:
$parameters = call_user_func($callback . '_submit', $form, $form_state);
(The relevant code is on lines 463-464 in flag_actions.module.)
I've tried the suggested code replacement and it does work. But since this is an initial post I won't mark it as "needs review" just yet.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | flag_actions_form_callbacks.patch | 1.55 KB | quicksketch |
| #2 | fixflagactions.patch | 620 bytes | rootwork |
Comments
Comment #1
quicksketchThanks, a patch would be appreciate for this issue, especially since it will need to be tested an applied against multiple branches.
Comment #2
rootworkHere you are!
Comment #3
archetwist commentedI can confirm the patch works as intended.
Comment #4
robby.smith commentedsubscribing - will this go into 6.x-2.x-dev as well?
Comment #5
quicksketchHmm, this patch doesn't look correct. It doesn't seem right at all that a submit handler should manually be calling arbitrary additional submit handlers. Could some one explain why this is the correct approach or reference other forms that use this odd mechanism?
Comment #6
quicksketchWow, okay I forgot how sorta-hacky actions integration is. This patch was mostly correct, except it may cause issues on actions that don't specifically include a submit handler. Flag actions also has a problem similar to this one in that it doesn't execute validate handlers either. I've committed this patch which incorporates your changes in addition to adding validation handlers.
Comment #7
rootworkHooray! And thanks for working through the hackiness :)