EBernhardson (WMF) has submitted this change and it was merged.
Change subject: Flow revision API should query content based on binary id
......................................................................
Flow revision API should query content based on binary id
Change-Id: Ibb5211c272339e201f5fd0e8472381fda7ac3975
---
M includes/api/ApiQueryRevisionContentFlow.php
1 file changed, 9 insertions(+), 4 deletions(-)
Approvals:
EBernhardson (WMF): Verified; Looks good to me, approved
diff --git a/includes/api/ApiQueryRevisionContentFlow.php
b/includes/api/ApiQueryRevisionContentFlow.php
index 64bff5d..c5c6df3 100644
--- a/includes/api/ApiQueryRevisionContentFlow.php
+++ b/includes/api/ApiQueryRevisionContentFlow.php
@@ -14,10 +14,15 @@
$container = Container::getContainer();
$storage = $container['storage']->getStorage(
$params['container'] );
- $post = $storage->find(
- array( 'tree_rev_descendant_id' => $params['id'] ),
- array( 'sort' => 'rev_id', 'order' => 'DESC', 'limit'
=> 1 )
- );
+ $id = UUID::create( $params['id'] );
+ $post = null;
+
+ if ( $id ) {
+ $post = $storage->find(
+ array( 'tree_rev_descendant_id' =>
$id->getBinary() ),
+ array( 'sort' => 'rev_id', 'order' => 'DESC',
'limit' => 1 )
+ );
+ }
if ( !$post ) {
throw new \MWException( 'Unknown post: '. $params['id']
);
--
To view, visit https://gerrit.wikimedia.org/r/85026
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ibb5211c272339e201f5fd0e8472381fda7ac3975
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Bsitu <[email protected]>
Gerrit-Reviewer: EBernhardson (WMF) <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits