There seems to be no way to validate the title of a node, is this a planned feature? If not, something to add to the roadmap...

Comments

g089h515r806’s picture

Node tile will become a field in Drupal8.
There is a title field module in Drupal 7.
Node title do not have a seperate config page in Drupal 7. I need write a seperate module for it in Drupal 7.

sammyd56’s picture

Status: Active » Closed (won't fix)

Ah, thanks for the reply, it hadn't occurred to me before that node title was not a field.

In that case, I will try out the Title module in conjunction with this one.

Many thanks.

g089h515r806’s picture

Version: 7.x-1.x-dev » 7.x-2.1
Status: Closed (won't fix) » Fixed

Support property validation since 7.x-2.1, which could solve such issue very well.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

carajito’s picture

StatusFileSize
new22.1 KB

I can't see the title field of the node to make the rules

field

haydeniv’s picture

Status: Closed (fixed) » Active

I don't see a way to select the property either.

g089h515r806’s picture

You need enable property validation module, it is a seperate module .

haydeniv’s picture

Status: Active » Closed (fixed)

Ah I did not see that it needed an extra module enabled because I did not realize it was part of the same set of modules. I would suggest renaming the module to "Field Validation Property Validation" so that it shows up with the other Field Validation module suite. I opened a separate issue for that though. #1971346: Rename Property Validation module to Field Validation Property Validation

Also for anyone else that comes across this issue to set a property validater you need to go to http://example.com/admin/structure/property_validation after enabling the property validation module.

vali hutchison’s picture

Or you can do it programatically by creating a simple custom module and adding this:


/**
 * Implements hook_node_validate().
 */
function MYMODULE_node_validate($node, $form, &$form_state) {
  // trim leading spaces from title field
  if (isset($form_state['values']['title'])) {
    $form_state['values']['title'] = trim($form_state['values']['title']);
  }
}

This will work for all content types used on your site and doesn't require the validation modules (unless using for other purposes).

krknth’s picture

Issue summary: View changes

This module might useful - Node title validation

jay.lee.bio’s picture

Version: 7.x-2.1 » 8.x-1.x-dev

Per #1, I understand that node titles are fields in Drupal 8. So how do I use this module for node title validation in D8? Per #10, Node Title Validation does something similar for D8 and thus can be used as reference for development if needed.