[Rt-commit] rt branch, 5.0-trunk, updated. rt-5.0.0-118-g7d217721d3

? sunnavy sunnavy at bestpractical.com
Wed Nov 18 15:04:04 EST 2020


The branch, 5.0-trunk has been updated
       via  7d217721d324b4d12754e13a7e13644c20d2863e (commit)
      from  8e3517963f58cde2c7fd7814e5fe4e8d260f7b9a (commit)

Summary of changes:
 lib/RT/Handle.pm | 3 +++
 1 file changed, 3 insertions(+)

- Log -----------------------------------------------------------------
commit 7d217721d324b4d12754e13a7e13644c20d2863e
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 fc003ca594..6420f20dd3 100644
--- a/lib/RT/Handle.pm
+++ b/lib/RT/Handle.pm
@@ -918,6 +918,9 @@ sub InsertData {
     if ( !$format_handler and grep(/^perl$/, @$handlers) ) {
         # Use perl-style initialdata
         # Note: eval of perl initialdata should only be done once
+
+        # Get the full path since . is no longer in @INC after perl 5.24
+        $datafile = Cwd::abs_path($datafile);
         eval { require $datafile }
           or return (0, "Couldn't load data from '$datafile':\nERROR:" . $@ . "\n\nDo you have the correct initialdata handler in RT_Config for this type of file?");
     }

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


More information about the rt-commit mailing list