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 $wgPageImagesExpandOpenSearchXml variable should probably be
renamed, but I'm leaving that for a different patch.

Change-Id: I16024aa22578585873cddba1daa4ca0dc05645e1
---
M PageImages.body.php
M PageImages.php
2 files changed, 5 insertions(+), 4 deletions(-)

Approvals:
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/PageImages.body.php b/PageImages.body.php
index 21681e5..b3ca0fb 100644
--- a/PageImages.body.php
+++ b/PageImages.body.php
@@ -212,11 +212,11 @@
        }
 
        /**
-        * OpenSearchXml hook handler, enhances Extension:OpenSearchXml results 
with this extension's data
+        * ApiOpenSearchSuggest hook handler, enhances ApiOpenSearch results 
with this extension's data
         * @param array $results
         * @return bool
         */
-       public static function onOpenSearchXml( &$results ) {
+       public static function onApiOpenSearchSuggest( &$results ) {
                global $wgPageImagesExpandOpenSearchXml;
                if ( !$wgPageImagesExpandOpenSearchXml || !count( $results ) ) {
                        return true;
diff --git a/PageImages.php b/PageImages.php
index 8a6b595..ec1535c 100644
--- a/PageImages.php
+++ b/PageImages.php
@@ -22,7 +22,8 @@
 
 $wgHooks['ParserMakeImageParams'][] = 'PageImages::onParserMakeImageParams';
 $wgHooks['LinksUpdate'][] = 'PageImages::onLinksUpdate';
-$wgHooks['OpenSearchXml'][] = 'PageImages::onOpenSearchXml';
+$wgHooks['OpenSearchXml'][] = 'PageImages::onApiOpenSearchSuggest';
+$wgHooks['ApiOpenSearchSuggest'][] = 'PageImages::onApiOpenSearchSuggest';
 $wgHooks['InfoAction'][] = 'PageImages::onInfoAction';
 $wgHooks['AfterParserFetchFileAndTitle'][] = 
'PageImages::onAfterParserFetchFileAndTitle';
 $wgHooks['SpecialMobileEditWatchlist::images'][] = 
'PageImages::onSpecialMobileEditWatchlist_images';
@@ -82,7 +83,7 @@
 $wgPageImagesBlacklistExpiry = 60 * 15;
 
 /**
- * Whether this extension's image information should be used by OpenSearchXml
+ * Whether this extension's image information should be used by OpenSearch
  */
 $wgPageImagesExpandOpenSearchXml = false;
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I16024aa22578585873cddba1daa4ca0dc05645e1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PageImages
Gerrit-Branch: master
Gerrit-Owner: Anomie <[email protected]>
Gerrit-Reviewer: Brion VIBBER <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to