Changeset 33311 for main


Ignore:
Timestamp:
2019-07-08T17:24:19+12:00 (5 years ago)
Author:
ak19
Message:

Bugfix to metadataaction, which hadn't been calculating subsections correctly past 1.x. If any section has subsections, then the next section wasn't being incremented at the correct time with the increment lagging. For example, 3, 3.1, 3.2 ... 3.6, then 3 again instead of being immediately changed to 4 when necessary.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/cgiactions/metadataaction.pm

    r33183 r33311  
    10881088    my $old_depth  = $parser->{'parameters'}->{'curr_section_depth'};
    10891089    my $old_secnum = $parser->{'parameters'}->{'curr_section_num'};
    1090 
     1090   
    10911091    my $new_secnum;
    10921092
     
    10961096    }
    10971097    elsif ($new_depth == $old_depth) {
    1098     # sibling section => increase it's value by 1
     1098    # sibling section => increase its value by 1
    10991099    my ($tail_num) = ($old_secnum =~ m/\.(\d+)$/);
    11001100    $tail_num++;
     
    11061106    $new_secnum = $old_secnum;
    11071107    $new_secnum =~ s/\.\d+$//;
     1108    # remember to increment from parent section
     1109    my ($tail_num) = ($new_secnum =~ m/\.(\d+)$/);
     1110    $tail_num++;
     1111    $new_secnum =~ s/\.(\d+)$/\.$tail_num/;
    11081112    }
    11091113
    11101114    $parser->{'parameters'}->{'curr_section_depth'} = $new_depth;
    11111115    $parser->{'parameters'}->{'curr_section_num'}   = $new_secnum;
    1112    
     1116
     1117    #print STDERR "**** START SECTION - $new_secnum\n************************\n\n";
    11131118    1;
    11141119}
Note: See TracChangeset for help on using the changeset viewer.