From da8c9e5fb2afdc4bd0315bad344e170b4e111d23 Mon Sep 17 00:00:00 2001 From: Brian Wolff Date: Fri, 15 Apr 2011 17:23:44 +0000 Subject: [PATCH] (follow-up r86100) Make categorypage not die as much while transitioning between 1.16 -> 1.17 schema Basically re-putting in the intent of r83544 per suggestion on CR of r86100 --- includes/CategoryPage.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/includes/CategoryPage.php b/includes/CategoryPage.php index f252ac0577..3b4d52cb42 100644 --- a/includes/CategoryPage.php +++ b/includes/CategoryPage.php @@ -347,7 +347,8 @@ class CategoryViewer { array( 'page', 'categorylinks', 'category' ), array( 'page_id', 'page_title', 'page_namespace', 'page_len', 'page_is_redirect', 'cl_sortkey', 'cat_id', 'cat_title', - 'cat_subcats', 'cat_pages', 'cat_files', 'cl_sortkey_prefix' ), + 'cat_subcats', 'cat_pages', 'cat_files', + 'cl_sortkey_prefix', 'cl_collation' ), array_merge( array( 'cl_to' => $this->title->getDBkey() ), $extraConds ), __METHOD__, array( @@ -364,7 +365,14 @@ class CategoryViewer { $count = 0; foreach ( $res as $row ) { $title = Title::newFromRow( $row ); - $humanSortkey = $title->getCategorySortkey( $row->cl_sortkey_prefix ); + if ( !$row->cl_collation ) { + // Hack to make sure that while updating from 1.16 schema + // and db is inconsistent, that the sky doesn't fall. + // See r83544. Could perhaps be removed in a couple versions (?) + $humanSortkey = $row->cl_sortkey; + } else { + $humanSortkey = $title->getCategorySortkey( $row->cl_sortkey_prefix ); + } if ( ++$count > $this->limit ) { # We've reached the one extra which shows that there -- 2.20.1