Opened 5 years ago

Closed 5 years ago

#7304 closed Bug (fixed)

Paste from Word: cleanWord not invoked for the first time

Reported by: wwalc Owned by: garry.yao
Priority: Normal Milestone: CKEditor 3.5.3
Component: Core : Pasting Version: 3.1
Keywords: Firefox Cc: kagupta@…, satya_minnekanti@…

Description

When using the "Paste from Word" button to paste content, the CKEDITOR.cleanWord function is not executed for the first time. Confirmed in Safari, Opera and Chrome.

Steps to reproduce

  1. Replace the default filter with:
    CKEDITOR.cleanWord = function( data, editor )
    {
    	alert("clean word called");
    	return 'xyz';
    }
    
  2. Open _samples/replacebyclass.html in Safari.
  3. Copy something, but not from Word, e.g. a part of the default text in the editor.
  4. Paste it using the "Paste from Word" button.
  5. Result: the alert message "clean word called" did not show up.
  6. Repeats steps 3-5. The alert message now showed up.

Attachments (4)

7304.patch (1.7 KB) - added by garry.yao 5 years ago.
7304_2.patch (1.8 KB) - added by garry.yao 5 years ago.
7304_3.patch (2.0 KB) - added by garry.yao 5 years ago.
7304_4.patch (2.1 KB) - added by garry.yao 5 years ago.

Download all attachments as: .zip

Change History (20)

comment:1 Changed 5 years ago by wwalc

  • Status changed from new to confirmed

I think the following ticket might be related: #5808.

Changed 5 years ago by garry.yao

comment:2 Changed 5 years ago by garry.yao

  • Owner set to garry.yao
  • Status changed from confirmed to review
  • Version set to 3.1

Dialog (paste word) open doesn't always force the cleanup, not a regression though.

comment:3 Changed 5 years ago by satya

  • Cc satya_minnekanti@… added

comment:4 Changed 5 years ago by wwalc

  • Milestone set to CKEditor 3.5.3

comment:5 Changed 5 years ago by fredck

  • Status changed from review to review_failed

I'm not able to reproduce the problem with IE, Safari and Opera. It works exactly as expected.

Something is really wrong here with FF.

Having the custom cleanWord() defined in the page, with FF:

  1. Click the "Paste from Word" button. The alert() message is displayed and "xyz" is inserted into the editor contents (Issue 1).
  2. Paste something in the dialog and confirm. The alert() message is displayed again and "xyz" is inserted in the editor. This is expected.

Then after patch, always with FF, things get worst. While the above issue 1 still happens, the expected point 2 is not happening. No alert() and the original paste contents are inserted in the editor (Issue 2).

comment:6 Changed 5 years ago by wwalc

As it looks like things are a bit messed up here, it might be worth to check also #6465 while working on this ticket, perhaps it is related.

comment:7 Changed 5 years ago by garry.yao

  • Status changed from review_failed to review

Sorry not mentioned that this ticket depends on #7316 and thanks Wiktor it's not related to #6465.

comment:8 Changed 5 years ago by Saare

I'm not able to reproduce the issue, any clues?

comment:9 Changed 5 years ago by garry.yao

  • Keywords Firefox added

Firefox + Paste Word button.

comment:10 Changed 5 years ago by wwalc

  • Status changed from review to review_failed

With this patch I'm still able to reproduce this issue in IE6 with "Security Settings" set to "Allow paste operations via script".

Changed 5 years ago by garry.yao

comment:11 Changed 5 years ago by garry.yao

  • Status changed from review_failed to review

Wiktor just caught a small logic glitch in the patch with IE6.

comment:12 Changed 5 years ago by wwalc

  • Status changed from review to review_failed

IE8, IE8 Standards mode. "Allow Programmatic clipboard access" set to Disabled. After pressing "Paste From Word" button, the cleanWord function is immediately executed, just like in comment:5

Changed 5 years ago by garry.yao

comment:13 Changed 5 years ago by garry.yao

  • Status changed from review_failed to review

Changed 5 years ago by garry.yao

comment:14 Changed 5 years ago by wwalc

The last patch looks good to me, I am unable to find any issues.

comment:15 Changed 5 years ago by Saare

  • Status changed from review to review_passed

comment:16 Changed 5 years ago by garry.yao

  • Resolution set to fixed
  • Status changed from review_passed to closed

Fixed with [6606].

Note: See TracTickets for help on using tickets.
© 2003 – 2016 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy