function rules_action_taxonomy_term_path_alias

Action Implementation: Set the URL alias for a node.

Related topics

File

modules/path.eval.inc, line 54

Code

function rules_action_taxonomy_term_path_alias($term, $alias) {
    // Only set the alias if the alias is not taken yet.
    if (($path = path_load(array(
        'alias' => $alias,
        'language' => LANGUAGE_NONE,
    ))) && (empty($term->path['pid']) || $term->path['pid'] != $path['pid'])) {
        rules_log('The configured alias %alias already exists. Aborting.', array(
            '%alias' => $alias,
        ));
        return FALSE;
    }
    $term->path['alias'] = $alias;
}