function path_admin_form_validate
path_admin_form_validate($form, &$form_state)
Form validation handler for path_admin_form().
See also
path_admin_form_delete_submit()
File
- modules/path/path.admin.inc, line 192
- Administrative page callbacks for the path module.
Code
function path_admin_form_validate($form, &$form_state) { $source = &$form_state['values']['source']; $source = drupal_get_normal_path($source); $alias = $form_state['values']['alias']; $pid = isset($form_state['values']['pid']) ? $form_state['values']['pid'] : 0; // Language is only set if locale module is enabled, otherwise save for all languages. $language = isset($form_state['values']['language']) ? $form_state['values']['language'] : LANGUAGE_NONE; $has_alias = db_query("SELECT COUNT(alias) FROM {url_alias} WHERE pid <> :pid AND alias = :alias AND language = :language", array( ':pid' => $pid, ':alias' => $alias, ':language' => $language, )) ->fetchField(); if ($has_alias) { form_set_error('alias', t('The alias %alias is already in use in this language.', array('%alias' => $alias))); } if (!drupal_valid_path($source)) { form_set_error('source', t("The path '@link_path' is either invalid or you do not have access to it.", array('@link_path' => $source))); } }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!path!path.admin.inc/function/path_admin_form_validate/7.x