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.
affects bog, book, forum, page, story modules.
The title is being validated before there's any data to validate resulting in a You have to specify a title. error being displayed before you've had a chance to enter a title.
Comment | File | Size | Author |
---|---|---|---|
#2 | node-title-validation.patch | 732 bytes | nedjo |
Comments
Comment #1
chx CreditAttribution: chx commentedBest would be to separate validation to 'prepare' and 'validate'. Obviously, on 'prepare' we do not need to do validation.
Comment #2
nedjoSince
node_form()
validates with every call, we tend to enclose field validation in aif (isset($node->fieldname))
test, so that it only validates if the node form has been previously submitted.In the recently applied node title patch, this test was omitted from validation of the title field in
node_validate_title()
. The simple fix, attached, is to reinstate the test.(I agree, though, that in the longer term, the suggested 'prepare' and 'validate' distinction is a good idea. For the most part, there's nothing to validate before we have user input.)
Comment #3
Dries CreditAttribution: Dries commentedWhy do we attempt to validate a node before there has been a POST-operation?
Comment #4
chx CreditAttribution: chx commentedBecause we do not have a prepare nodeapi op and some fields are presented dfferently for editing than they are stored / viewed.
Comment #5
m3avrck CreditAttribution: m3avrck commentedThis has to be the most annoying bug I encounter on a daily basis, +1 to getting this fixed. Not sure if this is the best route (not super up-to-speed with the inner workings of Drupal in this manner) but checking to see if isset() sounds like a good place to start.
Comment #6
Dries CreditAttribution: Dries commentedCommitted to HEAD. Thanks.
Comment #7
(not verified) CreditAttribution: commented