Page MenuHomePhabricator

Patch to make Special:Statistics result rendering consistent with Special:Search
Closed, InvalidPublic

Description

Author: hightowe

Description:
The patch to SpecialStatistics.php v1.12.0 (diff -U3 format)

In a MediaWiki 1.12.0 installation that we run, we have slightly altered (customized) the makeTitle() and secureAndSplit() methods in Title.php, for the purpose of displaying "human titles" to users for computer-generated pages (fully automated name-spaces, really), where the $title->mDbkeyform is a computer-generated key (an index). We have had that code in production for quite a while, and everything seems to work great.

Recently, a user pointed out that links to computer-generated pages were broken in the "Most viewed pages" section of Special:Statistics. We researched the problem and found it to be an issue where SpecialStatistics.php somehow calls Title::makeTitleSafe() twice. It seems not to do that directly, but rather does it once itself, and then Parser does it again. That "double call" is what was breaking our custom "make human titles" code in Title.php. We have looked carefully, and as best we can tell, no other part of MediaWiki 1.12.0 has this problem.

To fix the problem, and to hopefully improve MediaWiki in general, we have recoded a small portion of SpecialStatistics.php, so as to have it render its results in the same way that SpecialSearch.php does. We chose to model our changes after SpecialSearch.php for consistency, so as to not re-invent the wheel, and in hopes that doing so improves the chance of our patch being accepted into the main-line MediaWiki code.

The patch is attached.


Version: 1.12.x
Severity: normal

Attached:

Details

Reference
bz14983

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:12 PM
bzimport set Reference to bz14983.
bzimport added a subscriber: Unknown Object (MLST).

Titles must be round-trippable from human-readable text form back to internal processing. If your customizations have broken this assumption, many places in the wiki where links are generated in wikitext will fail to work.