Anomie has uploaded a new change for review.
https://gerrit.wikimedia.org/r/183576
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 api/ApiQueryCodeComments.php
M api/ApiQueryCodePaths.php
M api/ApiQueryCodeRevisions.php
3 files changed, 20 insertions(+), 4 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CodeReview
refs/changes/76/183576/1
diff --git a/api/ApiQueryCodeComments.php b/api/ApiQueryCodeComments.php
index 2c94e68..64184d9 100644
--- a/api/ApiQueryCodeComments.php
+++ b/api/ApiQueryCodeComments.php
@@ -93,7 +93,11 @@
$item['status'] = $row->cr_status;
}
if ( isset( $this->props['text'] ) ) {
- ApiResult::setContent( $item, $row->cc_text );
+ if ( defined( 'ApiResult::META_CONTENT' ) ) {
+ ApiResult::setContentValue( $item, 'text',
$row->cc_text );
+ } else {
+ ApiResult::setContent( $item, $row->cc_text );
+ }
}
return $item;
}
diff --git a/api/ApiQueryCodePaths.php b/api/ApiQueryCodePaths.php
index 2fb294d..917fdcb 100644
--- a/api/ApiQueryCodePaths.php
+++ b/api/ApiQueryCodePaths.php
@@ -54,7 +54,11 @@
foreach ( $res as $row ) {
$item = array();
- ApiResult::setContent( $item, $row->cp_path );
+ if ( defined( 'ApiResult::META_CONTENT' ) ) {
+ ApiResult::setContentValue( $item, 'path',
$row->cp_path );
+ } else {
+ ApiResult::setContent( $item, $row->cp_path );
+ }
$data[] = $item;
}
diff --git a/api/ApiQueryCodeRevisions.php b/api/ApiQueryCodeRevisions.php
index dec01ba..6d6edec 100644
--- a/api/ApiQueryCodeRevisions.php
+++ b/api/ApiQueryCodeRevisions.php
@@ -119,7 +119,11 @@
$item['path'] = $row->cr_path;
}
if ( isset( $this->props['message'] ) ) {
- ApiResult::setContent( $item, $row->cr_message );
+ if ( defined( 'ApiResult::META_CONTENT' ) ) {
+ ApiResult::setContentValue( $item, 'message',
$row->cr_message );
+ } else {
+ ApiResult::setContent( $item, $row->cr_message
);
+ }
}
if ( isset( $this->props['author'] ) ) {
$item['author'] = $row->cr_author;
@@ -164,7 +168,11 @@
'timestamp' => wfTimestamp( TS_ISO_8601,
$ref->cr_timestamp ),
'author' => $ref->cr_author ,
);
- ApiResult::setContent( $refItem, $ref->cr_message );
+ if ( defined( 'ApiResult::META_CONTENT' ) ) {
+ ApiResult::setContentValue( $refItem,
'message', $ref->cr_message );
+ } else {
+ ApiResult::setContent( $refItem,
$ref->cr_message );
+ }
$items[] = $refItem;
}
--
To view, visit https://gerrit.wikimedia.org/r/183576
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7b37295e8862b188d1f3b0cd07f66ac34629678e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CodeReview
Gerrit-Branch: master
Gerrit-Owner: Anomie <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits