Changeset 34105 for main/trunk


Ignore:
Timestamp:
2020-04-24T00:38:28+12:00 (4 years ago)
Author:
ak19
Message:

A bugfix related to the commits 33737 and thereabouts which is the work I did to get encoded filenames in subdirs (or with & and + signs in the relative import path) to work with metadata assigned to such files through GLI. Metadata in doc.xml and metadata.xml should stick to such filenames, and which wasn't happening before that work. This latest bugfix would strike when the file_rename_method was base64 and there was no subdir, just import/file. The import folder itself is not supposed to get renamed with base64 or url encoding. The bug wasn't apparent during the earlier testing which focused on file_rename_method =url, as the import folder's name just resolves to being import if url encoded. However, it became noticeable now when debugging a warning message for Renate, when import got base64 encoded and GLI didn't know what was going on as import is not ever supposed to get encoded, only subdirs and files therein. The bug was an off by one error. Still need to create a ticket wherein I bring together all the related commits for the GLI with metadata work that this bugfix goes with.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/doc.pm

    r33757 r34105  
    301301   
    302302    # Don't encode the first folder ("import" or "tmp"): GLI's DocXMLFile.java looks for literal "import"
    303     # or "tmp" before it knows what the file rename method to be used decode the rest of gsdlsourcefilename is.
    304     if(scalar (@dirs) > 1) {
    305         $dirpath = shift(@dirs);
     303    # or "tmp" before it knows what the file rename method is that is to be used decode the rest of gsdlsourcefilename.
     304    if(scalar (@dirs) >= 1) {
     305        $dirpath = shift(@dirs);
    306306    }
    307307    foreach my $subdir (@dirs) {
    308     print STDERR "@@@@ Found subdir: $subdir\n";
     308    #print STDERR "@@@@ Found subdir: $subdir\n";
    309309   
    310310    $subdir = &util::rename_file($subdir, $rename_method);
Note: See TracChangeset for help on using the changeset viewer.