Last modified: 2011-09-08 20:11:18 UTC
What happens: 1) We have a year article, say, [[1056]]. It is in category e.g. [[:Saachjropp:Joohr]], and it has a sort key of 1056 specified for the category, indirectly via a template {{Schablon:Navvi Joohr Kopp|||1|0|5|6|...}} which expands the line [[Category:Joohr|{{Schablon:Kat Joohr n|1|0|5| 6}}]] which in turn expands to [[Category:Joohr|1056]] 2) Now the page is renamed to [[Joohr 1056]]. As a result, the abovementioned sort key "1056" is deleted, or effectively replaced by "Joohr 1056". 3) On the next edit, the sort key is restored to the original "1056", since the macros expand independently of the {{PAGENAME}}. I do not think, that the sort key should be deleted, or altered, in step 2, unless none had been specified at all. If the sort key is set inside a template expansion, there is no way of knowing whether or not the sort key is to remain unchanged, unless it is itself either given as a constand or a macro with constant result and known dependencies. So there is (a) the choice of flagging sort key as constant or not, or (b) to re-evaluate all macros that may generate sort keys, when a page is stored after a rename. I apologize for the bad news.
This should be fixed with the category changes in 1.17. Marking fixed. Please re-open if still present. (We now use a special flag for if no sortkey specified) (Of course we would still have issue with the sortkey's not updating properly if they use variables like {{PAGENAME}} in them, but that's a minor use case)
Shall we open a new bug for the remaining use case of sort key expansions depending on {{PAGENAME}} ? Else I suggest keeping this bug open until the last rare use case is solved.
(In reply to comment #2) > Shall we open a new bug for the remaining use case of sort key expansions > depending on {{PAGENAME}} ? Else I suggest keeping this bug open until the last > rare use case is solved. I created bug 30819, although to be honest that's probably going to be wontfixed.