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
Unable to edit or create items for collections with translations #12005
Comments
I have a similar problem. Can't understand, should I open a new issue or not.
2022-03-10.14.37.06.mov
2022-03-10.14.37.51.movI've tried both 9.5.2 and 9.6.0 :( |
Very odd! I'm wondering if that's a bug in the translations interface (which would make it related to this), or a bug in the wysiwyg 🤔 |
I also have this issue and I tried replacing the wysiwyg with a markdown editor on the main objects and then it works fine. |
@rijkvanzanten I did some more testing on this one and got the following "results": Baseline: collection I add a translations interface to
So to me it feels like something is happening client side in the wysiwyg when it tries to set the actual value of the field. Maybe there's a conflict with the field with the same name on the translations relation? |
Maybe related to b3f7bd9 |
I think this whole issue was fixed in #12216. If I revert that merge commit the issue occurs again. |
This has been resolved for me with 9.7.0! |
I can confirm what @onordgren and @maltejur have already said. The issue has been fixed in 9.7.0. It seems by PR #12216 with the last change "Fix incorrect DOM selection of WYSIWYG interface for fields having the same name". |
Preflight Checklist
Describe the Bug
Since v9.5.2 (also in v9.6.0) you cannot edit or create new items for collections that have translations. I tested the issue with WYSIWYG fields, it might also affect other fields.
What happens is that directus preemptively makes a change for translations when entering the item page / creating a new item. This causes the save button the be active immediately upon entering an existing item. The pre-filled change for translations does not have the language ID in the object which causes the PATCH API to return status code 400 (bad request).
chrome_2022-03-07_12-25-43.mp4
When trying to create a new item, the WYSIWYG field says that it is required (it is, but I wrote something in it, so it should save).
chrome_2022-03-07_12-44-21.mp4
The issue happens because both the collection field and the translation field have the same name! That's pretty twisted... When I initially tested it I couldn't reproduce it until I named the WYSIWYG fields in both collections the same.
To Reproduce
NOT NULL
NULL
Now try to create an item. Prepare to cry 😢
When there are existing items you will get the PATCH issue I showed in the first video.
The reasoning behind the main collection field being
NOT NULL
and the translations field allowingNULL
is that the translated fields are optional. We have multiple translatable fields that do not have to be filled out and everything used to work inv9.5.1
. We have downgraded to that version now.Errors Shown
PATCH API shows status code 400.
During creation of new items the WYSIWYG fields complain about being required even though they have a value.
What version of Directus are you using?
9.6.0
What version of Node.js are you using?
16.14.0
What database are you using?
MariaDB 10.3.34
What browser are you using?
Chrome Latest
What operating system are you using?
Windows 10
How are you deploying Directus?
Ubuntu Server 20.04, npm installation with a systemd service running it
The text was updated successfully, but these errors were encountered: