diff --git a/CHANGELOG.txt b/CHANGELOG.txt index e66d7b4..c610758 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,5 +1,7 @@ Nodewords 6.x-1-dev, xxxx-xx-xx ------------------------------- +Issue #672096 by kiamlaluno, jenlampton: Metatags for taxonomy terms or + vocabularies are not being saved. By DamienMcKenna: Cleaned up the CHANGELOG.txt file. #672262 by kiamlaluno: Meta tags for "other pages" are not used. #672072 by kiamlaluno: Meta tag content generation always use the node body diff --git a/nodewords.module b/nodewords.module index 659c2b5..9ec9d8c 100644 --- a/nodewords.module +++ b/nodewords.module @@ -548,27 +548,34 @@ function nodewords_preprocess_page(&$variables) { * Implements hook_taxonomy(). */ function nodewords_taxonomy($op, $type, $object = NULL) { - if ($type == NODEWORDS_TYPE_TERM) { - $id = $object['tid']; - } - elseif ($type == NODEWORDS_TYPE_VOCABULARY) { - $id = $object['vid']; - } - else { - return; - } - - switch ($op) { - case 'delete': - nodewords_delete_tags($type, $id); - break; - - case 'insert': - case 'update': - if (isset($object['nodewords'])) { - nodewords_save_tags($type, $id, $object['nodewords'], TRUE); - } - break; + if (isset($object)) { + switch ($type) { + case 'term': + $type = NODEWORDS_TYPE_TERM; + $id = $object['tid']; + break; + + case 'vocabulary': + $type = NODEWORDS_TYPE_VOCABULARY; + $id = $object['vid']; + break; + + default: + return; + } + + switch ($op) { + case 'delete': + nodewords_delete_tags($type, $id); + break; + + case 'insert': + case 'update': + if (isset($object['nodewords'])) { + nodewords_save_tags($type, $id, $object['nodewords'], TRUE); + } + break; + } } }