GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Edit Task
  • Edit Related Tasks...
  • Create Subtask
  • Edit Parent Tasks
  • Edit Subtasks
  • Merge Duplicates In
  • Close As Duplicate
  • Edit Commits
  • Edit Mocks
  • Mute Notifications
  • Protect as security issue
  • Cite
  • (Defect backlog)
  • MediaWiki-Parser

This view

  • Original page
  • New address

GeezerVison is showing phabricator.wikimedia.org — T40435 Sortkey for categories is ignored when category is inside a <ref> and DEFAULTSORT comes after <references/>

Page MenuHomePhabricator
Log In
Create Task
Maniphest T40435

Sortkey for categories is ignored when category is inside a <ref> and DEFAULTSORT comes after <references/>
Closed, ResolvedPublic
Actions

  • Edit Task
  • Edit Related Tasks...
  • Create Subtask
  • Edit Parent Tasks
  • Edit Subtasks
  • Merge Duplicates In
  • Close As Duplicate
  • Edit Related Objects...
  • Edit Commits
  • Edit Mocks
  • Mute Notifications
  • Protect as security issue
Assigned To
None
Authored By
Schnark
Jul 17 2012, 7:34 AM2012-07-17 07:34:00 (UTC+0)
Project Tags
  • Cite (Defect backlog)
  • MediaWiki-Parser (Backlog)
  • User-notice-archive (Backlog)
Referenced Files
None
Subscribers
AndreasPraefcke
cscott
matmarex
Schnark
Tacsipacsi
UOzurumba
• wikibugs-l-list
XanonymusX

Description

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

Text<ref>[[Category:Test]]</ref>[[Category:Test2]]

<references />

{{DEFAULTSORT:Sortkey}}

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 T4700.


Version: unspecified
Severity: minor
URL: https://de.wikipedia.beta.wmflabs.org/wiki/Ref-sort

Details

Reference
bz38435
Related Changes in Gerrit:
SubjectAuthorRepoBranchLines +/-
Substitute category default sort key when filling links table, not at parse timeC. Scott Ananianmediawiki/coremaster+69 -16
Substitute category default sort key when filling links table, not at parse timeArlolramediawiki/coreREL1_42+69 -15
Customize query in gerrit

Related Objects

  • Mentions
Mentioned In
T353530: Category defaultsort should be applied in CategoryLinkTable.php
Mentioned Here
T353530: Category defaultsort should be applied in CategoryLinkTable.php
T4700: Pre-save transform skips extensions using wikitext (gallery, references, footnotes, Cite, status indicators, pipe trick, subst, signatures)

Event Timeline

• bzimport raised the priority of this task from to Low.Nov 22 2014, 12:45 AM2014-11-22 00:45:20 (UTC+0)
• bzimport added a project: Cite.
• bzimport set Reference to bz38435.
• bzimport added a subscriber: Unknown Object (MLST).
Schnark created this task.Jul 17 2012, 7:34 AM2012-07-17 07:34:00 (UTC+0)
Umherirrender added a comment.Sep 24 2012, 8:27 PM2012-09-24 20:27:28 (UTC+0)
Comment Actions

The problem exist also for tags of core:

<gallery>File:Wiki.png|desc[[Category:Test]]</gallery>

{{DEFAULTSORT:Sortkey}}

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.

Bawolff added a comment.Feb 7 2013, 4:03 PM2013-02-07 16:03:44 (UTC+0)
Comment Actions
  • Bug 44676 has been marked as a duplicate of this bug. ***
AndreasPraefcke added a comment.Feb 15 2013, 2:40 PM2013-02-15 14:40:59 (UTC+0)
Comment Actions

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.

Umherirrender unsubscribed.Feb 24 2015, 7:35 PM2015-02-24 19:35:43 (UTC+0)
Izno moved this task from Unsorted backlog to Defect backlog on the Cite board.Aug 22 2016, 7:20 PM2016-08-22 19:20:30 (UTC+0)
Tacsipacsi updated the task description. (Show Details)Jul 25 2018, 11:26 AM2018-07-25 11:26:14 (UTC+0)
Tacsipacsi added a project: MediaWiki-Parser.
Tacsipacsi added subscribers: Umherirrender, Tacsipacsi.
Comment Actions

