When I delete a term from a taxonomy that is attached to a taxonomy menu I get 2 different notices:

Notice: Undefined offset: -1 in _taxonomy_menu_create_item() (line 850 of .../taxonomy_menu/taxonomy_menu.module).

Notice: Trying to get property of non-object in _taxonomy_menu_create_item() (line 850 of .../taxonomy_menu/taxonomy_menu.module).

// Find the weight of the root taxonomy term; we'll need it in case we want
    // a flat taxonomy menu.
    if (is_object($term)) {
      $term_parents = taxonomy_get_parents_all($term->tid);
      $root_term_weight = $term_parents[count($term_parents) - 1]->weight;
    }
    else {
      $root_term_weight = 0;
    }

This is all because $term_parents inside the if is an empty array (because it was deleted?).

CommentFileSizeAuthor
#2 notices_deleting_term-2553913-1.patch566 bytesSandraVdv

Comments

SandraVdv created an issue. See original summary.

SandraVdv’s picture

StatusFileSize
new566 bytes

Attached you can find a patch to solve this issue.

bhavikshah9’s picture

Status: Active » Needs review
bhavikshah9’s picture

Can someone RTBC this please?

  • dstol committed beacfd5 on 7.x-1.x authored by SandraVdv
    Issue #2553913 by SandraVdv: Notices after deleting term
    
dstol’s picture

Status: Needs review » Fixed

Thanks

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.