Opened 12 years ago
Closed 10 years ago
#10032 closed Bug (fixed)
Paste from Word - forceFromWord flag is not reset
Reported by: | Wiktor Walc | Owned by: | Piotr Jasiun |
---|---|---|---|
Priority: | Normal | Milestone: | CKEditor 4.4.7 |
Component: | Plugin : Paste from Word | Version: | 4.0 Beta |
Keywords: | Cc: |
Description (last modified by )
Steps to reproduce:
- Copy some unstyled text
- Press "Paste from Word" button
- Don't allow clipboard access
- Hit "Cancel" when the dialog window opens
- Press Ctrl + V inside the editing area
- The paste from Word command is executed although there is no reason for that. This can be easily tested by pasting simple alert in filter code.
Change History (9)
comment:1 Changed 12 years ago by
Description: | modified (diff) |
---|
comment:2 Changed 12 years ago by
Status: | new → confirmed |
---|---|
Version: | → 4.0 Beta |
comment:3 Changed 11 years ago by
Component: | General → Plugin : Paste from Word |
---|
comment:4 Changed 10 years ago by
Owner: | set to Piotr Jasiun |
---|---|
Status: | confirmed → assigned |
comment:6 Changed 10 years ago by
Status: | review → review_failed |
---|
Comment out the first tests in the pastefromword file and the new test still fails.
The reason is that if the filter file must be loaded, then forceFromWord must be reset later.
BTW. In the test you should use a custom filter file, which will change the content in a way that you'll be sure that it was it. You base now on a fact that content is changed in a specific way by the default filter and that may change.
comment:7 Changed 10 years ago by
Status: | review_failed → review |
---|
I have updated tests to better cover scenarios. They are a little overcomplicated for the on line change, but they seams to test all cases now.
I also moved reset forceFromWord
to the loadFilterRules
callback, so it will be called after fire( 'paste' )
and work in both cases: if filter have been already loaded or not.
The problem is that because forceFromWord
is cleaned directly after fire( 'paste')
pasteFromWord
command will work only if paste
will be finished synchronously, so no other plugin will do hack similar to this in pasteFromWord
plugin.
Alternatively we could reset forceFromWord
on afterPaste
listener, but in this case, if paste
even will be canceled, forceFromWord
will not be reset.
I choose the first option, because I assume that it is less probable that paste
will work asynchronously than it will be canceled.
By the way, I realized that the hack used in pastefromword
to make paste
works asynchronously is pretty bad, because it fire paste from the very begging with data at current stage of the transformation, what means that every transformation on data, which were executed before the listener in pastefromword
plugin, will be executed twice on the same data.
comment:8 Changed 10 years ago by
Status: | review → review_passed |
---|
"Yes" to every paragraph of your comment :).
comment:9 Changed 10 years ago by
Milestone: | → CKEditor 4.4.7 |
---|---|
Resolution: | → fixed |
Status: | review_passed → closed |
Fixed on master with git:13fd47c.
I was able to reproduce this in every browser in CKEditor 4 only and from CKE 4.x beta.