Index: trunk/phase3/docs/hooks.txt =================================================================== --- trunk/phase3/docs/hooks.txt (revision 91509) +++ trunk/phase3/docs/hooks.txt (revision 91510) @@ -862,6 +862,10 @@ &$cookies: array of cookies name, add a value to it if you want to add a cookie that have to vary cache options +'GetDefaultSortkey': Override the default sortkey for a page. +$title: Title object that we need to get a sortkey for +&$sortkey: Sortkey to use. + 'GetFullURL': modify fully-qualified URLs used in redirects/export/offsite data $title: Title object of page $url: string value as output (out parameter, can modify) Index: trunk/phase3/RELEASE-NOTES =================================================================== --- trunk/phase3/RELEASE-NOTES +++ trunk/phase3/RELEASE-NOTES @@ -300,6 +300,8 @@ the footers of skins. * $wgFileCacheDepth can be used to set the depth of the subdirectory hierarchy. used for the file cache. Default value is 2, which matches former behavior. +* (bug 29680) Add GetDefaultSortkey hook to override the default sortkey. + (patched locally using upstream mediawiki.org r91510) === Bug fixes in 1.17 === Index: trunk/phase3/includes/Title.php =================================================================== --- trunk/phase3/includes/Title.php (revision 91509) +++ trunk/phase3/includes/Title.php (revision 91510) @@ -4247,6 +4247,12 @@ */ public function getCategorySortkey( $prefix = '' ) { $unprefixed = $this->getText(); + + // Anything that uses this hook should only depend + // on the Title object passed in, and should probably + // tell the users to run updateCollations.php --force + // in order to re-sort existing category relations. + wfRunHooks( 'GetDefaultSortkey', array( $this, &$unprefixed ) ); if ( $prefix !== '' ) { # Separate with a line feed, so the unprefixed part is only used as # a tiebreaker when two pages have the exact same prefix.