When depth of the term decreases more than one level (for example 3->1) the level of the list items is not decreased according to that.

I applied the following patch to fix this issue:

Line 150 ff

Original code:

        elseif ($term->depth < $old_depth) {
          $output .= '</ul>';
        }

Patched Code:

        elseif ($term->depth < $old_depth) {
          $output .= '</ul>';
          $depthval=$term->depth +1;
          //if new depth is more than one less than last  </ul> are added until target level reached
          while ($depthval<$old_depth) 
          {
            $output .= '</ul>';
            $depthval=$depthval+1;
          }

Perhaps it is not necessary to use additional variable $depthval and instead decrease $old_depth, but I didn't check the whole code and didn't want to mess things up...

Comments

owahab’s picture

Status: Patch (to be ported) » Needs review
NaX’s picture

Thanks det21.
I took it a step further and closed the list items as well </li>

  elseif ($term->depth < $old_depth) {  
    $output .= '</li></ul>';
    $depthval=$term->depth +1;
    //if new depth is more than one less than last  </ul> are added until target level reached
    while ($depthval<$old_depth) {
      $output .= '</li></ul>';
      $depthval=$depthval+1;
    }
    $output .= '</li>';
  }
doublejosh’s picture

Version: 6.x-1.0-beta1 » 6.x-1.0-beta2

Same issue still present in the newest release.