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.
Refer from https://www.drupal.org/node/2591327#comment-10608502
Fix @klausi manual review.
- node_title_validation_node_validate(): $node_title_validation_config['exclude-' . $node->type]: this will throw PHP warnings if that array key is not set. You should add a check that it is actually set. Same for the other array keys that you are accessing here. Example: if a new node type is added then the array is out of sync.
- node_title_validation_admin_form_validate(): doc block is wrong, this is not a hook. See https://www.drupal.org/coding-standards/docs#forms . Same for node_title_validation_admin_form_submit().
-
node_title_validation_admin_form_validate(): instead of doing the numeric validation yourself, you can use element_validate_integer_positive as a #element_validate callback, see
https://api.drupal.org/api/drupal/developer!topics!forms_api_reference.h...
Comment | File | Size | Author |
---|---|---|---|
#2 | 2623622-2.patch | 2.62 KB | neerajskydiver |
Comments
Comment #2
neerajskydiver CreditAttribution: neerajskydiver as a volunteer and at Valuebound commentedPatch attached
Comment #3
krknth CreditAttribution: krknth as a volunteer and at Valuebound commentedLooks good to me.
Comment #5
krknth CreditAttribution: krknth as a volunteer and at Valuebound commented