jenkins-bot has submitted this change and it was merged.

Change subject: (bug 62634) Fatal exception "DatabaseBase::makeList: empty 
input for field rev_id" on Special:Contributions
......................................................................


(bug 62634) Fatal exception "DatabaseBase::makeList: empty input for field 
rev_id" on Special:Contributions

Patch should fix fatal on e.g. 
https://www.mediawiki.org/wiki/Special:Contributions/Quiddity

Bug: 62634
Change-Id: I9ed1486cd203a324e24c1f62d0f38d2e0d95cc30
(cherry picked from commit c824df70f8ce85315ade77d20e3fd2885ac878a4)
---
M includes/Data/RevisionStorage.php
1 file changed, 23 insertions(+), 20 deletions(-)

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



diff --git a/includes/Data/RevisionStorage.php 
b/includes/Data/RevisionStorage.php
index 6278f2b..20f8dd7 100644
--- a/includes/Data/RevisionStorage.php
+++ b/includes/Data/RevisionStorage.php
@@ -155,8 +155,9 @@
                $duplicator = new ResultDuplicator( array( 'rev_id' ), 1 );
                $pks = array();
                foreach ( $queries as $idx => $query ) {
+                       $query = UUID::convertUUIDs( $query );
                        $id = $query['rev_id'];
-                       $duplicator->add( UUID::convertUUIDs( $query ), $idx );
+                       $duplicator->add( $query, $idx );
                        $pks[$id] = $id;
                }
 
@@ -210,26 +211,28 @@
        }
 
        protected function findRevIdReal( ResultDuplicator $duplicator, array 
$revisionIds ) {
-               //  SELECT * from flow_tree_revision
-               //        JOIN flow_revision ON tree_rev_id = rev_id
-               //   WHERE tree_rev_id IN (...)
-               $dbr = $this->dbFactory->getDB( DB_MASTER );
-               $res = $dbr->select(
-                       array( 'flow_revision', 'rev' => $this->joinTable() ),
-                       '*',
-                       array( 'rev_id' => $revisionIds ),
-                       __METHOD__,
-                       array(),
-                       array( 'rev' => array( 'JOIN', 'rev_id = ' . 
$this->joinField() ) )
-               );
-               if ( !$res ) {
-                       // TODO: dont fail, but dont end up caching bad result 
either
-                       throw new DataModelException( 'query failure', 
'process-data' );
-               }
+               if ( $revisionIds ) {
+                       //  SELECT * from flow_tree_revision
+                       //        JOIN flow_revision ON tree_rev_id = rev_id
+                       //   WHERE tree_rev_id IN (...)
+                       $dbr = $this->dbFactory->getDB( DB_MASTER );
+                       $res = $dbr->select(
+                               array( 'flow_revision', 'rev' => 
$this->joinTable() ),
+                               '*',
+                               array( 'rev_id' => $revisionIds ),
+                               __METHOD__,
+                               array(),
+                               array( 'rev' => array( 'JOIN', 'rev_id = ' . 
$this->joinField() ) )
+                       );
+                       if ( !$res ) {
+                               // TODO: dont fail, but dont end up caching bad 
result either
+                               throw new DataModelException( 'query failure', 
'process-data' );
+                       }
 
-               foreach ( $res as $row ) {
-                       $row = (array)$row;
-                       $duplicator->merge( $row, array( $row ) );
+                       foreach ( $res as $row ) {
+                               $row = (array)$row;
+                               $duplicator->merge( $row, array( $row ) );
+                       }
                }
 
                return $duplicator->getResult();

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9ed1486cd203a324e24c1f62d0f38d2e0d95cc30
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: wmf/1.23wmf18
Gerrit-Owner: Spage <[email protected]>
Gerrit-Reviewer: EBernhardson <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: Matthias Mullie <[email protected]>
Gerrit-Reviewer: Spage <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to