Active
Project:
Workbench Access
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
11 Jul 2012 at 04:59 UTC
Updated:
13 Jul 2012 at 16:41 UTC
It took me some time and an upgrade to the latest dev of workflow_access to get hook_workbench_access_node_element_alter to run to make some alterations to the default element.
I've found that when the hook is running in my_module.workbench_access.inc it only fires on the first page load after flushing the cache. From then on it doesn't run again and $element is back to the default state it was in before the alter.
If the hook is in my_module.module it runs each time the node form is loaded, which is the behaviour I would have expected.
Comments
Comment #1
agentrickardThat actually could be a core bug. Do you have code you can share?
Comment #2
ericaordinary commentedThis is an example of the function that is working in my_module.module but not in my_module.workbench_access.inc:
When it's in .inc it will fire the first page load after a cache clear, but from then on #access is back to true. I also tested just making a simple change to the Section field label with the same result.
I also tried using the form_alter hook provided in the API but I couldn't get that function to fire at all, no matter which file it was in. This may or may not be related.
Comment #3
agentrickardIt may be that form caching doesn't allow this. I'll test.