Context
We need to be able to find the right citation command for opening the CitationDialog when editing sub-refs and their main content. Currently the main node is used to achieve that. With the main node gone in some cases, we need to find a way to connect the existing commands with the InternalItem of the main content.
Background
In ve.ui.MWReference.init.js the commands will be build add-hoc for the configured citation tool templates. The name of the template that should be loaded is weird here and used to setup the right parameters when opening the CitationDialog.
Solution
We could try to identify the existing tools and iterate over the template names to get to the fitting command for a template inside of an InterntalItem.
Next steps
- Add a method to the helper in https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Cite/+/1261517 that can iterate over the tools and checks of one of the templates configured fits with content. Then use the name to find the command.