Changeset 34262

Show
Ignore:
Timestamp:
11.07.2020 09:46:29 (4 weeks ago)
Author:
ak19
Message:

Bugfix to the problem of a file that's being moved into its own location being clobbered on remote. In client-GLI, things would look okay, but when you try doing something with the file or reopen the collection, you notice that the file went missing from the collection. Now the remote code simply doesn't try moving a file if it's going into the same location it already is in.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/common-src/cgi-bin/gliserver.pl

    r34160 r34262  
    10371037    } 
    10381038 
     1039    # don't bother moving the file into the same location 
     1040    # Plus attempting to do so ends up clobbering the file on the server side 
     1041    if(&util::get_parent_folder($source_file) eq $target_file) { 
     1042    $gsdl_cgi->generate_ok_message("Collection file $source_file is already inside $target_file. Not moving on itself."); 
     1043    return; 
     1044    } 
     1045     
    10391046    # Ensure the user is allowed to edit this collection 
    10401047    &authenticate_user($gsdl_cgi, $username, $collection, $site);