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

Change subject: Use ErrorPageError instead of rolling our own
......................................................................


Use ErrorPageError instead of rolling our own

And just use an internal wikilink to preferences instead of an external
link.

Change-Id: I5d22bc7b9c6d8c4931bcffcb27f1f0495b181c8d
---
M i18n/en.json
M i18n/qqq.json
M specials/SpecialWikiLabels.php
3 files changed, 7 insertions(+), 11 deletions(-)

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



diff --git a/i18n/en.json b/i18n/en.json
index 844cfae..0e8d9e5 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -7,5 +7,5 @@
        "wikilabels-beta-features-label": "Wiki labels",
        "wikilabels-beta-features-desc": "Allows to collaboratively label wiki 
artifacts quickly and easily.",
        "wikilabels-beta-features-not-enabled-title": "WikiLabels is not 
enabled.",
-       "wikilabels-beta-features-not-enabled-desc": "Please enable [$1 
WikiLabels beta feature] to view this page."
+       "wikilabels-beta-features-not-enabled-desc": "Please enable 
[[Special:Preferences#mw-prefsection-betafeatures|WikiLabels beta feature]] to 
view this page."
 }
diff --git a/i18n/qqq.json b/i18n/qqq.json
index a90cb1c..b599a6c 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -7,5 +7,5 @@
        "wikilabels-beta-features-label": "Label of the beta feature",
        "wikilabels-beta-features-desc": "Description of the beta feature",
        "wikilabels-beta-features-not-enabled-title": "Title of the page when 
WikiLabels beta feature is not enabled",
-       "wikilabels-beta-features-not-enabled-desc": "Description of the page 
when WikiLabels beta feature is not enabled. $1 is the link to the BetaFeatures 
page."
+       "wikilabels-beta-features-not-enabled-desc": "Description of the page 
when WikiLabels beta feature is not enabled."
 }
diff --git a/specials/SpecialWikiLabels.php b/specials/SpecialWikiLabels.php
index 659a953..0441b8a 100644
--- a/specials/SpecialWikiLabels.php
+++ b/specials/SpecialWikiLabels.php
@@ -3,6 +3,7 @@
 namespace WikiLabels;
 
 use BetaFeatures;
+use ErrorPageError;
 use SpecialPage;
 use TemplateParser;
 
@@ -25,15 +26,10 @@
                        BetaFeatures::isFeatureEnabled( $this->getUser(), 
'wiki-labels-enabled' ) ) {
                        $out->addModules( 'ext.wikiLabels' );
                } else {
-                       $templateData = array_merge( $templateData, [
-                               'error' => true,
-                               'errorTitle' => $this->msg( 
'wikilabels-beta-features-not-enabled-title' )->text(),
-                               'errorDesc' => $this->msg(
-                                       
'wikilabels-beta-features-not-enabled-desc',
-                                       SpecialPage::getTitleFor( 
'Preferences', false, 'mw-prefsection-betafeatures' )
-                                               ->getLocalURL()
-                               )->parse()
-                       ] );
+                       throw new ErrorPageError(
+                               'wikilabels-beta-features-not-enabled-title',
+                               'wikilabels-beta-features-not-enabled-desc'
+                       );
                }
 
                $templateParser = new TemplateParser( __DIR__ );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5d22bc7b9c6d8c4931bcffcb27f1f0495b181c8d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikiLabels
Gerrit-Branch: master
Gerrit-Owner: Legoktm <[email protected]>
Gerrit-Reviewer: Addshore <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to