By El Bandito on
Hi
I'd like to add a second submit button the my node form that overrides the content type setting 'Create new revision' which is enabled and submits WITHOUT creating a new revision. In this way my users will be able to save the form frequently without being overwhelmed by revisions if they need to revert.
Problem is I am not sure where to start. Any suggestions or pointers appreciated.
Comments
I can see in the code for
I can see in the code for node_save that it checks whether $node->revision is emty to decide whether a revision is created, but I don't know how this interfaces or otherwise with the node_form submission process ?
I'm still trying. My best,
I'm still trying. My best, but failed attempt, is adding second submit button which runs my custom submit handler prior to the default 'node_form_submit' handler thus :
I was hoping that changing $form_state['values']['revision'] from 1 to 0 would have the required effect but sadly not.
Any guidance would be much appreciated.
I eventually found that I
I eventually found that I have to set $form_state['rebuild'] to TRUE like :
but I don't really understand why. The Form API is mighty confusing.
Any guidance appreciated.
Ignore my nonsense about
Ignore my nonsense about $form_state['rebuild'].