Changeset 8445


Ignore:
Timestamp:
2004-11-03T17:02:08+13:00 (19 years ago)
Author:
kjdon
Message:

fixed a bug I introduced with the remove_empty_classifications thing - it was not calling check_contents but thats needed to set numleafdocs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/classify.pm

    r8361 r8445  
    184184 
    185185    # don't want empty classifications
    186     return if ($remove_empty_classifications && &check_contents ($classifyinfo) == 0);
     186    return if (&check_contents ($classifyinfo, $remove_empty_classifications) == 0 && $remove_empty_classifications);
    187187   
    188188    $OID = $classifyinfo->{'classifyOID'} if defined ($classifyinfo->{'classifyOID'});
     
    260260
    261261sub check_contents {
    262     my ($classifyinfo) = @_;
     262    my ($classifyinfo,$remove_empty_classifications) = @_;
     263    $remove_empty_classifications = 0 unless ($remove_empty_classifications);
    263264    my $num_leaf_docs = 0;
    264265    my $sub_num_leaf_docs = 0;
     
    274275        $num_leaf_docs += $sub_num_leaf_docs;
    275276    } else {
    276         # section contains no books so we want to remove
    277         # it from its parents contents
    278         $content = undef;
     277        if ($remove_empty_classifications){
     278        # section contains no books so we want to remove
     279        # it from its parents contents
     280        $content = undef;
     281        }
    279282    }
    280283    }
Note: See TracChangeset for help on using the changeset viewer.