From d6710e4122a0889d00c5e4d4ce376cc4268b1afc Mon Sep 17 00:00:00 2001 From: webchick Date: Tue, 14 Feb 2012 13:33:53 -0500 Subject: Issue #1393846 by tedbow, Albert Volkman: Fixed path_form_element_validate() executes unnecessary db_select() query when only space given for URL Alias. --- modules/path/path.module | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'modules/path') diff --git a/modules/path/path.module b/modules/path/path.module index 332287de2..e64b26836 100644 --- a/modules/path/path.module +++ b/modules/path/path.module @@ -147,9 +147,9 @@ function path_form_node_form_alter(&$form, $form_state) { * Form element validation handler for URL alias form element. */ function path_form_element_validate($element, &$form_state, $complete_form) { - if (!empty($form_state['values']['path']['alias'])) { - // Trim the submitted value. - $alias = trim($form_state['values']['path']['alias']); + // Trim the submitted value. + $alias = trim($form_state['values']['path']['alias']); + if (!empty($alias)) { form_set_value($element['alias'], $alias, $form_state); // Node language (Locale module) needs special care. Since the language of // the URL alias depends on the node language, and the node language can be -- cgit v1.2.3