Last modified: 2013-09-03 22:40:30 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T54271, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 52271 - VisualEditor: Editing a pasted template alters copy buffer. Displayed result differs from saved result.
VisualEditor: Editing a pasted template alters copy buffer. Displayed result ...
Product: VisualEditor
Classification: Unclassified
ContentEditable (Other open bugs)
All All
: High major
: VE-deploy-2013-09-05
Assigned To: Ed Sanders
Depends on:
Blocks: ve-richpaste
  Show dependency treegraph
Reported: 2013-07-30 12:21 UTC by Chris McKenna
Modified: 2013-09-03 22:40 UTC (History)
6 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Description Chris McKenna 2013-07-30 12:21:13 UTC
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.
Comment 1 Chris McKenna 2013-08-09 10:20:44 UTC
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".
Comment 2 Ed Sanders 2013-09-03 18:23:43 UTC
This appears to be fixed in master.
Comment 3 James Forrester 2013-09-03 22:40:30 UTC
(In reply to comment #2)
> This appears to be fixed in master.

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

Note You need to log in before you can comment on or make changes to this bug.