taxonomy_node_validate

  1. drupal
    1. 4.7
    2. 5 taxonomy.module
    3. 6 taxonomy.module
Versions
4.7 – 6 taxonomy_node_validate(&$node)

Make sure incoming vids are free tagging enabled.

Code

modules/taxonomy.module, line 700

<?php
function taxonomy_node_validate(&$node) {
  if ($node->taxonomy) {
    $terms = $node->taxonomy;
    if ($terms['tags']) {
      foreach ($terms['tags'] as $vid => $vid_value) {
        $vocabulary = taxonomy_get_vocabulary($vid);
        if (!$vocabulary->tags) {
          // see form_get_error $key = implode('][', $element['#parents']);
          // on why this is the key
          form_set_error("taxonomy][tags][$vid", t('The %name vocabulary can not be modified in this way.', array('%name' => theme('placeholder', $vocabulary->name))));
        }
      }
    }
  }
}
?>