jenkins-bot has submitted this change and it was merged.
Change subject: Update ApiResult handling for mediawiki/core change I7b37295e
......................................................................
Update ApiResult handling for mediawiki/core change I7b37295e
Change I7b37295e for mediawiki/core deprecates several methods, and more
importantly changes the format of the data returned from
ApiResult::getData(). This change should handle these differences in a
backwards-compatible manner.
Change-Id: I7b37295e8862b188d1f3b0cd07f66ac34629678e
---
M MoreLikePageSuggester.php
1 file changed, 15 insertions(+), 6 deletions(-)
Approvals:
Mattflaschen: Looks good to me, approved
jenkins-bot: Verified
diff --git a/MoreLikePageSuggester.php b/MoreLikePageSuggester.php
index 76688a2..6bbe524 100644
--- a/MoreLikePageSuggester.php
+++ b/MoreLikePageSuggester.php
@@ -51,14 +51,23 @@
false // Don't enable write
);
$searchApiCall->execute();
- $apiResult = $searchApiCall->getResultData();
- $titles = array();
- if ( isset( $apiResult['query']['search'] ) && is_array(
$apiResult['query']['search'] ) ) {
- $searchResults = $apiResult['query']['search'];
- foreach ( $searchResults as $searchResult ) {
- $titles[] = Title::newFromText(
$searchResult['title'] );
+
+ if ( defined( 'ApiResult::META_CONTENT' ) ) {
+ $searchResults = \ApiResult::removeMetadataNonRecursive(
+
(array)$searchApiCall->getResult()->getResultData( array( 'query', 'search' ) )
+ );
+ } else {
+ $apiResult = $searchApiCall->getResultData();
+ if ( isset( $apiResult['query']['search'] ) &&
is_array( $apiResult['query']['search'] ) ) {
+ $searchResults = $apiResult['query']['search'];
+ } else {
+ $searchResults = array();
}
}
+ $titles = array();
+ foreach ( $searchResults as $searchResult ) {
+ $titles[] = Title::newFromText( $searchResult['title']
);
+ }
return $titles;
}
--
To view, visit https://gerrit.wikimedia.org/r/183585
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I7b37295e8862b188d1f3b0cd07f66ac34629678e
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/GettingStarted
Gerrit-Branch: master
Gerrit-Owner: Anomie <[email protected]>
Gerrit-Reviewer: Mattflaschen <[email protected]>
Gerrit-Reviewer: Phuedx <[email protected]>
Gerrit-Reviewer: Swalling <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits