Ignore:
Timestamp:
2015-04-02T13:22:05+13:00 (9 years ago)
Author:
kjdon
Message:

Detecting and handling the case where a 0 has been entered into hierarchy numbering in an hfile.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/classify/HFileHierarchy.pm

    r28564 r29821  
    216216    foreach my $OID (sort keys (%$list)) {
    217217    my $tempinfo = $self->get_OID_entry ($OID, $classifyinfo, "$classifier_num.$OID", $list->{$OID}->{'title'}, "VList");
    218    
     218    if (not defined ($tempinfo)) {
     219        print STDERR "Error occurred for node $OID. Not creating the classifier \n";
     220        return undef;
     221    }
    219222    if (defined $self->{'sort'}) {
    220223        if ($self->{'reverse_sort'}) {
     
    262265    return $classifyinfo;
    263266    }
    264 
     267    if ($headOID eq "0") {
     268    print STDERR "Error: Hierarchy numbering must not contain 0\n";
     269    return undef;
     270    }
    265271    $classifyinfo->{'contains'} = [] unless defined $classifyinfo->{'contains'};
    266272    if ($self->{'documents_last'}) {
Note: See TracChangeset for help on using the changeset viewer.