Nested Entries: invalid Entry ID in custom plugin
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Reproduce the invalid ID using the linked CKEditor Inline Entries plugin and compare it with the copied files in src/web/assets/ckeditor/src/entries. Trace the saved entry and the generated markup, then verify that the custom element resolves the same entry as .
Written by the indexing model from the issue text.
Description
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.
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
- Install CKEditor Inline Entries (https://github.com/Little-Miss-Robot/craft-ckeditor-inline-entries)
- Add the "New inline entry" button to a CKEditor config
- Add a Entry type to a field with the above CKEditor config
- Create a "new inline entry" via the toolbar
Additional info
- Craft version: Craft 5.2.4.1
- Plugins & versions: CKEditor 4.1.0
- Dominant language
- PHP
- Stars
- 47
- Forks
- 32
- Avg merge
- 3d 20h
- Merged PRs (30d)
- 3
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from craftcms/ckeditor
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
[5.x]: InvalidSubpathException when Default Upload Location uses an object template like {slug}Possibly taken @i-just claimed this 7 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
-
Image Editor reload appends stacking cache timestamp and doesn't reflect edits behind a CDNMay be free again @i-just claimed this 107 days ago, and no pull request is open. Openbug
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 55/100
All issues in craftcms/ckeditor
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
-
sync-en
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
sync-en
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Yoast/wordpress-seo#23658 ·
Maintainers usually reply within 3 days
-
fixed
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
firefly-iii/firefly-iii#12934 · 2 comments ·
Maintainers usually reply within 1 day