Sortkey for categories is ignored when category is inside a <ref> and DEFAULTSORT comes after <references/>
Open, LowPublic


See URL for an example. The source is like this:


<references />


Expected result:
In both categories the article should be put under S.

Actual result:
Only in Category:Test2 the article is under S, in Category:Test it is sorted as its title says.

When you put the DEFAULTSORT before the <references/> it works as expected.

I don't know how this is handled internally, so this could be just a duplicate of bug 2700.

Version: unspecified
Severity: minor


bzimport set Reference to bz38435.
bzimport added a subscriber: Unknown Object (MLST).
Schnark created this task.Jul 17 2012, 7:34 AM

The problem exist also for tags of core:



category links are added when the wikilinks are handled, for tags this is done within the tag processing because tags always return html. At this point the defaultsort is maybe not set and the category gets an empty sortkey, which than result in the page name as default.

A solution is to look for the old defaultsort at the already added categories when setting the new defaultsort, but that will also change the custom sortkey, when he is equal to the old defaultsort.

Need some extra doing at the end of the parse.

  • Bug 44676 has been marked as a duplicate of this bug. ***

Even if this may seem like something that will only rarely occur in a Wiki environment, it does indeed happen quite often as soon as templates (for database weblinks, literature etc.) are used in references that add maintenance categories for missing data etc.

Add Comment