[Rt-commit] rt branch, 4.2/insert-data-abs-path, created. rt-4.2.16-5-g3f4f89ee59

Steve Burr steve at bestpractical.com
Tue Nov 17 16:12:37 EST 2020


The branch, 4.2/insert-data-abs-path has been created
        at  3f4f89ee599134f6b062215fc97b0bc6473fabaf (commit)

- Log -----------------------------------------------------------------
commit 3f4f89ee599134f6b062215fc97b0bc6473fabaf
Author: Steven Burr <steve at bestpractical.com>
Date:   Tue Nov 17 16:06:00 2020 -0500

    Convert to abs path before executing initialdata files
    
    Passing certain relative paths to InsertData() would fail since it is
    using eval ( require $file ) directly. The file path is now converted
    to its absolute path before attempting to require it.

diff --git a/lib/RT/Handle.pm b/lib/RT/Handle.pm
index 379523a84a..c1c1f9fe3b 100644
--- a/lib/RT/Handle.pm
+++ b/lib/RT/Handle.pm
@@ -834,6 +834,8 @@ sub InsertData {
            @Templates, @CustomFields, @Scrips, @Attributes, @Initial, @Final);
 
     local $@;
+    # Get the full path since . is no longer in @INC after perl 5.24
+    $datafile = Cwd::abs_path($datafile);
     $RT::Logger->debug("Going to load '$datafile' data file");
     eval { require $datafile }
       or return (0, "Couldn't load data from '$datafile' for import:\n\nERROR:". $@);

-----------------------------------------------------------------------


More information about the rt-commit mailing list