Page MenuHomePhabricator

Categories should avoid orphans (single entries) when splitting a letter's entries into two columns ("Cont.")
Closed, DuplicatePublic

Description

Author: winfried

Description:
Screenshot of Category:Halmstad

In Category:... pages, in the three-column-tables of members or subcategories, one quite often sees single entries before or after the ''cont.'' E. g., [[Category:Halmstad]] (As my knowledge in PHP and "report generation" is better than my English, I could contribute by looking through the code, if someone points me to the appropriate class)


Version: 1.21.x
Severity: enhancement

Attached:

Category_Halmstad.JPG (374×669 px, 40 KB)

Details

Reference
bz44304

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 1:37 AM
bzimport set Reference to bz44304.
bzimport added a subscriber: Unknown Object (MLST).

Hi Forscher56,
thanks for reporting this.

(In reply to comment #0)

I could contribute by looking through the code, if someone
points me to the appropriate class)

I ran

grep -r "cont\." .

on my MediaWiki core code checkout and the code seems to be located in

/includes/CategoryViewer.php:531

To take a quick online look at the code:
https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/core.git;a=blob;f=includes/CategoryViewer.php;h=7678ffe080c4a2635926731a7ba6803cd622ca6a;hb=refs/heads/master#l531

For information on getting the code and providing patches to fix the problem, see

http://www.mediawiki.org/wiki/Developer_access

If you need any help don't hesitate to ask.

(In reply to comment #0)

Created attachment 11678 [details]
Screenshot of Category:Halmstad

In Category:... pages, in the three-column-tables of members or
subcategories,
one quite often sees single entries before or after the ''cont.'' E. g.,
[[Category:Halmstad]] (As my knowledge in PHP and "report generation" is
better
than my English, I could contribute by looking through the code, if someone
points me to the appropriate class)

As andre said - CategoryVirwer is the class that formats the results. CategoryPage is the calling class.

What currently happens is we fetch the first 201 results (configurable) display first 200 and use the last for the continue link. I imagine you would probably have to fetch 202 results and then decide if to show either 200 or 201 results depending on how the divisions fall.

If you have any trouble or need any help, don't hesitate to ask.

Attached:

Category_Halmstad.JPG (374×669 px, 40 KB)

This has been invalidated by T55130. MediaWiki will now use browser functionality to render categories in multiple columns. As far as I can tell (screenshots on the task) browsers' behavior is much better than MediaWiki's.

(It actually hasn't, the orphans are not avoided, so this is still valid after all.)

To clarify, even if this is the older task, the code responsible for this bug is no longer present since Category view switched to CSS cloumns.