File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -53,14 +53,21 @@ public function create_config_instance($writer = false) {
5353 }
5454 }
5555
56+ $ config = null ;
57+
5658 if (!array_key_exists ($ class , $ this ->configs )) {
5759 // Create a new instance and call it to load it.
5860 // As part of generating store instance config we test the initialisation of stores.
5961 // Testing this may initialise DI, which will attempt to use cache for hookcallbacks.
6062 // Setting the state to initialising will make it use ad-hoc cache for that request.
6163 self ::set_state (self ::STATE_INITIALISING );
62- $ this ->configs [$ class ] = new $ class ;
63- $ this ->configs [$ class ]->load ();
64+ $ config = new $ class ;
65+ $ config ->load ();
66+
67+ // Re-register after load in case anything reset $this->configs.
68+ $ this ->configs [$ class ] = $ config ;
69+ } else {
70+ $ config = $ this ->configs [$ class ];
6471 }
6572
6673 // We need the siteid in order to use the caches, but the siteid
@@ -77,7 +84,7 @@ public function create_config_instance($writer = false) {
7784 }
7885
7986 // Return the instance.
80- return $ this -> configs [ $ class ] ;
87+ return $ config ;
8188 }
8289
8390 /**
You can’t perform that action at this time.
0 commit comments