Opened 13 years ago

Closed 13 years ago

#7304 closed Bug (fixed)

Paste from Word: cleanWord not invoked for the first time

Reported by: Wiktor Walc 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 13 years ago.
7304_2.patch (1.8 KB) - added by Garry Yao 13 years ago.
7304_3.patch (2.0 KB) - added by Garry Yao 13 years ago.
7304_4.patch (2.1 KB) - added by Garry Yao 13 years ago.

Download all attachments as: .zip

Change History (20)

comment:1 Changed 13 years ago by Wiktor Walc

Status: newconfirmed

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

Changed 13 years ago by Garry Yao

Attachment: 7304.patch added

comment:2 Changed 13 years ago by Garry Yao

Owner: set to Garry Yao
Status: confirmedreview
Version: 3.1

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

comment:3 Changed 13 years ago by Satya Minnekanti

Cc: satya_minnekanti@… added

comment:4 Changed 13 years ago by Wiktor Walc

Milestone: CKEditor 3.5.3

comment:5 Changed 13 years ago by Frederico Caldeira Knabben

Status: reviewreview_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 13 years ago by Wiktor Walc

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 13 years ago by Garry Yao

Status: review_failedreview

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

comment:8 Changed 13 years ago by Sa'ar Zac Elias

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

comment:9 Changed 13 years ago by Garry Yao

Keywords: Firefox added

Firefox + Paste Word button.

comment:10 Changed 13 years ago by Wiktor Walc

Status: reviewreview_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 13 years ago by Garry Yao

Attachment: 7304_2.patch added

comment:11 Changed 13 years ago by Garry Yao

Status: review_failedreview

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

comment:12 Changed 13 years ago by Wiktor Walc

Status: reviewreview_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 13 years ago by Garry Yao

Attachment: 7304_3.patch added

comment:13 Changed 13 years ago by Garry Yao

Status: review_failedreview

Changed 13 years ago by Garry Yao

Attachment: 7304_4.patch added

comment:14 Changed 13 years ago by Wiktor Walc

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

comment:15 Changed 13 years ago by Sa'ar Zac Elias

Status: reviewreview_passed

comment:16 Changed 13 years ago by Garry Yao

Resolution: fixed
Status: review_passedclosed

Fixed with [6606].

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy