Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The following error occurs because the value 0 is inputted for some reason as the argument.
Notice: Undefined index: 0 in taxonomy_term_load() (line 1215 of C:\Data\Website\drupal7\modules\taxonomy\taxonomy.module).
In views_handler_argument_taxonomy.inc, the function "title()" doesn't check to see if the taxonomy term ID exists, so when the number 0 is inputted, we get the above error.
I fixed this by adding an if-statement before the call to "taxonomy_term_load(...)" function. See below:
views_handler_argument_taxonomy.inc
function title() {
if($this->argument != 0) {
$term = taxonomy_term_load($this->argument);
if (!empty($term)) {
return check_plain($term->name);
}
}
// TODO review text
return t('No name');
}
Comments
Comment #1
dawehnerThanks this makes absolute sense. Commited a real patch to 7.x-3.x and 6.x-3.x