Opened 15 years ago

Closed 15 years ago

#8634 closed Bug (fixed)

The editor.execCommand('cut') returns true instead of false, on IE

Reported by: hel Owned by: Jakub Ś
Priority: Normal Milestone: CKEditor 3.6.3
Component: Core : Pasting Version: 3.4.2
Keywords: Cc:

Description

Whilst trying to make use of the existing 'cut' command, within the clipboard plugin, I encountered a problem where editor.execCommand('cut') was always returning true on IE, even though browser settings prevented automatic execution of cut/copy operations.

Delving a bit deeper, it looks like execIECommand() in the plugins/clipboard/plugin.js returns 0 or 1 which is eventually compared to false (using the !== operator) in core/command.js, line 52. Modifying execIECommand() to set enabled to false or true (instead of 0 or 1) seems to resolve the problem.

Attachments (1)

8634.patch​ (507 bytes) - added by Jakub Ś 15 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 15 years ago by Jakub Ś

Status: new → confirmed
Version: 3.6.2 → 3.4.2

REproducible from CKEditor 3.4.2 rev [5949]

Changing false/true

var	enabled = false;
var onExec = function()
{
	enabled = true;
};

to 0/1

var	enabled = 0;
var onExec = function()
{
	enabled = 1;
};

resulted in constant true being returned when comparing it to:

return ( commandDefinition.exec.call( this, editor, data ) !== false );

comment:2 Changed 15 years ago by Jakub Ś

Owner: set to Jakub Ś
Status: confirmed → assigned

Changed 15 years ago by Jakub Ś

Attachment: 8634.patch​ added

comment:3 Changed 15 years ago by Jakub Ś

Status: assigned → review

comment:4 Changed 15 years ago by Frederico Caldeira Knabben

Component: General → Core : Pasting
Milestone: → CKEditor 3.6.3
Status: review → review_passed

Very tricky finding... well done ;)

comment:5 Changed 15 years ago by Jakub Ś

Resolution: → fixed
Status: review_passed → closed

Fixed with [7385]

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