Page MenuHomePhabricator

Add a tracking category when the section name given to the #lst parser function does not exist
Closed, ResolvedPublicFeature

Description

Currently, the #lst parser function does not display anything when the section name given to it does not exist. For example {{#lst:My_page|foo}} won't return anything if the "foo" section of the page "My page" does not exist.

It might be nice in this case to auto-categorize the page in a category named something like "Category:Page attempting to transclude not exising section" to allow contributors to check and fix these issues.

First reported on French Wikisource.

Event Timeline

Change 888317 had a related patch set uploaded (by Pppery; author: Pppery):

[mediawiki/extensions/LabeledSectionTransclusion@master] Add tracking category for invalid LST calls

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

Change 888317 merged by jenkins-bot:

[mediawiki/extensions/LabeledSectionTransclusion@master] Add tracking category for invalid LST calls

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

At least one of these $parser->addTrackingCategory("lst-invalid-section-category"); calls is bogus. s:Category:Pages transcluding nonexistent sections is filling up with entries for pages that are quite correctly transcluding a named section. My guess is the last one, but I haven't traced it.

Change 889867 had a related patch set uploaded (by Tpt; author: Tpt):

[mediawiki/extensions/LabeledSectionTransclusion@master] Fixes false integration into the "invalid sections" category

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

Yeah, and sorry from me for not testing my patch well enough.

Change 889867 merged by jenkins-bot:

[mediawiki/extensions/LabeledSectionTransclusion@master] Fixes false integration into the "invalid sections" category

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

Wrt to the patch I've just +2'd:
Before

image.png (190×1 px, 26 KB)

After

image.png (249×1 px, 19 KB)

Wikicode
Transclusion defined as:

{{#lst:2022 Indonesia President's Cup Finals|leg1}}
{{#lst:2022 Indonesia President's Cup Finals|leg2}}

Source of content imported from this enwiki page with "Section 1" and "Section 2" added to distinguish them.

Pppery removed a project: Patch-For-Review.