Don't regenerate raw sortkeys in CategoryPage.php
authorAryeh Gregor <simetrical@users.mediawiki.org>
Tue, 8 Mar 2011 20:49:35 +0000 (20:49 +0000)
committerAryeh Gregor <simetrical@users.mediawiki.org>
Tue, 8 Mar 2011 20:49:35 +0000 (20:49 +0000)
commita196afa99c633fb8cb1f95e6d030d885b06183cd
treee3475214b20a23e34ce465c326e5f58635f7c9a1
parent6d81d042f5e2bcfb797d4f587f47e326f19fc284
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.
includes/CategoryPage.php