From: Brian Wolff Date: Thu, 14 Apr 2011 23:28:11 +0000 (+0000) Subject: (bug 28540) revert r83544 - It really breaks things when using uca-default collation... X-Git-Tag: 1.31.0-rc.0~30829 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/operations/?a=commitdiff_plain;h=225e0118f14beb39c59945a6005f737d49c475a4;p=lhc%2Fweb%2Fwiklou.git (bug 28540) revert r83544 - It really breaks things when using uca-default collation (As noticed on tw) Various functions (particuarly the getFirstCharacter ones) all expect to have the human readable sortkey. Passing them the binary sortkey results in the getFirstChar headers to be totally wrong. It also causes paging not to work since the sortkey gets double encoded. This issue probably wasn't noticed, since it wouldn't be visible on the uppercase collation as uppercasing the first letter won't affect the first character headings, nor does double uppercasing something matter. Also changed one of the variable names from $rawSortkey to $humanSortkey as it confused me (raw as in before turning to binary, or raw as in the real non-human readable sortkey) --- diff --git a/includes/CategoryPage.php b/includes/CategoryPage.php index a8cae439de..f252ac0577 100644 --- a/includes/CategoryPage.php +++ b/includes/CategoryPage.php @@ -244,7 +244,7 @@ class CategoryViewer { * else use sortkey... * * @param Title $title - * @param string $sortkey + * @param string $sortkey The human-readable sortkey (before transforming to icu or whatever). */ function getSubcategorySortChar( $title, $sortkey ) { global $wgContLang; @@ -364,22 +364,22 @@ class CategoryViewer { $count = 0; foreach ( $res as $row ) { $title = Title::newFromRow( $row ); - $rawSortkey = $row->cl_sortkey; + $humanSortkey = $title->getCategorySortkey( $row->cl_sortkey_prefix ); if ( ++$count > $this->limit ) { # We've reached the one extra which shows that there # are additional pages to be had. Stop here... - $this->nextPage[$type] = $rawSortkey; + $this->nextPage[$type] = $humanSortkey; break; } if ( $title->getNamespace() == NS_CATEGORY ) { $cat = Category::newFromRow( $row, $title ); - $this->addSubcategoryObject( $cat, $rawSortkey, $row->page_len ); + $this->addSubcategoryObject( $cat, $humanSortkey, $row->page_len ); } elseif ( $title->getNamespace() == NS_FILE ) { - $this->addImage( $title, $rawSortkey, $row->page_len, $row->page_is_redirect ); + $this->addImage( $title, $humanSortkey, $row->page_len, $row->page_is_redirect ); } else { - $this->addPage( $title, $rawSortkey, $row->page_len, $row->page_is_redirect ); + $this->addPage( $title, $humanSortkey, $row->page_len, $row->page_is_redirect ); } } }