[Bps-public-commit] rt-extension-dynamicwebpath branch master updated. 0.02-1-gcac757e

BPS Git Server git at git.bestpractical.com
Tue Oct 3 21:28:12 UTC 2023


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt-extension-dynamicwebpath".

The branch, master has been updated
       via  cac757ec53e19a321e23ac0d806f1980ad350ad9 (commit)
      from  789992ee6f845ad2651356c3fcf454ff84fe99c8 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit cac757ec53e19a321e23ac0d806f1980ad350ad9
Author: Brad Embree <brad at bestpractical.com>
Date:   Tue Oct 3 14:23:54 2023 -0700

    Run PostLoadCheck of DynamicWebPath only once
    
    Editing Lifecycles using a non default dynamic web path would result in
    Unauthorized Access errors. This was due to the config being reloaded
    when a Lifecycle changes which ran the PostLoadCheck again and resulted
    in the WebRemoteUserAuth and WebFallbackToRTLogin config values being
    set to values for the default dynamic web path which were incorrect.
    
    By ensuring the PostLoadCheck is only run once we eliminate the errors.

diff --git a/lib/RT/Extension/DynamicWebPath.pm b/lib/RT/Extension/DynamicWebPath.pm
index fa5b139..e21aa27 100644
--- a/lib/RT/Extension/DynamicWebPath.pm
+++ b/lib/RT/Extension/DynamicWebPath.pm
@@ -4,11 +4,17 @@ package RT::Extension::DynamicWebPath;
 
 our $VERSION = '0.02';
 
+my $post_load_check_ran;
+
 use RT::Config;
 $RT::Config::META{DynamicWebPath} = {
     Immutable     => 1,
     Type          => 'HASH',
     PostLoadCheck => sub {
+        return if $post_load_check_ran;
+
+        $post_load_check_ran = 1;
+
         my $config = shift;
         my $paths  = $config->Get('DynamicWebPath') || {};
 
-----------------------------------------------------------------------

Summary of changes:
 lib/RT/Extension/DynamicWebPath.pm | 6 ++++++
 1 file changed, 6 insertions(+)


hooks/post-receive
-- 
rt-extension-dynamicwebpath


More information about the Bps-public-commit mailing list