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

Change subject: Show the newarticle CX campaign to VE users only in the main 
namespace
......................................................................


Show the newarticle CX campaign to VE users only in the main namespace

Bug: T135685
Change-Id: If642960593c5abad7fd663db2dac2c49f0d32c04
---
M ContentTranslation.hooks.php
1 file changed, 5 insertions(+), 1 deletion(-)

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



diff --git a/ContentTranslation.hooks.php b/ContentTranslation.hooks.php
index 14beb58..0ad8b9f 100644
--- a/ContentTranslation.hooks.php
+++ b/ContentTranslation.hooks.php
@@ -47,12 +47,16 @@
                $title = $out->getTitle();
                $user = $out->getUser();
 
-               // Check if CX is available for current user.
+               // Load the new article campaign for VisualEditor if it's 
relevant.
+               // Done separately from loading the newarticle campaign for the
+               // wiki syntax editor because of the different actions with 
which
+               // the editing page is loaded.
                if ( !self::isEnabledForUser( $user ) ) {
                        if (
                                !$title->exists() &&
                                $wgContentTranslationCampaigns['newarticle'] &&
                                !$out->getRequest()->getCookie( 
'cx_campaign_newarticle_hide', '' ) &&
+                               $title->inNamespace( NS_MAIN ) &&
                                !$user->isAnon()
                        ) {
                                $out->addModules( 
'ext.cx.campaigns.newarticle.veloader' );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If642960593c5abad7fd663db2dac2c49f0d32c04
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Amire80 <amir.ahar...@mail.huji.ac.il>
Gerrit-Reviewer: Nikerabbit <niklas.laxst...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to