Page MenuHomePhabricator

jquery.makeCollapsible does not handle thead and tfoot as used by jquery.tablesorter
Closed, ResolvedPublic


Example of issue: []

As can be seen in [] the mw-collapsed sortable table hides the second row used for sorting. However, the collapsible table [] show the second row when uncollapsing the table.

The problem is that mw-collapsible does not account for table rows placed in thead and tfoot, which are used by tablesorter.
It has the selector

$collapsible.find( '> tbody > tr' );

Version: 1.23.0
Severity: normal

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 3:06 AM
bzimport set Reference to bz62878.
bzimport added a subscriber: Unknown Object (MLST).

I've fixed this bug for Wikia, although jquery.makeCollapsible is different between 1.19 and the current release. The fix for 1.19 can be seen at

With the changes made in Bug 30352, this is just a matter of removing the conditional at and always select every row. The row with the toggle should be excluded in the next conditional on L68.

I'd like to fix this myself if possible, I'm just a little unsure of how to do so with gerrit so it might take a little while for me to get around to submitting a patch.

Thanks for the report!

Here's a quickstart Gerrit guide:

Here's a detailed, extremely boring one:

And if you can't get it to work, there's a service that lets you directly upload patches in standard formats:

TheDJ renamed this task from jquery.makeCollapsible incompatible with jquery.tablesorter to jquery.makeCollapsible does not handle thead and tfoot as used by jquery.tablesorter.Dec 21 2015, 4:13 PM
TheDJ updated the task description. (Show Details)
TheDJ set Security to None.
TheDJ added subscribers: TheDJ, Aklapper, Lejonel.

I looked at this again. At first I was very confused because I couldn't reproduce the problem. Then I realized that it depends on the order in which the two scripts run – sortable-then-collapsible is good; collapsible-then-sortable is bad. (This is because jquery.makeCollapsible can actually handle thead and tfoot, but it can't handle it when they are inserted after it was already initialized on a table.) Conveniently, that makes the bug easy to fix!

Change 586436 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/core@master] Run tablesorter before makeCollapsible

Change 586436 merged by jenkins-bot:
[mediawiki/core@master] Run tablesorter before makeCollapsible

i'm not sure if this fixes all problems, but it should fix at least 95% of them.

TheDJ removed a project: Patch-For-Review.

Provisionally closing. Please open a new ticket if you find new cases after this gets deployed next week.

Change 619601 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/core@master] Simpler tablesorter/makeCollapsible call

Change 619601 merged by jenkins-bot:
[mediawiki/core@master] Simpler tablesorter/makeCollapsible call