Page MenuHomePhabricator

Impossible to copypaste a specific template across windows
Closed, ResolvedPublicBUG REPORT

Description

Steps to Reproduce:

  1. Open a sample page with "Portály" template on cswiki (eg. Fritz Wolfgang London).
  2. Select the template at the bottom of the page and copy it (Ctrl+C).
  3. Open a random page for editing.
  4. Paste the template (Ctrl+V).

Actual Results:

  • Nothing is pasted, possibly an empty line.

Expected Results:

  • The template is pasted with all its parameters.

This issue is specific to this template.

Event Timeline

This happens because the template HTML starts with a <style> node (generated by TemplateStyles). When copying a template, VisualEditor stores some metadata on the first node (e.g. the name of the template). But when pasting, we remove all <style> nodes (due to T185532), which means that this node is lost and as a result we lose the entire template.

Change 523802 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/extensions/VisualEditor@master] ve.dm.MWTransclusionNode: Protect <style> nodes too when copying

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

Change 523802 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] ve.dm.MWTransclusionNode: Protect <style> nodes too when copying

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

ppelberg claimed this task.