Opened 12 years ago

Closed 12 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 Ś 12 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 12 years ago by Jakub Ś

Status: newconfirmed
Version: 3.6.23.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 12 years ago by Jakub Ś

Owner: set to Jakub Ś
Status: confirmedassigned

Changed 12 years ago by Jakub Ś

Attachment: 8634.patch added

comment:3 Changed 12 years ago by Jakub Ś

Status: assignedreview

comment:4 Changed 12 years ago by Frederico Caldeira Knabben

Component: GeneralCore : Pasting
Milestone: CKEditor 3.6.3
Status: reviewreview_passed

Very tricky finding... well done ;)

comment:5 Changed 12 years ago by Jakub Ś

Resolution: fixed
Status: review_passedclosed

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