Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
With 'preview post' set to 'optional' (in admin/node/configure), the node/add pages show a both 'preview' and 'submit' buttons at the bottom of the page (the correct behavior). But if your submitted page has an error (if for instance you forgot to add a Title), the 'submit' button goes away leaving only the 'preview' button.
The submit button seems to get clobbered whenever the drupal_set_message() is called, but there may be more to it than this.
Comment | File | Size | Author |
---|---|---|---|
#9 | improve_node_submit_behavior.patch | 844 bytes | TDobes |
Comments
Comment #1
moshe weitzman CreditAttribution: moshe weitzman commentedif your form submission has errors, then we remove the submit button until you fix those errors. please re-open this case with more detail if this does not resolve the issue ... by design.
Comment #2
jjeff CreditAttribution: jjeff commentedHi Moshe,
That would be true if 'preview post' was not set to 'optional' (see above). However, because of this setting, 'submit' should always be available. Even if there was an error.
The system shouldn't require a user to preview their post just because there was an error the first time they submitted.
-Jeff
Comment #3
Eric Scouten CreditAttribution: Eric Scouten commentedCan somebody please justify why this is "by design"? The existing behavior strikes me as almost the single most annoying thing about Drupal. I often hack it out of my site installations.
Comment #4
Bèr Kessels CreditAttribution: Bèr Kessels commentedIMHO, this is a useabilty task: not so much a bug. WE should re-think this, since indeed its strange behaviour.
When "preview" is required this all works as it should. But lets takea case where preview is optional:
I fill in a form incorrect press [submit]
I get the form back with an error.
I correct that error, and want to re-submit. Not possible.
I have to preview (but I already fixed that error, so I should be able to submit right away, as i did in step 1)
After preview I find out i fixed the error (doh)
I can now submit.
That is one page-load and two steps too much, IMO.
Very valid issue IMO and really not a "By Design", unless someone has reasons why it should be like it is now.
Comment #5
pfaocle+1 for Bèr's suggestions and for allowing submission immediately after correcting errors. Its extremely annoying. If previews are optional, then they should be optional regardless.
Comment #6
moshe weitzman CreditAttribution: moshe weitzman commentedi'll agree that this needs changing ... it is 'by *crappy* design
Comment #7
jhriggs CreditAttribution: jhriggs commentedAnother +1 on Bèr's suggestion.
Comment #8
TDobes CreditAttribution: TDobes commentedInterestingly enough, the behavior for comment.module is different and (IMO) correct. The patch that accomplished this explains the behavior quite clearly. Let's match node.module's behavior to that currently taken by comment.module. This would be good from a consistency standpoint and would also resolve this ever-annoying problem.
Comment #9
TDobes CreditAttribution: TDobes commentedHere's a patch.
It matches the behavior of the "submit" button on node.module to that of comment.module.
The submit now always appears if node preview is optional. Submit will disappear if node preview is required AND it is (a.) the first time the user has viewed the node form or (b.) there is an error on the form.
Note that people still cannot submit invalid data, as node.module will not allow the form to be submitted with invalid data.
I recommend that this be reviewed/applied before 4.6 is released, as it seems to annoy a lot of people (myself included) and would be an excellent usability improvement.
Comment #10
Steven CreditAttribution: Steven commentedApplied to HEAD.
Comment #11
(not verified) CreditAttribution: commented