From e778bf886c58262706872a6cf96ea67da60cc3fc Mon Sep 17 00:00:00 2001 From: umherirrender Date: Sun, 27 May 2012 17:47:29 +0200 Subject: [PATCH] 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 --- includes/Revision.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; } -- 2.20.1