Closed Bug 1205451 Opened 9 years ago Closed 6 years ago

Table sort: If the sort text starts with a macro call, sort based on the value of the macro's first parameter

Categories

(developer.mozilla.org Graveyard :: Editing, defect)

defect
Not set
minor

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: sheppy, Unassigned)

References

Details

(Keywords: in-triage)

Currently, when sorting tables in which the sort column includes cells whose contents are a macro call, the sort is done based on "{{event('...')}}" or whatever. This wouldn't be a problem if every cell used the exact same macro, but if there's a mix of macros, or if some cells are plain text, the sort order comes out all wrong.

Making the changes necessary to sort on the output of the macros in these cases would be fairly complicated, since the macros would have to be run to generate the output, then the sort performed on that output, then remapping etc etc.

I propose solving the almost-always scenario, which is this: macros whose purpose is to take a word and automatically create a link, add some style (usually <code>), and insert that text into the document. That means that sorting based on the value of the first parameter passed into these macros will almost always (if not always) result in correct sorting.

This is a simple thing to implement by creating a custom version of the tablesort plugin for CKEditor and adding a few lines of code to check for and handle this situation. I propose that this be done to improve the utility of our table sort feature.

This could be done by any contributor, I expect. If it's not done by the start of Q4 2015, I'll probably do it myself.
Severity: normal → minor
Keywords: in-triage
Sheppy, do you have a concrete example there?

I'm not convinced this is a real problem now.
Flags: needinfo?(eshepherd)
Yeah, this happens on a number of pages that use tables that have a lot of macros in them. I was running into this a lot when I posted this bug and wish I had noted the pages I was running into it on. Since I'm working on other content now, I don't recall where I was at the time. I also got a couple of reports from people complaining about tables that were hard to use because they were sorted wrong and sorting them didn't fix it -- this turned out to be the cause.

One place where this is pretty common (but fixable) is places where tables have a first column which links to things using a macro, except that where pages haven't been created yet, they cells are just plain text instead of macros. That's not how it should be done, but there are places like that here and there.

I will try to remember where the legit use cases for this are.
Flags: needinfo?(eshepherd)
Flags: needinfo?(eshepherd)
Hi,

I'd like to get started on this. Can you provide info on how I should proceed?
We have a lot of older feature requests that haven't been fixed, because they haven't been a priority compared to other issues with the Kuma platform.  This bug is one of them, and the conversation (that took 6 months!) didn't result in a concrete example, such as a URL on MDN.  I'm afraid it may be another 3 months before you get an answer to your question.

I'm dropping the "mentor" tag - I don't think this is currently a good candidate for getting into MDN development.  Sorry for the confusion, Wasif.
Mentor: eshepherd
FWIW I still think this would be useful. :)
sheppy, please provide a URL that demonstrates the issue.
Status: NEW → RESOLVED
Closed: 6 years ago
Flags: needinfo?(eshepherd)
Resolution: --- → WONTFIX
Product: developer.mozilla.org → developer.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.