jenkins-bot has submitted this change and it was merged.

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(-)

Approvals:
  Mattflaschen: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/Hooks.php b/Hooks.php
index 12a535f..a748fd3 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( $user ) ) {
                                // 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: merged
Gerrit-Change-Id: I02b9aef1e3e1ad1b9f69f3c97f18e292bf029fb0
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Sbisson <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: Mattflaschen <[email protected]>
Gerrit-Reviewer: Matthias Mullie <[email protected]>
Gerrit-Reviewer: Mooeypoo <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to