Opened 10 years ago

Last modified 10 years ago

#16953 pending Bug

On adding links it fails first time and duplicates text 2nd time

Reported by: chandan Owned by:
Priority: Normal Milestone:
Component: General Version: 4.5.11
Keywords: Cc:

Description

Steps to reproduce

Secenario : I am using ckeditor in inline mode in a angular project. The ckeditor is added using the angular-ckeditor directive (​https://github.com/lemonde/angular-ckeditor) HTML:

<div class="section-editor" ckeditor="options" ng-model="section.content" contenteditable="true" ready="ckeditorOnReady($instance)" ></div>
  1. I select a text (Example towards) and do add link. The popup opens I add my url. On doing OK, Sometimes on first click it does not work and produces an error in console (error attached). On again doing OK it works, but in the ckeditor I see 2 times my text (towards). Once with the right url and once just plain text.

Expected result

The link should be added in first attempt without any error

Actual result

Sometimes the link doesnt get inserted in the first attempt and there is an error in console.

Uncaught TypeError: Cannot read property 'getParent' of undefined
at a (ckeditor.js:formatted:9746)
at CKEDITOR.style.b [as applyToRange] (ckeditor.js:formatted:9776)
at CKEDITOR.style.applyToRange (ckeditor.js:formatted:10258)
at CKEDITOR.dialog.onOk (link.js?t=G87E:formatted:626)
at CKEDITOR.dialog.def.onOk (plugin.js?t=G87E:1467)
at CKEDITOR.dialog.def.onOk (plugin.js?t=G87E:1467)
at CKEDITOR.dialog.def.onOk (plugin.js?t=G87E:1467)
at CKEDITOR.dialog.def.onOk (plugin.js?t=G87E:1467)
at CKEDITOR.dialog.<anonymous> (ckeditor.js:formatted:12035)
at CKEDITOR.dialog.m (ckeditor.js:formatted:136)

Other details (browser, OS, CKEditor version, installed plugins)

It can be reproduced in all the browsers and any OS. We are using Ckeditor verson : 4.5.11 (we tried updating the ckeditor version to 4.6.2 but it didnt fix the error) ==

Attachments (5)

linkDuplicateTexterror.png​ (43.3 KB) - added by chandan 10 years ago.
Duplicate text on clicking ok 2nd time
linkErrorStackTrace.png​ (24.2 KB) - added by chandan 10 years ago.
stack trace in console
LinkPopup.png​ (59.0 KB) - added by chandan 10 years ago.
Adding link :1st time doesnt work on clicking ok, works 2nd time
build-config.js​ (2.1 KB) - added by chandan 10 years ago.
build config file, we add extra plugins manually
CkeditorConfigService.js​ (7.8 KB) - added by chandan 10 years ago.
angular config file for ckeditor settings configuration

Download all attachments as: .zip

Change History (7)

Changed 10 years ago by chandan

Attachment: linkDuplicateTexterror.png​ added

Duplicate text on clicking ok 2nd time

Changed 10 years ago by chandan

Attachment: linkErrorStackTrace.png​ added

stack trace in console

Changed 10 years ago by chandan

Attachment: LinkPopup.png​ added

Adding link :1st time doesnt work on clicking ok, works 2nd time

Changed 10 years ago by chandan

Attachment: build-config.js​ added

build config file, we add extra plugins manually

Changed 10 years ago by chandan

Attachment: CkeditorConfigService.js​ added

angular config file for ckeditor settings configuration

comment:1 Changed 10 years ago by Jakub Ś

Keywords: link removed
Status: new → pending

At first sight It looks like CKEditor is losing selection thus link can't be applied to it. Could you perhaps use ​source version of the editor to see where the error is being thrown exactly?

I can see you are using a couple of third-party plugins. Could you disable all these plugins as well as third-party scripts (which might perhaps be breaking selection in editor when dialog is shown), clear ​browser cache and re-check the problem.
If it doesn’t occur, could you try enabling your plugins and scripts one by one to see when problem pops out. I understand that can take some time but I can't see any other way to approach this especially that problem doesn't occur in default editor.

Are you by any chance able to reproduce this issue in CKEditor set up as standalone folder on your server?

comment:2 Changed 10 years ago by chandan

thanks a lot for replying. I will try to disable the 3 party plugins and see if it helps. Also will use source version to see the origin of the error.

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