Changeset 32782

Show
Ignore:
Timestamp:
18.02.2019 20:27:42 (8 months ago)
Author:
ak19
Message:

Fix for Zeddy: empty lines and annoying spaces are now removed when metadata gets removed from doc xml files. Haven't tested the metadata xml variants, but changed them in symmetry.

Files:
1 modified

Legend:

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

    r32079 r32782  
    330330} 
    331331 
    332 # the version of set_index_meta that doesn't do authentication 
     332# the version of set_archives_meta that doesn't do authentication 
    333333sub _set_archives_metadata 
    334334{ 
     
    970970         
    971971        if (ref($description_content)) { 
    972         # got some existing interesting nested content 
    973         push(@$description_content, "    ", $append_metadata ,"\n        "); 
     972        # got some existing interesting nested content       
     973        push(@$description_content, "  ", $append_metadata, "\n  "); 
    974974        } 
    975975        else { 
    976976        #description_content is most likely a string such as "\n" 
    977         $attrHash->{'_content'} = [$description_content, "    ", $append_metadata ,"\n" ]; 
     977        $attrHash->{'_content'} = [$description_content, "  ", $append_metadata ,"\n" ]; 
    978978        } 
    979979         
     
    10071007    my $line; 
    10081008    while (defined ($line=<MIN>)) { 
    1009         $xml_in .= $line; 
     1009        $xml_in .= $line if($line !~ m/^\s*$/); # preserve all but empty lines 
    10101010    } 
    10111011    close(MIN); 
     
    14131413        my $line; 
    14141414        while (defined ($line=<MIN>)) { 
    1415             $xml_in .= $line; 
     1415            $xml_in .= $line if($line !~ m/^\s*$/); # preserve all but empty lines 
    14161416        } 
    14171417        close(MIN);  
     
    16031603    } 
    16041604 
    1605     push(@$description_content,"    ", $append_metadata ,"\n        "); 
     1605    push(@$description_content, "  ", $append_metadata, "\n  "); 
    16061606    $parser->{'parameters'}->{'metamode'} = "done"; 
    16071607    } 
     
    17451745        my $line; 
    17461746        while (defined ($line=<MIN>)) { 
    1747             $xml_in .= $line; 
     1747            $xml_in .= $line if($line !~ m/^\s*$/); # preserve all but empty lines 
    17481748        } 
    17491749        close(MIN);  
     
    21542154        my $line; 
    21552155        while (defined ($line=<MIN>)) { 
    2156             $xml_in .= $line; 
     2156            $xml_in .= $line if($line !~ m/^\s*$/); # preserve all but empty lines 
    21572157        } 
    21582158        close(MIN);