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

Change subject: Add setting to disable displaying parser function errors
......................................................................


Add setting to disable displaying parser function errors

this is done with css, so can be displayed for debugging,
or customized in other ways.  default is to show errors.

Change-Id: I3b4edd193e29a2db88185ef5cbf989dc575dbe49
---
M client/WikibaseClient.hooks.php
M client/config/WikibaseClient.default.php
M client/resources/Resources.php
A client/resources/wikibase.client.propertyparsererror.css
4 files changed, 16 insertions(+), 1 deletion(-)

Approvals:
  Tobias Gritschacher: Looks good to me, approved
  Aude: Checked; Looks good to me, approved
  jenkins-bot: Verified



diff --git a/client/WikibaseClient.hooks.php b/client/WikibaseClient.hooks.php
index 37152dd..d116b0e 100644
--- a/client/WikibaseClient.hooks.php
+++ b/client/WikibaseClient.hooks.php
@@ -517,11 +517,16 @@
                if ( !empty( $errors ) ) {
                        foreach ( $errors as $errorMessage ) {
                                $out->addWikiText(
-                                       '<p class="error wikibase-error">' . 
$errorMessage . '</p>'
+                                       '<p class="error 
wikibase-property-parser-error">' . $errorMessage . '</p>'
                                );
                        }
                }
 
+               // todo maybe allow this to vary based on anon / logged in users
+               if ( Settings::get( 'hideParserFunctionErrors' ) ) {
+                       $out->addModules( 'wikibase.client.propertyparsererror' 
);
+               }
+
                return true;
        }
 
diff --git a/client/config/WikibaseClient.default.php 
b/client/config/WikibaseClient.default.php
index 023b3c3..2c02ec4 100644
--- a/client/config/WikibaseClient.default.php
+++ b/client/config/WikibaseClient.default.php
@@ -39,6 +39,7 @@
                'allowDataTransclusion' => true,
                'enableSiteLinkWidget' => true,
                'propagateChangesToRepo' => true,
+               'hideParserFunctionErrors' => false, // allows hiding parser 
function errors with css
 
                /**
                 * @todo this is a bit wikimedia-specific and need to find a 
better place for this stuff,
diff --git a/client/resources/Resources.php b/client/resources/Resources.php
index d3d3e52..2eb09eb 100644
--- a/client/resources/Resources.php
+++ b/client/resources/Resources.php
@@ -25,6 +25,9 @@
                'wikibase.client.changeslist.css' => $moduleTemplate + array(
                        'styles' => 'wikibase.client.changeslist.css'
                ),
+               'wikibase.client.propertyparsererror' => $moduleTemplate + 
array(
+                       'styles' => 'wikibase.client.propertyparsererror.css'
+               ),
                'wikibase.client.linkitem.init' => $moduleTemplate + array(
                        'scripts' => array(
                                'wikibase.client.linkitem.init.js'
diff --git a/client/resources/wikibase.client.propertyparsererror.css 
b/client/resources/wikibase.client.propertyparsererror.css
new file mode 100644
index 0000000..59b2baf
--- /dev/null
+++ b/client/resources/wikibase.client.propertyparsererror.css
@@ -0,0 +1,6 @@
+/* CSS with the sole purpose to hide property parser
+   function errors, which can be controlled with
+   $wgWBClientSettings['hidePropertyParserError'] */
+.wikibase-property-parser-error {
+       display: none;
+}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3b4edd193e29a2db88185ef5cbf989dc575dbe49
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: mw1.23-wmf5
Gerrit-Owner: Aude <[email protected]>
Gerrit-Reviewer: Aude <[email protected]>
Gerrit-Reviewer: Henning Snater <[email protected]>
Gerrit-Reviewer: Tobias Gritschacher <[email protected]>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to