Bug #67661

RTE: copy and paste within RTE leads twice content input

Added by d.ros no-lastname-given over 6 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Must have
Category:
RTE (rtehtmlarea + ckeditor)
Target version:
-
Start date:
2015-06-21
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
5.5
Tags:
Complexity:
Is Regression:
No
Sprint Focus:
On Location Sprint

Description

Running on commit 0d0b502adcdc6517cbc22dc05c49d14fc95618bb

  • also appears on 6.2.13 && 6.2.12
  • does not appear in 6.2.11

Way to reproduce

  • open RTE
  • input some text
  • copy with [CTRL]+[C]
  • paste with [CTRL]+[V]

Copied content is inserted twice. Happens in Chrome and FF on Linux.


Related issues

Is duplicate of TYPO3 Core - Bug #67503: [RTE] [onlyChrome] Paste double with and without structure if "Disable Paste Structure" is enabledClosedStanislas Rolland2015-03-12

Actions
#1

Updated by d.ros no-lastname-given over 6 years ago

  • Assignee set to Stanislas Rolland

@stanislasrolland

could you have a look on this -> 3d95bf2a44100665be2e25a97e86ab0c03c785b8 ? I assume the commit is causing this issue.

https://git.typo3.org/Packages/TYPO3.CMS.git/blobdiff/0671b4ca5e6ec661e0d0c0ccd0e46888f2fcbd9d..3d95bf2a44100665be2e25a97e86ab0c03c785b8:/typo3/sysext/rtehtmlarea/htmlarea/plugins/PlainText/plain-text.js

Here Chrome 43.0.2357.125 (64-bit) is running.

Can you confirm/refuse?

#2

Updated by d.ros no-lastname-given over 6 years ago

This is still true on 6.2.14

Cheers

#3

Updated by d.ros no-lastname-given over 6 years ago

I broke down everything to find out what is causing this.

IF

RTE.default.buttons.pastetoggle.setActiveOnRteOpen = 1

is set. then this behaviour occours. It doesn't matter if

setup.default.rteCleanPasteBehaviour = pasteStructure

or

setup.default.rteCleanPasteBehaviour = plainText

is set.

Also disabeling the Button by hand ends this behaviour. And enabeling the button manually activates this behaviour.

#4

Updated by Riccardo De Contardi about 6 years ago

  • Status changed from New to Needs Feedback

I've tried with Chrome on MAC (latest version) on both 6.2.15 and 7 (latest master) and was not able to reproduce it:

on my TSConfig I've set:

RTE.default.showButtons = *
RTE.default.buttons.pastetoggle.setActiveOnRteOpen = 1

using ctrl+c ctrl+v the behavior seems correct.
Should I perform some different test?

#5

Updated by Riccardo De Contardi about 6 years ago

  • Status changed from Needs Feedback to Closed

sorry closed for error

#6

Updated by Riccardo De Contardi about 6 years ago

  • Status changed from Closed to Needs Feedback
#7

Updated by Tanel Põld almost 6 years ago

I do get the double paste error with Chrome. Plain text first and formatted following it. Version 47 OS X
Safari pastes plain text only even thou it should paste formatted version only.

Firefox works as it should.

TYPO3 7.6.2

#8

Updated by Robert Wolle almost 6 years ago

I have the same Problem copying text from a document and pasting it in RTE with following configuration:

- Updated the system from 6.2.10 (in this version it worked) to 6.2.19
- pagets:

RTE {
    default {
        buttons.pastetoggle.setActiveOnRteOpen = 1
        buttons.pastebehaviour.pasteStructure.keepTags = br,p,ul,ol,li
        buttons.pastebehaviour.pasteFormat.keepTags = br,p,ul,ol,li
    }
}

- userts:

setup.override.rteCleanPasteBehaviour = pasteFormat

- Browser: Google Chrome: Version 48.0.2564.116 m
- Clientsystem: Windows 7

If I set the rteCleanPasteBehaviour to plainText everything works fine. The problem only occures if I use pasteStructure or pasteFormat.

This is what I want to copy:

test1
test2

This happens after pasting:

test1
test2test1<br />test2

It seems that it gives back the original plain string too.

#9

Updated by Riccardo De Contardi over 5 years ago

I can confirm it on TYPO3 6.2.25, but it seems that the bug has been solved on 7.6.9 or the latest master.
Can someone confirm? Thanks

#10

Updated by Sven Ignor over 5 years ago

In 7.6.10 it is still there

#11

Updated by Rafal Brzeski over 5 years ago

confirm this on TYPO3 7.6.10

#12

Updated by Riccardo De Contardi over 5 years ago

  • Status changed from Needs Feedback to New
#13

Updated by Stefan Froemken over 5 years ago

  • Status changed from New to Accepted

It works in Firefox only for default elements like in HTML. But if you copy Text from OpenOffice/LibreOffice it will add some CSS as PlainText above.

I though it has something to do with a mixture of DefaultCleanUp- and PlainText-Plugin. Both create an event on paste and will create dynamic Textfields to insert the pasted content. I have deactivated DefaultCleanUp-Plugin completely in ext_localconf.php, but this problem still appears.

#14

Updated by Stefan Froemken over 5 years ago

That part looks a little but ugly:

while (i < contentTypes.length) {
  contentType = contentTypes[i];
  if (/text\/plain|text\/html/.test(contentType)) {
    clipboardText += clipboardData.getData(contentType);
  }
  i++;
}

I have just copied your example with test1 and test2, and Chrome results in TWO ClipBoards text/plain and text/html. Both are valid, so both were pasted into the RTE

#15

Updated by Gerrit Code Review over 5 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/49871

#16

Updated by Gerrit Code Review over 5 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/49871

#17

Updated by Gerrit Code Review about 5 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/49871

#18

Updated by Gerrit Code Review about 5 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/49871

#19

Updated by Jan Helke about 5 years ago

  • Sprint Focus set to On Location Sprint
#20

Updated by Tymoteusz Motylewski about 5 years ago

I could reproduce the issue with configuration from comment 8 and additionally adding

RTE.default.showButtons = *

#21

Updated by Gerrit Code Review about 5 years ago

Patch set 1 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/50343

#22

Updated by Stefan Froemken about 5 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
#23

Updated by Torsten no-lastname-given over 4 years ago

I still run into this problem in 6.2.30 tested with Firefox 52.0.1

#24

Updated by Benni Mack about 3 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF