QChris has uploaded a new change for review.
https://gerrit.wikimedia.org/r/180778
Change subject: Follow MediaWikis move from getJsonData to getData
......................................................................
Follow MediaWikis move from getJsonData to getData
MediaWiki deprecated getJsonData in favour of getData. Hence, we
migrate our use of getJsonData to getData.
Change-Id: I68d26ad7dbbb9822c430991af5339eaaccf3862a
---
M includes/ApiJsonSchema.php
M includes/JsonSchemaContent.php
2 files changed, 11 insertions(+), 5 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/EventLogging
refs/changes/78/180778/1
diff --git a/includes/ApiJsonSchema.php b/includes/ApiJsonSchema.php
index 5849fc8..9dd571f 100644
--- a/includes/ApiJsonSchema.php
+++ b/includes/ApiJsonSchema.php
@@ -125,7 +125,11 @@
}
$this->markCacheable();
- $schema = $content->getJsonData( true );
+ $status = $content->getData( true );
+ if ( !$status->isGood() ) {
+ $this->dieStatus( $status );
+ }
+ $schema = $status->getValue();
$result = $this->getResult();
$result->addValue( null, 'title', $title->getText() );
diff --git a/includes/JsonSchemaContent.php b/includes/JsonSchemaContent.php
index 96e5709..ea30a16 100644
--- a/includes/JsonSchemaContent.php
+++ b/includes/JsonSchemaContent.php
@@ -56,8 +56,9 @@
* @return bool: True if valid.
*/
function validate() {
- $schema = $this->getJsonData();
- if ( !is_array( $schema ) ) {
+ $status = $this->getData( true );
+ $schema = $status->getValue();
+ if ( !$status->isGood() || !is_array( $schema ) ) {
throw new JsonSchemaException( wfMessage(
'eventlogging-invalid-json' )->parse() );
}
return efSchemaValidate( $schema );
@@ -178,7 +179,8 @@
* @return string: HTML representation.
*/
function getHtml() {
- $schema = $this->getJsonData();
- return is_array( $schema ) ? self::objectTable( $schema ) : '';
+ $status = $this->getData( true );
+ $schema = $status->getValue();
+ return ( $status->isGood() && is_array( $schema ) ) ?
self::objectTable( $schema ) : '';
}
}
--
To view, visit https://gerrit.wikimedia.org/r/180778
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I68d26ad7dbbb9822c430991af5339eaaccf3862a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/EventLogging
Gerrit-Branch: master
Gerrit-Owner: QChris <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits