diff options
author | webchick <webchick@24967.no-reply.drupal.org> | 2012-02-14 13:33:53 -0500 |
---|---|---|
committer | webchick <webchick@24967.no-reply.drupal.org> | 2012-02-14 13:33:53 -0500 |
commit | d6710e4122a0889d00c5e4d4ce376cc4268b1afc (patch) | |
tree | 232e51560da2f7b20af0d4cf347d31eb892d8e1a /modules/path | |
parent | ceee7931e4652b802ef54602b7fecda28f3e65c3 (diff) | |
download | brdo-d6710e4122a0889d00c5e4d4ce376cc4268b1afc.tar.gz brdo-d6710e4122a0889d00c5e4d4ce376cc4268b1afc.tar.bz2 |
Issue #1393846 by tedbow, Albert Volkman: Fixed path_form_element_validate() executes unnecessary db_select() query when only space given for URL Alias.
Diffstat (limited to 'modules/path')
-rw-r--r-- | modules/path/path.module | 6 |
1 files changed, 3 insertions, 3 deletions
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 |