formfcw / directus-extension-flexible-editor

A rich text editor (WYSIWYG) with JSON output that allows the integration of M2A relations to make it extremely flexible. A truly rich editor for Directus.
https://www.npmjs.com/package/directus-extension-flexible-editor
GNU General Public License v3.0
140 stars 14 forks source link

Deleting an already existing block and then undoing the change shows ID: Value has to be unique #29

Closed JohannesPertl closed 7 months ago

JohannesPertl commented 10 months ago

Describe the bug When deleting a block that was already saved before inside the editor and then undoing the change, the error ID: Value has to be unique is shown. Probably, because it tries to create a new block instead of referencing the old one.

To Reproduce

  1. Create a block in the flexible editor, save the collection item.
  2. Open the collection item, delete the block and undo the change.
  3. Try to save

Flexible Editor Version: [e.g. 1.1.7]

Directus Version: [e.g. 10.8.3]

formfcw commented 9 months ago

Does the bug still occur on your system? I can't reproduce it. Can you give me more information about what kind of block it is?

JohannesPertl commented 7 months ago

It always occurs with any custom block, even on the latest version. Here's a video:

https://github.com/formfcw/directus-extension-flexible-editor/assets/45853628/db816a7d-1384-4dad-a9c7-be0ae3fb3820

formfcw commented 7 months ago

Can you please provide more information on how to reproduce the bug? This could be either your schema created by the directus cli or a step-by-step guide on how to rebuild your collections and blocks.

Maybe you can also share your directus env vars (without sensitive data)?

JohannesPertl commented 7 months ago

@formfcw I created the simplest representation of a project where the bug occurs, the schema is included: https://github.com/JohannesPertl/directus_bug_test/tree/main

formfcw commented 7 months ago

@JohannesPertl 🙏 Thanks for sharing the repo. I can now reproduce the bug. It seems to be a tricky one.

As a not-so-user-friendly workaround: If you manually refresh the page after creating an item, the bug does not appear.

formfcw commented 7 months ago

Will be fixed in v1.4.2. Stay tuned!