Changeset 29086

Show
Ignore:
Timestamp:
29.05.2014 14:31:45 (6 years ago)
Author:
kjdon
Message:

need to decode prevmetavalue in same way as metavalue. clear all metadata only if metapos AND metavalue are empty

Files:
1 modified

Legend:

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

    r29084 r29086  
    168168    $url_decoded_metavalue = join("",map(chr($_),@$unicode_array)); 
    169169    $gsdl_cgi->param("metavalue",$url_decoded_metavalue); 
     170 
     171    # need to do the same with prevmetavalue 
     172    my $url_encoded_prevmetavalue = $gsdl_cgi->param("prevmetavalue"); 
     173    my $url_decoded_prevmetavalue = &unicode::url_decode($url_encoded_prevmetavalue,1); 
     174    my $prevunicode_array = &unicode::utf82unicode($url_decoded_prevmetavalue); 
     175 
     176    $url_decoded_prevmetavalue = join("",map(chr($_),@$prevunicode_array)); 
     177    $gsdl_cgi->param("prevmetavalue",$url_decoded_prevmetavalue); 
    170178 
    171179    my $self = new baseaction($action_table,$gsdl_cgi,$iis6_mode); 
     
    22212229    if ($status == 0)  
    22222230    { 
    2223         my $mess = "remove-archives-metadata successful: Key[$docid]\n"; 
     2231        my $mess = "\nremove-archives-metadata successful: \nKey[$docid]\n"; 
    22242232        $mess .= "  $metaname"; 
    22252233        $mess .= "->[$metapos]" if (defined $metapos); 
    2226  
     2234        $mess .= " ($metavalue)" if (defined $metavalue); 
    22272235        $gsdl_cgi->generate_ok_message($mess);   
    22282236    } 
     
    23462354         
    23472355        # if overriding (for set-meta) but no metapos, then clear all the meta for this metaname 
    2348         if ((defined $parser->{'parameters'}->{'metamode'}) && ($parser->{'parameters'}->{'metamode'} eq "override") && (!defined $parser->{'parameters'}->{'metapos'})) {           
     2356        if ((defined $parser->{'parameters'}->{'metamode'}) && ($parser->{'parameters'}->{'metamode'} eq "override") && (!defined $parser->{'parameters'}->{'metapos'}) &&(!defined $parser->{'parameters'}->{'metavalue'})) {           
    23492357            return []; 
    23502358        }