r103692 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r103691‎ | r103692 | r103693 >
Date:17:21, 19 November 2011
Author:catrope
Status:resolved (Comments)
Tags:
Comment:
(bug 30368) When a page is moved, link to and display the new name rather than the old name on Special:Newpages. Did this by treating relying on rc_cur_id instead of rc_namespace & rc_title when building the list. This is safe because the Newpages query already joins against page, so we know the rc_cur_id points to an existing page.
Modified paths:
  • /trunk/phase3/includes/specials/SpecialNewpages.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialNewpages.php
@@ -297,7 +297,7 @@
298298 $lang = $this->getLang();
299299 $dm = $lang->getDirMark();
300300
301 - $title = Title::makeTitleSafe( $result->rc_namespace, $result->rc_title );
 301+ $title = Title::newFromID( $result->rc_cur_id );
302302 $spanTime = Html::element( 'span', array( 'class' => 'mw-newpages-time' ),
303303 $lang->timeanddate( $result->rc_timestamp, true )
304304 );

Follow-up revisions

RevisionCommit summaryAuthorDate
r103695RELEASE-NOTES for r103692catrope17:30, 19 November 2011
r103701Followup r103692: don't add a query per rowcatrope19:01, 19 November 2011

Comments

#Comment by Aaron Schulz (talk | contribs)   18:54, 19 November 2011

This way adds a query per row.

It already JOINs on rc_cur_id=page_id. Why not just grab page_namespace,page_title and then use Title::newFromRow()?

#Comment by Catrope (talk | contribs)   18:58, 19 November 2011

Right, that's kind of embarrassingly stupid of me. Fixing.

Status & tagging log