Index: trunk/phase3/docs/hooks.txt |
— | — | @@ -862,6 +862,10 @@ |
863 | 863 | &$cookies: array of cookies name, add a value to it if you want to add a cookie |
864 | 864 | that have to vary cache options |
865 | 865 | |
| 866 | +'GetDefaultSortkey': Override the default sortkey for a page. |
| 867 | +$title: Title object that we need to get a sortkey for |
| 868 | +&$sortkey: Sortkey to use. |
| 869 | + |
866 | 870 | 'GetFullURL': modify fully-qualified URLs used in redirects/export/offsite data |
867 | 871 | $title: Title object of page |
868 | 872 | $url: string value as output (out parameter, can modify) |
Index: trunk/phase3/RELEASE-NOTES-1.19 |
— | — | @@ -67,6 +67,7 @@ |
68 | 68 | * (bug 5800) Added $formCallback as a parameter to the hook |
69 | 69 | EditPage::showEditForm:initial |
70 | 70 | * (bug 29723) mw.util.wikiGetlink() now defaults to wgPageName. |
| 71 | +* (bug 29680) Add GetDefaultSortkey hook to override the default sortkey. |
71 | 72 | |
72 | 73 | === Bug fixes in 1.19 === |
73 | 74 | * (bug 28868) Show total pages in the subtitle of an image on the |
Index: trunk/phase3/includes/Title.php |
— | — | @@ -4247,6 +4247,12 @@ |
4248 | 4248 | */ |
4249 | 4249 | public function getCategorySortkey( $prefix = '' ) { |
4250 | 4250 | $unprefixed = $this->getText(); |
| 4251 | + |
| 4252 | + // Anything that uses this hook should only depend |
| 4253 | + // on the Title object passed in, and should probably |
| 4254 | + // tell the users to run updateCollations.php --force |
| 4255 | + // in order to re-sort existing category relations. |
| 4256 | + wfRunHooks( 'GetDefaultSortkey', array( $this, &$unprefixed ) ); |
4251 | 4257 | if ( $prefix !== '' ) { |
4252 | 4258 | # Separate with a line feed, so the unprefixed part is only used as |
4253 | 4259 | # a tiebreaker when two pages have the exact same prefix. |