From a196afa99c633fb8cb1f95e6d030d885b06183cd Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Tue, 8 Mar 2011 20:49:35 +0000 Subject: [PATCH] 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/CategoryPage.php b/includes/CategoryPage.php index a5fbe8e41a..5b96a1d84e 100644 --- a/includes/CategoryPage.php +++ b/includes/CategoryPage.php @@ -360,7 +360,7 @@ class CategoryViewer { $count = 0; foreach ( $res as $row ) { $title = Title::newFromRow( $row ); - $rawSortkey = $title->getCategorySortkey( $row->cl_sortkey_prefix ); + $rawSortkey = $row->cl_sortkey; if ( ++$count > $this->limit ) { # We've reached the one extra which shows that there -- 2.20.1