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.

CommentFileSizeAuthor
#2 node-title-validation.patch732 bytesnedjo
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

chx’s picture

Best would be to separate validation to 'prepare' and 'validate'. Obviously, on 'prepare' we do not need to do validation.

nedjo’s picture

Component: page.module » node.module
Status: Active » Reviewed & tested by the community
FileSize
732 bytes

Since node_form() validates with every call, we tend to enclose field validation in a if (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.)

Dries’s picture

Why do we attempt to validate a node before there has been a POST-operation?

chx’s picture

Because we do not have a prepare nodeapi op and some fields are presented dfferently for editing than they are stored / viewed.

m3avrck’s picture

This 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.

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to HEAD. Thanks.

Anonymous’s picture

Status: Fixed » Closed (fixed)