diff --git a/modules/taxonomy.page_title.inc b/modules/taxonomy.page_title.inc index 63ce3dd..4e10879 100644 --- a/modules/taxonomy.page_title.inc +++ b/modules/taxonomy.page_title.inc @@ -16,12 +16,15 @@ function taxonomy_page_title_alter(&$title) { // as Views can interrupt the path ad moves the argument value from 0 to 2. // See issue: http://drupal.org/node/1203768 - // If we're looking at a taxonomy term page, get the term title - if ( !strncmp($menu_item['path'], 'taxonomy/term/%', 15) && - ($term = taxonomy_get_term($menu_item['map'][2])) && - variable_get('page_title_vocab_'. $term->vid .'_showfield', 0) && - ($term_title = page_title_load_title($term->tid, 'term')) ) { - $title = $term_title; + // If $menu_item['map'][2] is numeric then continue. + if (is_numeric($menu_item['map'][2])) { + // If we're looking at a taxonomy term page, get the term title + if ( !strncmp($menu_item['path'], 'taxonomy/term/%', 15) && + ($term = taxonomy_get_term($menu_item['map'][2])) && + variable_get('page_title_vocab_'. $term->vid .'_showfield', 0) && + ($term_title = page_title_load_title($term->tid, 'term')) ) { + $title = $term_title; + } } } @@ -36,11 +39,14 @@ function taxonomy_page_title_pattern_alter(&$pattern, &$types) { // as Views can interrupt the path ad moves the argument value from 0 to 2. // See issue: http://drupal.org/node/1203768 - // Taxonomy Term Page - if ( !strncmp($menu_item['path'], 'taxonomy/term/%', 15) && - ($term = taxonomy_get_term($menu_item['map'][2])) ) { - $types['taxonomy'] = $term; - $pattern = variable_get('page_title_vocab_'. $types['taxonomy']->vid, ''); + // If $menu_item['map'][2] is numeric then continue. + if (is_numeric($menu_item['map'][2])) { + // Taxonomy Term Page + if ( !strncmp($menu_item['path'], 'taxonomy/term/%', 15) && + ($term = taxonomy_get_term($menu_item['map'][2])) ) { + $types['taxonomy'] = $term; + $pattern = variable_get('page_title_vocab_'. $types['taxonomy']->vid, ''); + } } }