[Rt-commit] rt branch, 4.2/webhomepath-with-webpath, created. rt-4.1.6-312-gecda5d6

Alex Vandiver alexmv at bestpractical.com
Wed Mar 6 20:58:20 EST 2013


The branch, 4.2/webhomepath-with-webpath has been created
        at  ecda5d6ed245f29e19077d0bdfc59bcfb5153c74 (commit)

- Log -----------------------------------------------------------------
commit ecda5d6ed245f29e19077d0bdfc59bcfb5153c74
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Wed Mar 6 20:56:05 2013 -0500

    WebHomePath was always "/SelfService" when WebPath was defined
    
    Concatenation is higher precedence than the ternary oprtator, leading
    the WebHomePath to effectively be:
    
        (WebPath . !Privileged) ? "/SelfService" : ""
    
    ...which was a correct formulation as long as WebPath was empty, but
    which forced WebHomePath to "/SelfService" whenever WebPath was set,
    breaking autocompletion.
    
    Add parentheses to fix the precedence.

diff --git a/share/html/Elements/JavascriptConfig b/share/html/Elements/JavascriptConfig
index b428478..e7bbcde 100644
--- a/share/html/Elements/JavascriptConfig
+++ b/share/html/Elements/JavascriptConfig
@@ -59,7 +59,7 @@ if ($session{CurrentUser} and $session{CurrentUser}->id) {
         ? JSON::true : JSON::false;
 
     $Config->{WebHomePath} = RT->Config->Get("WebPath")
-        . !$session{CurrentUser}->Privileged ? "/SelfService" : "";
+        . (!$session{CurrentUser}->Privileged ? "/SelfService" : "");
 }
 
 $m->callback(

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


More information about the Rt-commit mailing list