[Bps-public-commit] rt-extension-assetsql branch, master, updated. 0.04-1-g15d4f71

? sunnavy sunnavy at bestpractical.com
Fri Jan 3 14:07:38 EST 2020


The branch, master has been updated
       via  15d4f71038aa9df7c23e2ba4f82e82cbdb6875d2 (commit)
      from  08e74328e0bdf968d271974ef7c535bd3b96d735 (commit)

Summary of changes:
 lib/RT/Extension/AssetSQL/Assets.pm | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

- Log -----------------------------------------------------------------
commit 15d4f71038aa9df7c23e2ba4f82e82cbdb6875d2
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Sat Jan 4 03:05:19 2020 +0800

    Fix link limit as LocalURIPrefix doesn't contain trailing "/" since RT 4.4.3
    
    See also b6ed832659 in RT.

diff --git a/lib/RT/Extension/AssetSQL/Assets.pm b/lib/RT/Extension/AssetSQL/Assets.pm
index bf20558..b2f1748 100644
--- a/lib/RT/Extension/AssetSQL/Assets.pm
+++ b/lib/RT/Extension/AssetSQL/Assets.pm
@@ -717,11 +717,14 @@ sub _LinkLimit {
 #        WHERE Links_1.LocalBase IS NULL;
 
     my $join_expression;
+    my $local_prefix = RT::URI::asset->new( RT->SystemUser )->LocalURIPrefix;
+    $local_prefix .= '/' unless $local_prefix =~ m{/$};
+
     if ( RT->Config->Get('DatabaseType') eq 'SQLite' ) {
-        $join_expression = q{'} . RT::URI::asset->new( RT->SystemUser )->LocalURIPrefix . q{' ||  main.id};
+        $join_expression = qq{'$local_prefix' || main.id};
     }
     else {
-        $join_expression = q{CONCAT( '} . RT::URI::asset->new( RT->SystemUser )->LocalURIPrefix . q{',  main.id )};
+        $join_expression = qq{CONCAT( '$local_prefix',  main.id )};
     }
     if ( $is_null ) {
         my $linkalias = $sb->Join(

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


More information about the Bps-public-commit mailing list