digital-cowboy-91 / directus-extensions-dcb-tree-view-bundle

11 stars 1 forks source link

Error when validating field [slug_is_key] #2

Open DomZ3DF opened 4 weeks ago

DomZ3DF commented 4 weeks ago

Hey,

I followed your tutorial on a clean directus V11.0.2 installation to check out your extension.

In my collection "pages" I let the extension create the pages_meta table and linked it. After that, I also chose the field "Title" to be used to slugify.

Unfortunately I always receive the error message "Error when validating field [slug_is_key]" in the console.

image

image

image

image

What is the problem here?

Thank you! Best regards Dominik

digital-cowboy-91 commented 4 weeks ago

Hi @DomZ3DF , could you please send me the message from the console as well?

digital-cowboy-91 commented 4 weeks ago

I just tested this extension in v11.0.2 and I can replicate the issue. There seems to be a bug in Directus .If I try to create toggle field manually I cannot preset its value or force values not being null. To fix this I recommend to upgrade Directus to v 11.1.0. If you decide to go this way, let me know this suggestion works for you, I'll update docs subsequently.

DomZ3DF commented 4 weeks ago

I just updated to 11.1.0 but still have the same problem. If I choose the right table, it wont load.

image

Btw: the datasets in pages_meta look empty image image

image

Tell me if you need anything else. Thank you.

digital-cowboy-91 commented 4 weeks ago

Did you use the collection previously created in v11.0.2 or this is a brand new one?

DomZ3DF commented 4 weeks ago

I deleted it and created a new pages_meta. Pages is still the same.

digital-cowboy-91 commented 4 weeks ago

What database are you using?

DomZ3DF commented 4 weeks ago

Percona 8.0 MySQL

digital-cowboy-91 commented 4 weeks ago

Would you be able to replicate your steps on SQLite (Directs default) or PostgreSQL, please? Yesterday , I tested this extension on PostgreSQL

digital-cowboy-91 commented 4 weeks ago

Also I just had a minute to take a look on your screenshots. The issue is different this time, which is good. Now it seems to complain about rel_item. If this is your testing database, remove please both collections and recreate pages with ID as UUID.

Edit: you don't have to remove your main collection of you don't want to, you can create a new one just for this test.

DomZ3DF commented 4 weeks ago

I can set it up later with SQLite or Postgre.

I created pages with a UUID and let your extension create the pages_meta table, but still the same error message like in the images before.

digital-cowboy-91 commented 4 weeks ago

Thanks, at least the issue is consistent. I'll try to spin up container with MySQL later today

digital-cowboy-91 commented 4 weeks ago

Hi, I just want to let you know, I was able to replicate the issue in Percona v8.0. Currently I can't give you an estimate when the fix will come. I will have time to look at this issue probably this weekend. Till then, I recommend you to use Postgres or SQLite (unless you will be able to replicate the issue there as well of course).

Update: This behaviour seems to be a bug in Directus https://github.com/directus/directus/issues/22855 , hence I will not be proceeding with a fix yet