From: umherirrender Date: Sun, 27 May 2012 15:47:29 +0000 (+0200) Subject: setTitle on a new null revision X-Git-Tag: 1.31.0-rc.0~23494 X-Git-Url: http://git.heureux-cyclage.org/?a=commitdiff_plain;h=e778bf886c58262706872a6cf96ea67da60cc3fc;p=lhc%2Fweb%2Fwiklou.git setTitle on a new null revision Revision::getTitle will make a query against slave to load the title on demand. But when there is a slave lag, the slave does not know the new revision id and the caller gets null back Change-Id: Ia85866362715ba666d51106037e7771d6bf4a237 --- diff --git a/includes/Revision.php b/includes/Revision.php index 6928eb97f6..98b8a0de94 100644 --- a/includes/Revision.php +++ b/includes/Revision.php @@ -1120,7 +1120,8 @@ class Revision { $current = $dbw->selectRow( array( 'page', 'revision' ), - array( 'page_latest', 'rev_text_id', 'rev_len', 'rev_sha1' ), + array( 'page_latest', 'page_namespace', 'page_title', + 'rev_text_id', 'rev_len', 'rev_sha1' ), array( 'page_id' => $pageId, 'page_latest=rev_id', @@ -1137,6 +1138,7 @@ class Revision { 'len' => $current->rev_len, 'sha1' => $current->rev_sha1 ) ); + $revision->setTitle( Title::makeTitle( $current->page_namespace, $current->page_title ) ); } else { $revision = null; }