Skip to content

Commit

Permalink
Deprecate WVUI, ResourceLoaderContext
Browse files Browse the repository at this point in the history
Deprecate WVUI in favor of Codex.

Replace deprecated PHP class alias ResourceLoaderContext
with namespaced MediaWiki\ResourceLoader\Context .

The class was namespaced in MediaWiki 1.39
(commit 3e2653f83bc096889d8b69d1e01a52d7de42b247,
Change-Id Id08a220e1d6085e2b33f3f6c9d0e3935a4204659),

and the deprecated class alias was removed in MediaWiki 1.42
(commit 21d8d9863b393e0bea608ac2f926b40bfecff9ad,
Change-Id I5929a2f760c8d21c1cb2542a19220a91ac7240e4).

https://phabricator.wikimedia.org/T310243

Bug: lakejason0#21
Bug: lakejason0#38
Bug: T310243
Change-Id: I97f923dd9fc7b8305f7271c08076aaec12c3105c
  • Loading branch information
winstonsung committed Aug 23, 2024
1 parent 947e86d commit 707668f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
9 changes: 4 additions & 5 deletions includes/Hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,19 @@
use Config;
# use MediaWiki\Config\Config; // Namespaced in 1.41.0
use MediaWiki\Preferences\Hook\GetPreferencesHook;
# use MediaWiki\ResourceLoader\Context; // Namespaced in 1.39.0
use ResourceLoaderContext;
use MediaWiki\ResourceLoader\Context as ResourceLoaderContext;

class Hooks implements GetPreferencesHook {
/**
* @param ResourceLoaderContext $context
* @param Config $config
* @return $wgLakeusWvuiSearchOptions
* @return $wgLakeusSearchOptions
*/
public function getLakeusWvuiSearchResourceLoaderConfig(
public function getLakeusSearchResourceLoaderConfig(
ResourceLoaderContext $context,
Config $config
) {
return $config->get( 'LakeusWvuiSearchOptions' );
return $config->get( 'LakeusSearchOptions' );
}

/**
Expand Down
15 changes: 8 additions & 7 deletions skin.json
Original file line number Diff line number Diff line change
Expand Up @@ -197,18 +197,18 @@
]
},
"skins.lakeus.search": {
"es6": true,
"dependencies": [
"mediawiki.Uri",
"wvui"
"mediawiki.Uri"
],
"es6": true,
"packageFiles": [
"resources/skins.lakeus.search/skins.lakeus.search.js",
"resources/skins.lakeus.search/App.vue",
{
"name": "resources/skins.lakeus.search/config.json",
"callback": "MediaWiki\\Skins\\Lakeus\\Hooks::getLakeusWvuiSearchResourceLoaderConfig"
"callback": "MediaWiki\\Skins\\Lakeus\\Hooks::getLakeusSearchResourceLoaderConfig"
}

],
"messages": [
"searchbutton",
Expand Down Expand Up @@ -291,10 +291,11 @@
"value": "",
"description": "Override default search API. Can be used with $wgDisableTextSearch and $wgSearchForwardUrl to mimic user experience on production."
},
"LakeusUseWvuiSearch": {
"value": true
"LakeusSearchModuleType": {
"value": null,
"description": "Which search module to use. Options: null (default Codex) / 'codex' (Codex) / 'jquery' (legacy jQuery search)."
},
"LakeusWvuiSearchOptions": {
"LakeusSearchOptions": {
"value": {
"showThumbnail": true,
"showDescription": true
Expand Down

0 comments on commit 707668f

Please sign in to comment.