jenkins-bot has submitted this change and it was merged.
Change subject: Use new ApiOpenSearchSuggest hook
......................................................................
Use new ApiOpenSearchSuggest hook
With Ie0ab9090, the OpenSearchXml extension is merged into core. The new
hook works identically to OpenSearchXml's hook.
The $wgExtractsExtendOpenSearchXml variable should probably be renamed,
but I'm leaving that for a different patch.
Change-Id: I16024aa22578585873cddba1daa4ca0dc05645e1
---
M ApiQueryExtracts.php
M TextExtracts.php
2 files changed, 5 insertions(+), 4 deletions(-)
Approvals:
Legoktm: Looks good to me, approved
jenkins-bot: Verified
diff --git a/ApiQueryExtracts.php b/ApiQueryExtracts.php
index 0b5c37c..1f53700 100644
--- a/ApiQueryExtracts.php
+++ b/ApiQueryExtracts.php
@@ -87,11 +87,11 @@
}
/**
- * OpenSearchXml hook handler
+ * ApiOpenSearchSuggest hook handler
* @param array $results
* @return bool
*/
- public static function onOpenSearchXml( &$results ) {
+ public static function onApiOpenSearchSuggest( &$results ) {
$config = ConfigFactory::getDefaultInstance()->makeConfig(
'textextracts' );
if ( !$config->get( 'ExtractsExtendOpenSearchXml' ) || !count(
$results ) ) {
return true;
diff --git a/TextExtracts.php b/TextExtracts.php
index 195689d..c87c216 100644
--- a/TextExtracts.php
+++ b/TextExtracts.php
@@ -51,7 +51,8 @@
return new ApiQueryExtracts( $query, $action, $config );
}
-$wgHooks['OpenSearchXml'][] = 'ApiQueryExtracts::onOpenSearchXml';
+$wgHooks['OpenSearchXml'][] = 'ApiQueryExtracts::onApiOpenSearchSuggest';
+$wgHooks['ApiOpenSearchSuggest'][] =
'ApiQueryExtracts::onApiOpenSearchSuggest';
$wgHooks['UnitTestsList'][] = function( &$files ) {
$files[] = __DIR__ . '/ExtractFormatterTest.php';
return true;
@@ -81,6 +82,6 @@
);
/**
- * Whether this extension should provide its extracts for
Extension:OpenSearchXml
+ * Whether this extension should provide its extracts for OpenSearch
*/
$wgExtractsExtendOpenSearchXml = false;
--
To view, visit https://gerrit.wikimedia.org/r/171575
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I16024aa22578585873cddba1daa4ca0dc05645e1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TextExtracts
Gerrit-Branch: master
Gerrit-Owner: Anomie <[email protected]>
Gerrit-Reviewer: Brion VIBBER <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Waldir <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits