Last modified: 2013-02-07 16:03:44 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T46676, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 44676 - {{DEFAULTSORT}} not applied to things inside <ref> if defaultsort appears after <references/>
{{DEFAULTSORT}} not applied to things inside <ref> if defaultsort appears aft...
Status: RESOLVED DUPLICATE of bug 38435
Product: MediaWiki extensions
Classification: Unclassified
Cite (Other open bugs)
unspecified
All All
: Normal normal with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-02-05 13:13 UTC by User:Storkk
Modified: 2013-02-07 16:03 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description User:Storkk 2013-02-05 13:13:47 UTC
This behavior is observable on the English Wikipedia. For example, https://en.wikipedia.org/wiki/Brian_King uses the magic word, as: {{DEFAULTSORT:King, Brian}} - it works inconsistently: in https://en.wikipedia.org/wiki/Category:People_educated_at_Sydney_Boys_High_School he is sorted under K. However, for some categories, e.g. https://en.wikipedia.org/wiki/Category:Articles_with_invalid_ISBNs he is sorted under B. The category contains numerous examples of correctly interpreted {{DEFAULTSORT}}s (e.g. https://en.wikipedia.org/wiki/Dodie_Bellamy ) and incorrectly interpreted ones (all the Michaels here: https://en.wikipedia.org/w/index.php?title=Category:Articles_with_invalid_ISBNs&pagefrom=Mi ).
Comment 1 User:Storkk 2013-02-05 18:33:15 UTC
Note: there is a discussion regarding this behavior here: http://en.wikipedia.org/wiki/Help_talk:Category#DEFAULTSORT_inconsistency_.28.3F.29
Comment 2 Bawolff (Brian Wolff) 2013-02-05 18:53:17 UTC
That's interesting. I wonder if it could possibly be related to that old bug where magic words were not recognized during reparses happening via the job queue (although I believe that was long fixed) [Can't find bug number at the moment]
Comment 3 Bawolff (Brian Wolff) 2013-02-05 23:40:14 UTC
Hmm, even on fresh parses the sortkey for that cat is wrong - https://en.wikipedia.org/w/api.php?text={{:Brian_King}}&action=parse&prop=categories

Also, https://en.wikipedia.org/w/index.php?title=Brian_King&action=raw&templates=expand&ctype=text/css doesn't expand the ISBN is broken template??
Comment 4 Bawolff (Brian Wolff) 2013-02-05 23:43:05 UTC
Oh, its because its inside a <ref> (Causes the {{Defaultsortkey}} not to be applied, and for that template not to be expanded in the expandtemplates call i listed in comment 3)
Comment 5 Bawolff (Brian Wolff) 2013-02-05 23:51:21 UTC
Sorry, I updated the bug a little too quickly. It only happens if the {{DEFAULTSORT}} comes after the <references/> list.

Minimal test case: category:foo]]%3C/ref%3E%3Creferences/%3E{{DEFAULTSORT:bar}}&action=parse&prop=categories">https://en.wikipedia.org/w/api.php?text=%3Cref%3E[[category:foo]]%3C/ref%3E%3Creferences/%3E{{DEFAULTSORT:bar}}&action=parse&prop=categories

(Expected behaviour is for that query to have same output as category:foo]]%3C/ref%3E{{DEFAULTSORT:bar}}%3Creferences/%3E&action=parse&prop=categories">https://en.wikipedia.org/w/api.php?text=%3Cref%3E[[category:foo]]%3C/ref%3E{{DEFAULTSORT:bar}}%3Creferences/%3E&action=parse&prop=categories
Comment 7 User:Storkk 2013-02-06 00:48:54 UTC
Unfortunately, it may be a little more complex, or there may be another bug to find. The bug you found the minimal test case for doesn't seem to account for the fact that on some categories, the DEFAULTSORT _is_ taken into account (e.g. Brian King in Category:People_educated_at_Sydney_Boys_High_School ).
Comment 8 Bawolff (Brian Wolff) 2013-02-06 01:01:50 UTC
(In reply to comment #7)
> Unfortunately, it may be a little more complex, or there may be another bug
> to
> find. The bug you found the minimal test case for doesn't seem to account for
> the fact that on some categories, the DEFAULTSORT _is_ taken into account
> (e.g.
> Brian King in Category:People_educated_at_Sydney_Boys_High_School ).

That category is not inside a <ref> tag.

So if this was an example article

Lorem ipsum dolor sit amet,
[[category:Foo]] consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
<ref>[[category:Bar]]</ref> Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
<references/>
{{DEFAULTSORT:xyzzy}}
Excepteur sint
[[category:Baz]]
occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Category Foo and Baz would have the sortkey xyzzy, while Bar (being inside a <ref>) would have the page's name as the sortkey. If {{DEFAULTSORT:xyzzy}} was moved before the <references/> tag, then all three would have xyzzy as their sortkey.
Comment 9 User:Storkk 2013-02-06 02:43:42 UTC
I misunderstood what you were saying. Apologies.
Comment 10 Bawolff (Brian Wolff) 2013-02-06 03:07:08 UTC
(In reply to comment #9)
> I misunderstood what you were saying. Apologies.

No worries, I was a bit unclear the first time around.
Comment 11 Bawolff (Brian Wolff) 2013-02-07 16:03:44 UTC

*** This bug has been marked as a duplicate of bug 38435 ***

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links