Sbisson has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/238740

Change subject: Instantiate the Optin controller only when needed
......................................................................

Instantiate the Optin controller only when needed

Creating a new OptinController has side-effects in the container.
It replaces the 'permissions' object. It should only be created
when it is really needed.

Change-Id: I02b9aef1e3e1ad1b9f69f3c97f18e292bf029fb0
---
M Hooks.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow 
refs/changes/40/238740/1

diff --git a/Hooks.php b/Hooks.php
index be1b678..cb4c857 100644
--- a/Hooks.php
+++ b/Hooks.php
@@ -1694,11 +1694,11 @@
                $before = BetaFeatures::isFeatureEnabled( $userClone, 
BETA_FEATURE_FLOW_USER_TALK_PAGE );
                $after = $options[BETA_FEATURE_FLOW_USER_TALK_PAGE];
                $action = null;
-               $c = new Flow\Import\OptInController();
 
                if ( !$before && $after ) {
                        $action = OptInUpdate::$ENABLE;
                        // Check if the user had a flow board
+                       $c = new Flow\Import\OptInController();
                        if ( !$c->hasFlowBoardArchive() ) {
                                // Enable the guided tour by setting the cookie
                                
RequestContext::getMain()->getRequest()->response()->setcookie( 
'Flow_optIn_guidedTour', '1' );

-- 
To view, visit https://gerrit.wikimedia.org/r/238740
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I02b9aef1e3e1ad1b9f69f3c97f18e292bf029fb0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Sbisson <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to