Udaya
Udaya

Reputation: 11

CKEditor Paste from word script error

We are using the CKEditor version 4.6 and Paste from word version 4.9.2 while trying to copy and paste from word, we are getting the below script error. Please help to resolve.

We are using the primefaces extension's CKEDitor.

Uncaught TypeError: Cannot read property 'map' of undefined

at getCompareFunction (default.js.xhtml?ln=primefaces-extensions&v=6.1.1:935)

at sort (default.js.xhtml?ln=primefaces-extensions&v=6.1.1:956)

at Object.inline (default.js.xhtml?ln=primefaces-extensions&v=6.1.1:977)

at Object.CKEDITOR.cleanWord (default.js.xhtml?ln=primefaces-extensions&v=6.1.1:57)

at eval (eval at (jquery.js.xhtml?ln=primefaces&v=6.0:14), :997:253)

at l (eval at (jquery.js.xhtml?ln=primefaces&v=6.0:14), :995:294)

at a.eval (eval at (jquery.js.xhtml?ln=primefaces&v=6.0:14), :997:98)

at a.m (eval at (jquery.js.xhtml?ln=primefaces&v=6.0:14), :10:224)

at a.eval (eval at (jquery.js.xhtml?ln=primefaces&v=6.0:14), :12:47)

at a.CKEDITOR.editor.CKEDITOR.editor.fire (eval at (jquery.js.xhtml?ln=primefaces&v=6.0:14), :13:242)

Anyone's help is much appreciated.

Upvotes: 1

Views: 826

Answers (1)

Andrea
Andrea

Reputation: 6123

I just want to report a suggestion (untested); hope this helps.

In the Paste from Word plugin's page, compatibility with CKEditor 4.6 is not specified (it is guaranteed just with 4.9+).

But, reading further:

For CKEditor versions older than 4.6 the following options were available, too:

  • CKEDITOR.config.pasteFromWordNumberedHeadingToList
  • CKEDITOR.config.pasteFromWordRemoveStyles

They both look promising. Basically, they are parameters that need to be specified in your config.js, in the CKEDITOR.editorConfig = function(config) {...} section:

config.pasteFromWordNumberedHeadingToList = true;
config.pasteFromWordRemoveStyles = false;

Hope it could be a good starting point.

Upvotes: 0

Related Questions