﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
13749	Receive JavaScript errors when inserting Block level Placeholder	Hugh		"== Background ==
I'm trying to customize the Placeholder plugin to simply make it insert a Div instead of a Span.  I am making minimal changes to the Placeholder plugin, and then I see Js errors in console with all ""Insert"" type commands when the editor does not have a visible caret.

== Steps to reproduce ==

1. Minimally customize [https://github.com/ckeditor/ckeditor-dev/blob/release/4.5.x/plugins/placeholder/plugin.js plugins/placeholder/plugin.js] as follows:
* line 39: change the opening and closing tag from a span to a div
* line 72: change to test for dtd.div instead of dtd.span
* line 78: change from span to div
2. Create a textarea with the content of only a placeholder, like this
{{{
<textarea id=""replaceme"">[[sometag]]</textarea>
}}}
3. CKEDITOR.replace(document.getElementById('replaceme'))
4. Load the page and do not touch the editor area (do not set focus to it and make sure you cannot see the caret)
5. Now click any of the toolbar ""Insert"" type commands (not necessarily Placeholder).  Such as Insert Horizontal Line.  or Insert Special Character.
6. Receive one of several Javascript errors in console such as
{{{
Uncaught TypeError: Cannot read property 'hasAscendant' of null
Uncaught TypeError: Cannot read property 'checkReadOnly' of undefined
}}}

== Expected result ==
Expect to be able to change Placeholder plugin minimally from Span container type to Div container type without causing Js errors.

== Actual result ==
Getting errors when changing Placeholder type from span to div.  I have not been able to track it down to anything I'm doing.  When I stop it in the debugger everything looks correct  at the end of the plugin's afterInit when it returns the transformed text.

== Other details (browser, OS, CKEditor version, installed plugins) ==
When I do a fresh install, the plugin works fine (with the default container type of Span).  I do only the changes above, and I get these errors.  I do have the Widget plugin dependency.  And Dialog.  It was built with your download builder today which automatically added the dependencies.
Testing on Google Chrome with version 4.5.3 freshly downloaded today.  Have been trying to work through this for several hours on my own.  Thanks for any help you can provide.
I noticed that in the modified Placeholder plugin if I comment out the entire call to editor.dataProcessor.dataFilter.addRules I do not see the errors anymore (of course my source is not transformed to my desired div's as well).  So I have isolated it to something that is going on there."	Bug	closed	Normal		UI : Widgets		invalid		
