Revert "[MCR] Add optional $title param to Revision byId methods"
[lhc/web/wiklou.git] / includes / Storage / RevisionStore.php
index b8debb8..b571294 100644 (file)
@@ -1075,7 +1075,7 @@ class RevisionStore implements IDBAccessObject, RevisionFactory, RevisionLookup
                        $pageId = isset( $row->rev_page ) ? $row->rev_page : 0; // XXX: also check page_id?
                        $revId = isset( $row->rev_id ) ? $row->rev_id : 0;
 
-                       $title = $this->getTitle( $pageId, $revId );
+                       $title = $this->getTitle( $pageId, $revId, $queryFlags );
                }
 
                if ( !isset( $row->page_latest ) ) {
@@ -1143,7 +1143,7 @@ class RevisionStore implements IDBAccessObject, RevisionFactory, RevisionLookup
                        $pageId = isset( $fields['page'] ) ? $fields['page'] : 0;
                        $revId = isset( $fields['id'] ) ? $fields['id'] : 0;
 
-                       $title = $this->getTitle( $pageId, $revId );
+                       $title = $this->getTitle( $pageId, $revId, $queryFlags );
                }
 
                if ( !isset( $fields['page'] ) ) {
@@ -1678,11 +1678,14 @@ class RevisionStore implements IDBAccessObject, RevisionFactory, RevisionLookup
         * MCR migration note: this replaces Revision::getPrevious
         *
         * @param RevisionRecord $rev
+        * @param Title $title if known (optional)
         *
         * @return RevisionRecord|null
         */
-       public function getPreviousRevision( RevisionRecord $rev ) {
-               $title = $this->getTitle( $rev->getPageId(), $rev->getId() );
+       public function getPreviousRevision( RevisionRecord $rev, Title $title = null ) {
+               if ( $title === null ) {
+                       $title = $this->getTitle( $rev->getPageId(), $rev->getId() );
+               }
                $prev = $title->getPreviousRevisionID( $rev->getId() );
                if ( $prev ) {
                        return $this->getRevisionByTitle( $title, $prev );
@@ -1696,11 +1699,14 @@ class RevisionStore implements IDBAccessObject, RevisionFactory, RevisionLookup
         * MCR migration note: this replaces Revision::getNext
         *
         * @param RevisionRecord $rev
+        * @param Title $title if known (optional)
         *
         * @return RevisionRecord|null
         */
-       public function getNextRevision( RevisionRecord $rev ) {
-               $title = $this->getTitle( $rev->getPageId(), $rev->getId() );
+       public function getNextRevision( RevisionRecord $rev, Title $title = null ) {
+               if ( $title === null ) {
+                       $title = $this->getTitle( $rev->getPageId(), $rev->getId() );
+               }
                $next = $title->getNextRevisionID( $rev->getId() );
                if ( $next ) {
                        return $this->getRevisionByTitle( $title, $next );