Posted by mpoplin on June 12, 2011 at 1:52pm
3 followers
Jump to:
| Project: | Workflow |
| Version: | 7.x-1.0 |
| Component: | Miscellaneous |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (cannot reproduce) |
Issue Summary
Hi, I'm having a good bit of trouble overriding the state transition box on my node edit form. I've had perfect luck overriding every other element on the page, however my function doesn't even register inside the workflow array. Here is my code:
if($form_id == 'job_posting_node_form') {
$form['taxonomy']['#title'] = 'Job tags';
$form['taxonomy']['#collapsible'] = FALSE;
$form['taxonomy']['#description'] = 'Pick some short tags to help describe the job.';
$form['workflow']['Job posting state']['#title'] = 'Optionally build your ad and save it for later or post it immediately.';
$form['workflow']['#collapsible'] = FALSE;
}Shown above the workflow is an override that works as intended while the bottom two just do nothing. It seems as if this form is being altered after the form is built so should I rebuild this form? I would appreciate some guidance greatly. Thanks!
Comments
#1
Check to make sure those values exist where you're making the change it's possible workflow is getting added to the form after your code runs, not before. If that's the case, then the standard workflow form is overriding your changes.
I don't have any example code to work with here (that's helpful), so I don't know what version of form_alter you're using to try to make the changes.
#2
I haven't heard back from you on this in awhile - so I'm going to assume you've gotten it taken care of. If not, let me know.
#3
I'm actually having a similar issue. I have implemented hook_form_alter in a module, but it appears that the workflow form is getting added after my hook_form_alter, and so my changes are getting overridden. I only wanted to change the weight of the workflow form, so that it appears on the bottom. Is there any way I can do this?
#4
You may want to try adding a weight to your module to be sure it executes after the workflow so you'll have something to override. Or you can try making your change in the afterbuild for the form. Either should let you get to the settings after workflow is done with them. Let me know if that works.
#5
I've not heard back from you on this, so I'm going to assume all is well and you've gotten this fixed up in afterbuild. Let me know if otherwise.