Active
Project:
Workbench
Version:
7.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
26 Mar 2015 at 15:43 UTC
Updated:
10 Jun 2015 at 19:15 UTC
Jump to comment: Most recent
In my modules hook_form_alter I add a validation hook: array_unshift($form['#validate'], 'change_node_form_domain_selection_to_array');
but when workbench is enabled, this function is not executed.
Comments
Comment #1
eMuse_be commentedSo, I enabled workbench using a feature dependency.
I also have a custom module with a hook_form_alter that adds a validaiton hook to a form which worked fine. When workbench was enabled, the hook was executed, and the validation function added to $form['#validate'], but it was no longer executed.
- I removed all workbench dependencies and settings from features.
- I disabled the workbench + moderation module.
- I enabled the workbench + moderation module.
everything started working again.
This means we cannot feature any workbench settings.
Comment #2
sgdev commentedI just ran into this same issue. Had some Workbench Moderation settings enabled through a feature, and unable to append a
$form['#validate'][]through ahook_form_alterfor a content type.Also tried the exact same approach as @eMuse_be ... I used an
array_unshiftfunction to put the custom#validateat the front of the array, but still no results.Once I disabled the Workbench settings feature, I tested again to see if the validation would work. It did not. I follow the steps that @eMuse_be documented of disabling Workbench and Workbench Moderation, then re-enabling both of them, and the validation started to work again.
I'm using Workbench 7.x-1.2 and Workbench Moderation 7.x-1.4. Also use Workbench Access 7.x-1.2.
Comment #3
andreyjan commentedAs a workaround you can add validate callback to form actions:
$form['actions']['submit']['#validate'][] = 'your_module_node_form_validate';Comment #4
laserlight commented@andreyjan, That worked for me. It's ironic that I had to do that, to point to my hook_node_validate().