Last modified: 2014-02-24 18:25:31 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 T54208, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 52208 - defaultsort's noreplace argument not working as expected.
defaultsort's noreplace argument not working as expected.
Status: NEW
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
1.22.0
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-29 03:15 UTC by Technical 13
Modified: 2014-02-24 18:25 UTC (History)
3 users (show)

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


Attachments

Description Technical 13 2013-07-29 03:15:53 UTC
[22:48] <Technical_13> Can I get some clarification for the DEFAULTSORT |noreplace switch? I used it in a template that goes at the top of a page expecting it to lock that in as the defaultsort, but it doesn't seem to be working that way. Anyone have a solution for this?
[22:49] * You are now known as T13|sleeps
[22:49] <Elsie> T13|sleeps: Please include a link to what you're talking about.
[22:50] <T13|sleeps> http://enwp.org/Template:AFC_submission/declined
[22:53] <T13|sleeps> [[Category:G13 eligible AfC submissions]]{{DEFAULTSORT:{{padleft:{{#expr:(({{#time:y|{{REVISIONTIMESTAMP}}}}*12)+{{REVISIONMONTH1}})}}|3|0}}|noreplace}}
[22:54] <T13|sleeps> ^^^ that part of code
[22:56] <T13|sleeps> If you check out some of the submissions that are in the G13 eligible cat there that are under a letter you will see at the bottom of those pages defaultsort "###" replaced with blah...
[22:58] <T13|sleeps> http://en.wikipedia.org/wiki/Category:G13_eligible_AfC_submissions
[22:58] <T13|sleeps> Is the link to cat
[22:59] <T13|sleeps> http://en.wikipedia.org/wiki/Wikipedia_talk:Articles_for_creation/charlie_zelenoff
[22:59] <T13|sleeps> Is a link to an overridden defaultsort example
[23:00] <T13|sleeps> Warning: Default sort key "Zelenoff, Charlie" overrides earlier default sort key "148"
[23:00] <T13|sleeps> Is the message I get but wasn't expecting because noreplace up top I thought would prevent it.

I would expect that argument to make the parser stop looking for defaultsort magic word.
Comment 1 MZMcBride 2013-07-29 03:23:17 UTC
DEFAULTSORT has to come above the category.
Comment 2 Technical 13 2013-07-29 12:50:46 UTC
Okay, let me clean up my notes from IRC last night when I was half asleep and on my mobile device which isn't very useful for editing...

I would expect:
{{DEFAULTSORT: stuff |noreplace}}
with the "noreplace" argument/parameter to lock that default sort in for the rest of the page, regardless if I had it in the right place for that category I wanted to use it on.  As a side note, it actually was using the defaultsort after the category for the ones that didn't have conflicting defaultsort declarations elsewhere on the page.

However, all of the "Joe Smith" drafts in the category http://en.wikipedia.org/wiki/Category:G13_eligible_AfC_submissions that also had a {{defaultsort:Smith, Joe}} on the page were returning an error such as 'Warning: Default sort key "Zelenoff, Charlie" overrides earlier default sort key "148"'

I would expect the "|noreplace}}" to prevent that based on the description (It can take a second argument of noerror or noreplace to suppress error messages when multiple defaultsortkeys are used on one page or to make it do nothing if multiple defaultsortkeys are used.) at the www.mediawiki.org/wiki/Help:Magic_words#DEFAULTSORT page.
Comment 3 Bawolff (Brian Wolff) 2013-07-29 13:49:08 UTC
(In reply to comment #2)

> I would expect:
> {{DEFAULTSORT: stuff |noreplace}}
> with the "noreplace" argument/parameter to lock that default sort in for the
> rest of the page, regardless if I had it in the right place for that
> category I
> wanted to use it on.  As a side note, it actually was using the defaultsort
> after the category for the ones that didn't have conflicting defaultsort
> declarations elsewhere on the page.

Umm, noreplace does the opposite. {{defaultsort:foo|noreplace}} means use default sort of 'foo', but if there was already a default sort specified, do not replace it.

I don't think we should be able to override sorts specified on the category tag. More specific things should take precedence.
Comment 4 Bawolff (Brian Wolff) 2013-07-29 20:21:45 UTC
To be explicit: I think this bug should be closed wontfix, but am open to being convinced otherwise.

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


Navigation
Links