Incorrect structure in displayed term list when depth decreases more than one level

det21 - October 3, 2009 - 01:22
Project:Taxonomy Blocks
Version:6.x-1.0-beta1
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:patch (to be ported)
Description

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:

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

Patched Code:
<?php
       
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...

 
 

Drupal is a registered trademark of Dries Buytaert.