taxonomy_form_vocabulary_validate
function taxonomy_form_vocabulary_validate
taxonomy_form_vocabulary_validate($form, &$form_state)
Form validation handler for taxonomy_form_vocabulary().
Makes sure that the machine name of the vocabulary is not in the disallowed list (names that conflict with menu items, such as 'list' and 'add').
See also
taxonomy_form_vocabulary_submit()
File
- modules/taxonomy/taxonomy.admin.inc, line 193
- Administrative page callbacks for the taxonomy module.
Code
function taxonomy_form_vocabulary_validate($form, &$form_state) { // During the deletion there is no 'machine_name' key if (isset($form_state['values']['machine_name'])) { // Do not allow machine names to conflict with taxonomy path arguments. $machine_name = $form_state['values']['machine_name']; $disallowed = array('add', 'list'); if (in_array($machine_name, $disallowed)) { form_set_error('machine_name', t('The machine-readable name cannot be "add" or "list".')); } } }
© 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!taxonomy!taxonomy.admin.inc/function/taxonomy_form_vocabulary_validate/7.x