jenkins-bot has submitted this change and it was merged.
Change subject: Provide alternative access to citoid-template-type-map.json
......................................................................
Provide alternative access to citoid-template-type-map.json
This is a temporary workaround while we investigate the cause
of this bug.
Bug: T93800
Change-Id: Iccc4df3cc5c7e59010cf91b5a12343088f44b7ce
(cherry picked from commit b81ee385f9008dcb3408c89c8422b19f2741d247)
---
A CitoidDataModule.php
M extension.json
M modules/ve.ui.CiteFromIdInspectorTool.js
3 files changed, 59 insertions(+), 3 deletions(-)
Approvals:
Alex Monk: Looks good to me, approved
jenkins-bot: Verified
diff --git a/CitoidDataModule.php b/CitoidDataModule.php
new file mode 100644
index 0000000..7fefd86
--- /dev/null
+++ b/CitoidDataModule.php
@@ -0,0 +1,46 @@
+<?php
+/**
+ * Resource loader module providing extra data from the server to Citoid.
+ *
+ * Temporary hack for T93800
+ *
+ * @file
+ * @ingroup Extensions
+ * @copyright 2011-2015 Citoid Team and others; see AUTHORS.txt
+ * @license The MIT License (MIT); see LICENSE.txt
+ */
+
+class CitoidDataModule extends ResourceLoaderModule {
+
+ /* Protected Members */
+
+ protected $origin = self::ORIGIN_USER_SITEWIDE;
+ protected $targets = array( 'desktop', 'mobile' );
+
+ /* Methods */
+
+ public function getScript( ResourceLoaderContext $context ) {
+ return
+ 've.init.platform.addMessages(' . FormatJson::encode(
+ array(
+ 'citoid-template-type-map-backup.json'
=> wfMessage( 'citoid-template-type-map.json' )->plain()
+ ),
+ ResourceLoader::inDebugMode()
+ ) . ');';
+ }
+
+ public function getDependencies( ResourceLoaderContext $context = null
) {
+ return array(
+ 'ext.visualEditor.base',
+ 'ext.visualEditor.mediawiki',
+ );
+ }
+
+ public function getDefinitionSummary( ResourceLoaderContext $context ) {
+ $summary = parent::getDefinitionSummary( $context );
+ $summary[] = array(
+ 'script' => $this->getScript( $context ),
+ );
+ return $summary;
+ }
+}
diff --git a/extension.json b/extension.json
index 11a502f..86c6de7 100644
--- a/extension.json
+++ b/extension.json
@@ -16,7 +16,8 @@
]
},
"AutoloadClasses": {
- "CitoidHooks": "Citoid.hooks.php"
+ "CitoidHooks": "Citoid.hooks.php",
+ "CitoidDataModule": "CitoidDataModule.php"
},
"ResourceModules": {
"ext.citoid.visualEditor": {
@@ -36,7 +37,8 @@
"ext.visualEditor.mwreference",
"json",
"ext.visualEditor.mediawiki",
- "mediawiki.api.options"
+ "mediawiki.api.options",
+ "ext.citoid.visualEditor.data"
],
"messages": [
"citoid-520-error",
@@ -60,6 +62,9 @@
"desktop",
"mobile"
]
+ },
+ "ext.citoid.visualEditor.data": {
+ "class": "CitoidDataModule"
}
},
"ResourceFileModulePaths": {
diff --git a/modules/ve.ui.CiteFromIdInspectorTool.js
b/modules/ve.ui.CiteFromIdInspectorTool.js
index e2bbdc8..15e6ba3 100644
--- a/modules/ve.ui.CiteFromIdInspectorTool.js
+++ b/modules/ve.ui.CiteFromIdInspectorTool.js
@@ -3,7 +3,12 @@
try {
JSON.parse( mw.message( 'citoid-template-type-map.json'
).plain() );
} catch ( e ) {
- return;
+ // Temporary hack for T93800
+ try {
+ JSON.parse( mw.message(
'citoid-template-type-map-backup.json' ).plain() );
+ } catch ( e2 ) {
+ return;
+ }
}
// HACK: Find the position of the current citation toolbar definition
--
To view, visit https://gerrit.wikimedia.org/r/236218
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Iccc4df3cc5c7e59010cf91b5a12343088f44b7ce
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Citoid
Gerrit-Branch: wmf/1.26wmf21
Gerrit-Owner: Jforrester <[email protected]>
Gerrit-Reviewer: Alex Monk <[email protected]>
Gerrit-Reviewer: Esanders <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits