Page MenuHomePhabricator

Avoid template card showing an empty name when template definition is missing
Closed, ResolvedPublic

Description

Related to template support in Section Translation, a case was identified in T304293#8031763 where the template card does not show the name of the source template:

Screen Shot 2022-06-27 at 10.33.57 PM.png (859×440 px, 189 KB)

This is something that happens in some (relatively rare) cases, where the source templates miss a template definition. In this specific case for example, although the source template has an "about" attribute and thus is recognized as a block template by our code, it doesn't hold any template definition (no "mw" data attribute) and the source template name is not available. This is the reason why it's not displayed in the screenshot.

This ticket proposes to support better these cases by either (a) extracting the correct template name, or (b) use a generic "Template" placeholder text when that is not possible.

Event Timeline

Change 931502 had a related patch set uploaded (by Wangombe; author: Wangombe):

[mediawiki/extensions/ContentTranslation@master] SX: Show placeholder text on BlockTemplateAdaptationCard

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

Wangombe changed the task status from Open to In Progress.Jun 20 2023, 8:12 AM
Wangombe claimed this task.

Change 931502 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] SX: Show placeholder text on BlockTemplateAdaptationCard

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

Test Status : QA PASS

@Wangombe I close this ticket but still want to confirm that the "Distinguish" text is part of the generic "Template" placeholder text ?

Screenshot 2023-08-01 at 11.29.42 PM.png (792×541 px, 213 KB)