Page MenuHomePhabricator

Add a method to create autonames from citation template content (M)
Closed, ResolvedPublic

Description

Context

We want to enable the community to influence how autonames are created based on the content of citation templates if used in a reference. This is a first step to add the basic functionality to the code.

Implementation
  • Add a new feature flag to hide the functionality of increment 2 --> we decided to put increment 2 behind the same feature flag as increment 1 wgCiteCitationTypeAutoNames
  • Add a new method to ve.dm.MWReferenceKeyGenerator
  • It takes at least the InternalItemNode of the reference and the name of the autoname template as input
  • Default to a hard code template name for now ( e.g. Template:Autoname )
  • Clones and manipulates the TransclusionNode inside of the InternalItemNode to render the autoname template with the original parameters as in https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Cite/+/1329635
  • Add QUnit tests for the method
  • Mock the InternalItemNode structure to tests what happens if the internal structures are / or are not as expected
  • Mock the ve.ui.MWPreviewElement to test what happens if the Preview returns issues / or no issues ( e.g. if the autoname template does not exist )
  • Call method hidden behind the new feature flag in generateName
  • Adapt existing tests to reflect the new autonames

Event Timeline

MareikeHeuerWMDE renamed this task from Add a method to create autonames from citation template content to Add a method to create autonames from citation template content (M).Aug 31 2026, 9:16 AM

Change #1337920 had a related patch set uploaded (by WMDE-Fisch; author: WMDE-Fisch):

[mediawiki/extensions/Cite@master] Streamline citation tool detection from internal items

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

Change #1338262 had a related patch set uploaded (by WMDE-Fisch; author: WMDE-Fisch):

[mediawiki/extensions/Cite@master] Reorder how the autoname prefix is build

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

Change #1338265 had a related patch set uploaded (by WMDE-Fisch; author: WMDE-Fisch):

[mediawiki/extensions/Cite@master] Add method to generate autoname from template content

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

Change #1342211 had a related patch set uploaded (by WMDE-Fisch; author: WMDE-Fisch):

[mediawiki/extensions/Cite@master] WIP: Render autoname prefix on edit/save in CitationDialog

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

Change #1342228 had a related patch set uploaded (by WMDE-Fisch; author: WMDE-Fisch):

[VisualEditor/VisualEditor@master] getUniqueListKey to return new names for a listKey when the prefix changed

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

Change #1337920 merged by jenkins-bot:

[mediawiki/extensions/Cite@master] Streamline citation template detection in InternalItems

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

Change #1338262 merged by jenkins-bot:

[mediawiki/extensions/Cite@master] Reorder how the autoname prefix is build

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

Change #1342251 had a related patch set uploaded (by WMDE-Fisch; author: WMDE-Fisch):

[mediawiki/extensions/Cite@master] generateName: return early when no reuse/sub-ref

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

Change #1342251 merged by jenkins-bot:

[mediawiki/extensions/Cite@master] generateName: return early when no reuse/sub-ref

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

Change #1342211 abandoned by WMDE-Fisch:

[mediawiki/extensions/Cite@master] WIP: Render autoname prefix on edit/save in CitationDialog

Reason:

merged into I7e68ed4163a3f5ad6f4491c4f6a0c5d4ead460a7

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

Change #1342972 had a related patch set uploaded (by WMDE-Fisch; author: WMDE-Fisch):

[mediawiki/extensions/VisualEditor@master] Add helper methods for single template transclusions

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

Change #1342228 merged by jenkins-bot:

[VisualEditor/VisualEditor@master] getUniqueListKey to return new names for a listKey when the prefix changed

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

Change #1343015 had a related patch set uploaded (by WMDE-Fisch; author: WMDE-Fisch):

[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (1777e5a31)

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

Change #1343015 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (1777e5a31)

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

Test wiki created on Patch demo by Christoph Jauera (WMDE) using patch(es) linked to this task:
https://71ba5846f0.catalyst.wmcloud.org/w/

Test wiki on Patch demo by Christoph Jauera (WMDE) using patch(es) linked to this task was deleted by Christoph Jauera (WMDE) via DeleteWikis-SingleDelete:

https://71ba5846f0.catalyst.wmcloud.org/w/

Change #1343199 had a related patch set uploaded (by Gabriel Birke; author: WMDE-Fisch):

[mediawiki/extensions/Cite@master] Use async/await in MWCitationDialog.getActionProcess

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

Change #1343199 merged by jenkins-bot:

[mediawiki/extensions/Cite@master] Use async/await in MWCitationDialog.getActionProcess

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

Change #1342972 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Add helper methods for single template transclusions

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

Change #1338265 merged by jenkins-bot:

[mediawiki/extensions/Cite@master] Add method to generate autoname from template content

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