According to @Umherirrender, it’s not specific to Cite.

Umherirrender unsubscribed.Feb 27 2021, 10:10 PM2021-02-27 22:10:08 (UTC+0)
XanonymusX subscribed.Jun 5 2021, 1:48 PM2021-06-05 13:48:21 (UTC+0)
Tacsipacsi mentioned this in T353530: Category defaultsort should be applied in CategoryLinkTable.php.Dec 15 2023, 3:06 PM2023-12-15 15:06:59 (UTC+0)
cscott subscribed.Dec 21 2023, 1:59 PM2023-12-21 13:59:09 (UTC+0)
Comment Actions

Patch for this in T353530.

gerritbot added a comment.Feb 12 2024, 4:17 PM2024-02-12 16:17:10 (UTC+0)
Comment Actions

Change 983434 had a related patch set uploaded (by C. Scott Ananian; author: C. Scott Ananian):

[mediawiki/core@master] Substitute category default sort key when filling links table, not at parse time

https://gerrit.wikimedia.org/r/983434

gerritbot added a project: Patch-For-Review.Feb 12 2024, 4:17 PM2024-02-12 16:17:11 (UTC+0)
gerritbot added a comment.Apr 11 2024, 2:59 PM2024-04-11 14:59:36 (UTC+0)
Comment Actions

Change #983434 merged by jenkins-bot:

[mediawiki/core@master] Substitute category default sort key when filling links table, not at parse time

https://gerrit.wikimedia.org/r/983434

Maintenance_bot removed a project: Patch-For-Review.Apr 11 2024, 3:30 PM2024-04-11 15:30:54 (UTC+0)
Tacsipacsi added a project: User-notice.Apr 12 2024, 8:34 AM2024-04-12 08:34:04 (UTC+0)
Comment Actions

Being a decade-old bug, I think it’s newsworthy that it has been fixed (draft added to Tech/News/2024/16).

UOzurumba subscribed.Apr 12 2024, 8:22 PM2024-04-12 20:22:48 (UTC+0)
Comment Actions
In T40435#9709271, @Tacsipacsi wrote:

Being a decade-old bug, I think it’s newsworthy that it has been fixed (draft added to Tech/News/2024/16).

Thanks for adding it to Tech News.

UOzurumba moved this task from To Triage to In current Tech/News draft on the User-notice board.Apr 12 2024, 8:23 PM2024-04-12 20:23:01 (UTC+0)
gerritbot added a comment.Apr 17 2024, 4:34 PM2024-04-17 16:34:15 (UTC+0)
Comment Actions

Change #1020865 had a related patch set uploaded (by Arlolra; author: C. Scott Ananian):

[mediawiki/core@REL1_42] Substitute category default sort key when filling links table, not at parse time

https://gerrit.wikimedia.org/r/1020865

gerritbot added a project: Patch-For-Review.Apr 17 2024, 4:34 PM2024-04-17 16:34:16 (UTC+0)
Quiddity moved this task from In current Tech/News draft to Already announced/Archive on the User-notice board.Apr 18 2024, 5:47 PM2024-04-18 17:47:17 (UTC+0)
gerritbot added a comment.Apr 19 2024, 2:04 PM2024-04-19 14:04:45 (UTC+0)
Comment Actions

Change #1020865 merged by jenkins-bot:

[mediawiki/core@REL1_42] Substitute category default sort key when filling links table, not at parse time

https://gerrit.wikimedia.org/r/1020865

Pppery closed this task as Resolved.Jun 14 2024, 6:35 PM2024-06-14 18:35:16 (UTC+0)
Pppery removed a project: Patch-For-Review.
Maintenance_bot edited projects, added: User-notice-archive; removed: User-notice.Jun 24 2024, 7:31 PM2024-06-24 19:31:24 (UTC+0)
Log In to Comment
Content licensed under Creative Commons Attribution-ShareAlike (CC BY-SA) 4.0 unless otherwise noted; code licensed under GNU General Public License (GPL) 2.0 or later and other open source licenses. By using this site, you agree to the Terms of Use, Privacy Policy, and Code of Conduct. · Wikimedia Foundation · Privacy Policy · Code of Conduct · Terms of Use · Disclaimer · CC-BY-SA · GPL · Credits
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.