Revert "[LanguageConverter] Added some cache code based on the problems in r97512."
[lhc/web/wiklou.git] / includes / Revision.php
index b254e81..1147e6a 100644 (file)
@@ -321,6 +321,7 @@ class Revision {
        /**
         * Return the list of revision fields that should be selected to create
         * a new revision.
+        * @return array
         */
        public static function selectFields() {
                return array(
@@ -342,6 +343,7 @@ class Revision {
        /**
         * Return the list of text fields that should be selected to read the
         * revision text
+        * @return array
         */
        public static function selectTextFields() {
                return array(
@@ -352,6 +354,7 @@ class Revision {
 
        /**
         * Return the list of page fields that should be selected from page table
+        * @return array
         */
        public static function selectPageFields() {
                return array(
@@ -364,6 +367,7 @@ class Revision {
 
        /**
         * Return the list of user fields that should be selected from user table
+        * @return array
         */
        public static function selectUserFields() {
                return array( 'user_name' );
@@ -497,7 +501,7 @@ class Revision {
        /**
         * Get parent revision ID (the original previous page revision)
         *
-        * @return Integer
+        * @return Integer|null
         */
        public function getParentId() {
                return $this->mParentId;
@@ -533,12 +537,12 @@ class Revision {
                $dbr = wfGetDB( DB_SLAVE );
                $row = $dbr->selectRow(
                        array( 'page', 'revision' ),
-                       array( 'page_namespace', 'page_title' ),
+                       self::selectPageFields(),
                        array( 'page_id=rev_page',
                                   'rev_id' => $this->mId ),
-                       'Revision::getTitle' );
-               if( $row ) {
-                       $this->mTitle = Title::makeTitle( $row->page_namespace, $row->page_title );
+                       __METHOD__ );
+               if ( $row ) {
+                       $this->mTitle = Title::newFromRow( $row );
                }
                return $this->mTitle;
        }
@@ -1181,7 +1185,7 @@ class Revision {
                        $id = 0;
                }
                $conds = array( 'rev_id' => $id );
-               $conds['rev_page'] = $title->getArticleId();
+               $conds['rev_page'] = $title->getArticleID();
                $timestamp = $dbr->selectField( 'revision', 'rev_timestamp', $conds, __METHOD__ );
                if ( $timestamp === false && wfGetLB()->getServerCount() > 1 ) {
                        # Not in slave, try master
@@ -1215,7 +1219,7 @@ class Revision {
         * @return Integer
         */
        static function countByTitle( $db, $title ) {
-               $id = $title->getArticleId();
+               $id = $title->getArticleID();
                if( $id ) {
                        return Revision::countByPageId( $db, $id );
                }