summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSiddharth VP <siddharthvp@gmail.com>2021-12-21 21:43:42 +0530
committerSiddharth VP <siddharthvp@gmail.com>2021-12-21 21:57:50 +0530
commit72e245d73ba8be2aaf397cda6db7c90cf99d0eb3 (patch)
tree00853c0f26680f43793c4241c6c6f4049efc3bbd
parent73f008e0268fe0c0ddc17221c180540c37c20a4b (diff)
resourceloader: Disable supportsURLLoading() for packaged wiki modules
Packaged modules don't support URL-loading. It leads to two mw.loader.implement() calls with the same module name, giving an exception. A similar override of supportsURLLoading() is already being done in ResourceLoaderFileModule. Bug: T198758 Change-Id: Id4589a597ccfc4266b3e63d10f75b146aa7a287a
-rw-r--r--includes/resourceloader/ResourceLoaderWikiModule.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/includes/resourceloader/ResourceLoaderWikiModule.php b/includes/resourceloader/ResourceLoaderWikiModule.php
index cc7c07b9cf8b..403a4ce8eec6 100644
--- a/includes/resourceloader/ResourceLoaderWikiModule.php
+++ b/includes/resourceloader/ResourceLoaderWikiModule.php
@@ -323,6 +323,14 @@ class ResourceLoaderWikiModule extends ResourceLoaderModule {
}
/**
+ * @return bool
+ */
+ public function supportsURLLoading() {
+ // If package files are involved, don't support URL loading
+ return !$this->isPackaged();
+ }
+
+ /**
* Convert a namespace-formatted page title to a virtual package file name.
*
* This determines how the page may be imported in client-side code via `require()`.