Page MenuHomePhabricator

VisualEditor: Editing a pasted template alters copy buffer. Displayed result differs from saved result.
Closed, ResolvedPublic


Mike Christie at en.wp reports that when performing the sequence:

  1. copy template,
  2. paste template,
  3. edit parameter of pasted template,
  4. paste template

Step 4 pastes the template with the parameter values added in step 3 not the original ones.

"To reproduce:

1 Edit [[User:Mike Christie/Sandbox3]] in VE.
2 Select the 13 C (produced with {{chem|13|C}} ) in the middle using the mouse; make sure to select some text on either side, since pasting a template doesn't work unless it's embedded in a string. The colons are there to make it easy to be sure you've got some text in addition to the template.
3 Copy the selected text and then paste it at the end of the sentence.
4 Click on the pasted template, click on the jigsaw piece, and change the 13 in parameter 1 to a 15. Apply changes.
5 Now paste again at the end of the sentence. You'll see that the pasted template contains a 15, not a 13; so the copy/paste buffer was modified by the edit to the pasted template."

Another test case using a different template:

  1. Edit in VE
  2. select "tlp: {{tlp|as of|1999}} :" and copy it to the clipboard
  3. paste the template elsewhere.
  4. edit the template you have just pasted (change parameter 2 to 2013) and apply the changes.
  5. paste the template again.

Expected result: tlp: {{tlp|as of|1999}} :
Actual result: tlp: {{tlp|as of|2013}} :

Interestingly, pasting into a text editor gives the 1999 value as originally copied, not the 2013 value you get pasting into VE.

Version: unspecified
Severity: major
See Also:



Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 2:03 AM
bzimport set Reference to bz52271.

Mike Christie comments further:
What is saved is not always what you see on screen.

To reproduce in a sandbox:

Add a template such as {{chem}}; I used 14C, created by {{chem|14|C}}. Put some text on either side of it so you can copy/paste it with text, since templates won't copy/paste successfully by themselves.

Save that page, and edit again.

Now copy the template and paste it twice, so you have something like this:

  • 14C -- -- 14C -- -- 14C --

Now edit the first pasted one -- the middle one in the example above -- so that it changes a parameter:

  • 14C -- -- 12C -- -- 14C --

Paste again; the pasted version will be 12C, which is bug 52271.

a) I've seen two different behaviours for the next step. One is that you'll now see this:

  • 14C -- -- 12C -- -- 14C -- -- 12C --

but when you save the third one will be a 12 -- that is, it will have changed what you see on screen to be different in the saved file.

b) The other behaviour I've seen is that after the final paste, all four of the templates show "12", not "14".

This appears to be fixed in master.

(In reply to comment #2)

This appears to be fixed in master.

Confirmed - fixed in master, broken in wmf15. Marking as such.