craftcms / ckeditor

Edit rich text content in Craft CMS using CKEditor.
https://plugins.craftcms.com/ckeditor
GNU General Public License v3.0
46 stars 23 forks source link

Nested entries within CKEditor fields sometimes fail to copy to other enabled sites #254

Closed gregorterrill closed 3 weeks ago

gregorterrill commented 2 months ago

Description

Two separate but related issues:

  1. Nested entries within CKEditor fields on entries in an existing section sometimes fail to copy over when that section is enabled for a new site. Only the text value of the field comes over, and the nested entries get stripped out.
  2. Copy/pasting all content (including nested entries) from one CKEditor field to another (either another entry in the same language or the same entry in another language) often fails due to "Invalid entry ID" errors about the nested entries. Sometimes it works as expected and copies the nested entries over though, so it's inconsistent.

Steps to reproduce

  1. Create two sites with different languages.
  2. Create a new section, enabled for the primary site only. Propagation method is "Save entries to all sites enabled for this section"
  3. Create a CKEditor field (set to "Translate for each language") and add it to an entry type in that section. Allow this field to insert entries
  4. Populate some content in that section with nested entries within CKEditor.
  5. Enable the section for a second site.
  6. Wait for the entries to propagate to the second site.
  7. Look in the entry content for that second site - the CKEditor text content may have copied over, but not the nested entries (sometimes, this doesn't always happen).
  8. Switch to the first site and select all > copy the content of the field (including nested entries).
  9. Switch to the second site and attempt to paste. You should see invalid entry ID errors for each of the nested entries:

Screenshot 2024-06-18 at 9 36 46 AM

Sometimes they appear like this, and then the block will disappear after saving:

Screenshot 2024-06-18 at 10 36 20 AM

Additional info

i-just commented 2 months ago

Hi, thanks for reporting and for a clear description! They are two separate issues, indeed. I raised a PR for them.

brandonkelly commented 3 weeks ago

CKEditor 4.2.0 is out with those fixes. Thanks again!