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
Ask for value when changing nullable to not-nullable #2934
Comments
We should figure out what we expect to happen here. You can't require a column to have a value if you already have rows without a value. Otherwise, your value requirement doesn't pass 🤔 |
@rijkvanzanten based on other CMSs like Contentful, what happens in this situation is that, once you open the items after the field has been changed to requiere, the form automatically detects the missing field and doesn't let the user save it until the new field is filled. If that is something that Directus should allow or not, depends mostly on you, but I think a lot of user would appreciate this behaviour. |
That makes sense @lluishi93, but Directus mirrors the actual database, and therefore uses Perhaps we can warn the admin when trying to set this that we'll have to batch update all existing records with the field default value (which may be an empty string). Would that work @rijkvanzanten ? |
Note to self: To resolve:
|
* Add ContainsNullValues exception abstraction * Add dialog for null values when disabling non-null Fixes #2934 * Add translation for CONTAINS_NULL_VALUE error * Make dialog title translated
Modal remains open and if you close it, required is checked. But if you refresh the page, then required appears unchecked (as if the change has been applied at app-memory level, but not in the database)
Expected behaviour: the user should be able to make a previously created unrequired field required by updating it
EDIT: It seems this happens when you already have created items. I tried to delete the previously created items, then the app allowed me to make that field required. IMHO it should allow to change it anyway.
The text was updated successfully, but these errors were encountered: