Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested Entries: invalid Entry ID in custom plugin #261

Open
ishetnogferre opened this issue Jun 28, 2024 · 0 comments
Open

Nested Entries: invalid Entry ID in custom plugin #261

ishetnogferre opened this issue Jun 28, 2024 · 0 comments
Labels

Comments

@ishetnogferre
Copy link

Description

I'm trying to build a CKEditor plugin that will (try) to make use of the nested entries functionality and to better understand how it works first, I just copied everything over from the entries files: https://github.com/craftcms/ckeditor/tree/4.x/src/web/assets/ckeditor/src/entries

Then changed all the handles to be unique, so they wouldn't conflict with each other. (e.g. changed all CraftEntries to like CraftInlineEntries) (my code is linked below).

Everything works the same as the Nested Entries functionality, I can select the Entry type, edit the fields and save, except something goes wrong after/before the saving of the nested entry in the slideout.

Since I saw some similar issues here #254, I'd though to add one as well, because maybe there is a underlying issue, I tried the corresponding fix (#257) as well, but doesn't solve the case below.


So: I can add an entry via the new toolbar button, the slideout shows then an "Entry saved/created" popup is shown and an ID gets returned. Then the HTML gets added to the ckeditor field, all the same as "New Entry" but with this new plugin, the entry ID shows as invalid whenever added to the CKEditor field.

Screenshot 2024-06-28 at 10 32 29

Also if I click on the entry link in the "Entry created" notification, it also says the element doesn't exist.

I used as HTML output for this new plugin opposed to , now weirdly enough if I go and edit it via the source of the CKEditor field from <craft-inline-entry data-entry-id="698358"> to <craft-entry data-entry-id="698358"> it somehow can find that entry 🤔 I don't really see why this happens, as the rendering of it, is just an entry lookup by ID in both cases?

Steps to reproduce

  1. Install CKEditor Inline Entries (https://github.com/Little-Miss-Robot/craft-ckeditor-inline-entries)
  2. Add the "New inline entry" button to a CKEditor config
  3. Add a Entry type to a field with the above CKEditor config
  4. Create a "new inline entry" via the toolbar

Additional info

  • Craft version: Craft 5.2.4.1
  • Plugins & versions: CKEditor 4.1.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant