X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2FRevisionList.php;h=5243cc65dd355b3b4b9501e24fb67126a45336fa;hp=ccdedb8e6165c3a010a9f50e64b438d3c1fb3cee;hb=048089ae3a052deaac1003996247ce86e5a60bfc;hpb=c6b1dede111e00d8993c4177c9678d17d035e5ed diff --git a/includes/RevisionList.php b/includes/RevisionList.php index ccdedb8e61..5243cc65dd 100644 --- a/includes/RevisionList.php +++ b/includes/RevisionList.php @@ -116,7 +116,7 @@ abstract class RevisionListBase extends ContextSource implements Iterator { } public function key() { - return $this->res ? $this->res->key(): 0; + return $this->res ? $this->res->key() : 0; } public function valid() { @@ -203,6 +203,16 @@ abstract class RevisionItemBase { return false; } + /** + * Get the DB field name storing actor ids. + * Override this function. + * @since 1.31 + * @return bool + */ + public function getAuthorActorField() { + return false; + } + /** * Get the ID, as it would appear in the ids URL parameter * @return int @@ -257,6 +267,16 @@ abstract class RevisionItemBase { return strval( $this->row->$field ); } + /** + * Get the author actor ID + * @since 1.31 + * @return string + */ + public function getAuthorActor() { + $field = $this->getAuthorActorField(); + return strval( $this->row->$field ); + } + /** * Returns true if the current user can view the item */ @@ -296,15 +316,14 @@ class RevisionList extends RevisionListBase { if ( $this->ids !== null ) { $conds['rev_id'] = array_map( 'intval', $this->ids ); } + $revQuery = Revision::getQueryInfo( [ 'page', 'user' ] ); return $db->select( - [ 'revision', 'page', 'user' ], - array_merge( Revision::selectFields(), Revision::selectUserFields() ), + $revQuery['tables'], + $revQuery['fields'], $conds, __METHOD__, [ 'ORDER BY' => 'rev_id DESC' ], - [ - 'page' => Revision::pageJoinCond(), - 'user' => Revision::userJoinCond() ] + $revQuery['joins'] ); }