Changeset 5966 for extensions/pLoader


Ignore:
Timestamp:
Apr 26, 2010, 2:29:29 AM (14 years ago)
Author:
ronosman
Message:

Bug 1623 fixed : sub categories with id lower than parent id are not displayed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/pLoader/trunk/src/Uploader/PWG/Categories.pm

    r4779 r5966  
    4242
    4343    # find the parent
     44    # sort by global rank, descending
     45    # to make sure children come before their parents
    4446    map {
    45         my $child = $records->{$_};
    46         my $parentid = _parentid($child);
     47        my $child = $records->{$_};
     48        my $parentid = _parentid($child);
    4749        if(defined $parentid){
    4850            _addchild(
     
    5355        }
    5456    }
    55     sort { $b <=> $a }
     57    sort { $records->{$b}->[7] cmp $records->{$a}->[7] }
    5658    keys %$records;
    5759
     
    9799   my $parent;
    98100   if( 1 < scalar @ucats ){
    99         $parent = $ucats[scalar @rank - 2 ];
     101       $parent = $ucats[scalar @rank - 2 ];
    100102   }
    101103   my $rank = $rank[scalar @rank - 1 ];
     
    118120        $parent,
    119121        $rank,
     122        $category->{global_rank},
    120123    ];   
    121124}
Note: See TracChangeset for help on using the changeset viewer.