Last modified: 2011-09-11 02:23:22 UTC
If an article contains two DEFAULTSORT, for example one in a template and one in the article, the second DEFAULTSORT overrides the first one. This was used as a feature. For example: The article contains an Infobox template. The template tries to set a "default" DEFAULTSORT. In rare cases this "default" DEFAULTSORT is not perfect (especially when the article name contains umlauts). A second DEFAULTSORT was added to these few articles and everything was fine. This is still described as a feature at http://en.wikipedia.org/wiki/Help:Category#Default_sort_key Now the second DEFAULTSORT triggers an ugly error. Please remove this error. Or change the error message so it only appears if the article source _without_the_templates_ contains more than one DEFAULTSORT.
Just for the records: There are several possible solutions to the problem: 1. without source code change: 1.1 localize the error message to something that does not display anything, e.g. "-" or "&x32;" or "" 1.2 Wrap the 2nd, and following, DEFAULTSORT(s) in a <span style="display:none">…</span>, or similar whenever you do not want an error to be shown 2. with source code alterations: 2.1 Omit the error message entirely 2.2 Add a parameter to DEFAULTSORT, supplying a local error message, which can be specified as an empty string 2.3 Add a parameter to DEFAULTSORT, suppessing the error message 2.4 Add a setting to the Wiki configuration that enables/disables the DEFAULTSORT error check 3. likely, there are more possibilites Which would be best?
See also Bug # 16448
The replacing the message with something else is probably best if you never want to see that error In r96767 (MediaWiki 1.19) I added a new option to defaultsortkey {{DEFAULTSORT:your sortkey here|noerror}} which will prevent the error message from showing up. (At the same time I also added {{DEFAULTSORTKEY:your sortkey here|noreplace}} which will cause it to do nothing (including not outputting an error) if there was already a {{DEFAULTSORTKEY}} in the page.