Skip to content
Snippets Groups Projects
Commit 3e9be681 authored by catch's avatar catch
Browse files

Issue #1876546 by plopesc: node_type_form_validate() and...

Issue #1876546 by plopesc: node_type_form_validate() and node_type_form_submit() pointlessly trim machine name value.
parent 4f6facbd
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -304,11 +304,11 @@ function _node_characters($length) { ...@@ -304,11 +304,11 @@ function _node_characters($length) {
*/ */
function node_type_form_validate($form, &$form_state) { function node_type_form_validate($form, &$form_state) {
$type = new stdClass(); $type = new stdClass();
$type->type = trim($form_state['values']['type']); $type->type = $form_state['values']['type'];
$type->name = trim($form_state['values']['name']); $type->name = trim($form_state['values']['name']);
// Work out what the type was before the user submitted this form // Work out what the type was before the user submitted this form
$old_type = trim($form_state['values']['old_type']); $old_type = $form_state['values']['old_type'];
$types = node_type_get_names(); $types = node_type_get_names();
...@@ -337,7 +337,7 @@ function node_type_form_submit($form, &$form_state) { ...@@ -337,7 +337,7 @@ function node_type_form_submit($form, &$form_state) {
$type = node_type_set_defaults(); $type = node_type_set_defaults();
$type->type = trim($form_state['values']['type']); $type->type = $form_state['values']['type'];
$type->name = trim($form_state['values']['name']); $type->name = trim($form_state['values']['name']);
$type->orig_type = trim($form_state['values']['orig_type']); $type->orig_type = trim($form_state['values']['orig_type']);
$type->old_type = isset($form_state['values']['old_type']) ? $form_state['values']['old_type'] : $type->type; $type->old_type = isset($form_state['values']['old_type']) ? $form_state['values']['old_type'] : $type->type;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment