﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
16953	On adding links it fails first time and duplicates text 2nd time	chandan		"== 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)
==
"	Bug	pending	Normal		General	4.5.11			
