r83544 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83543‎ | r83544 | r83545 >
Date:20:49, 8 March 2011
Author:simetrical
Status:reverted
Tags:
Comment:
Don't regenerate raw sortkeys in CategoryPage.php

Previously, when adding pages, we'd use $title->getCategorySortkey(
$row->cl_sortkey_prefix ) to generate the initial letter on category
pages. This is fine if the migration script has already been run, but
until then, cl_sortkey_prefix will always be the empty string, so the
user-specified sortkey will be ignored when generating initial letters.
Plus, if getCategorySortkey() had nontrivial computational cost, this
would be a waste of resources.

So just use $row->cl_sortkey instead. This is at least guaranteed to be
consistent with how pagination works, no matter what state the DB is in.

Already deployed by Roan to fix user bug reports in #wikimedia-tech,
from apergos, Alpha_Quadrant, and Romaine. Tested on Wikimedia, so far
so good.
Modified paths:
  • /trunk/phase3/includes/CategoryPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/CategoryPage.php
@@ -360,7 +360,7 @@
361361 $count = 0;
362362 foreach ( $res as $row ) {
363363 $title = Title::newFromRow( $row );
364 - $rawSortkey = $title->getCategorySortkey( $row->cl_sortkey_prefix );
 364+ $rawSortkey = $row->cl_sortkey;
365365
366366 if ( ++$count > $this->limit ) {
367367 # We've reached the one extra which shows that there

Follow-up revisions

RevisionCommit summaryAuthorDate
r835591.17wmf1: MFT r83544, r83545. Were already deployed on WMFcatrope00:27, 9 March 2011
r86100(bug 28540) revert r83544 - It really breaks things when using uca-default co...bawolff23:28, 14 April 2011
r86121(follow-up r86100) Make categorypage not die as much while transitioning betw...bawolff17:23, 15 April 2011

Status & tagging log