Opened 3 years ago

#16879 new Bug

Creating a fakeElement with attributes doesn't work anymore (attributes are removed)

Reported by: vosmanz Owned by:
Priority: Normal Milestone:
Component: General Version: 4.6.2
Keywords: Cc:

Description

I have a plugin that creates a div with some attributes as a fakeElement. The content of this div is only an ID. With the combination of the attributes and the ID I can later retreive dynamic contents from the database and replace the div-element. This plugin used to work, but after updating CKEditor from 4.5.7 to stable (4.6.2) it stopped working. After the update, it only inserts a div element with the ID as content. So all attributes are removed.

Steps to reproduce

  1. Unzip CKEditor
  2. Unzip the attached plugin to ckeditor/plugins/gadget folder
  3. In config.js:
  • Disable content filter: config.allowedContent = true;
  • Add 'gadget' to config.plugins
  • Create a toolbar: config.toolbar = [ { name: 'Gadget', items: [ 'Source', 'gadget' ] } ];
  1. Open the ckeditor/samples/ page in the browser
  2. Empty the content of the editor
  3. Click the 'Add gadget' button in the toolbar (blue gear)
  4. Type something in the textarea and click OK
  5. Click the Source button in the toolbar

Expected result

In CKEditor 4.5.7, the HTML code includes a div with attributes: <div class="gadgetPlugin tab-htmlcode" height="80" title="Gadget" width="80">1</div>

Actual result

In CKEditor 4.6.2, the HTML code includes a div without attributes: <div>1</div>

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

  • Tested in Windows 10 PRO x64 (dutch), IE11
  • Note that the plugin is a stripped version of the actual plugin, to demonstrate the problem only. The actual plugin retreives dynamic content of our server using Ajax, this version only uses some static content and has a lot of options and tabs removed.

Attachments (1)

gadget.zip (5.2 KB) - added by vosmanz 3 years ago.
Demo plugin

Download all attachments as: .zip

Change History (1)

Changed 3 years ago by vosmanz

Attachment: gadget.zip added

Demo plugin

Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy