V8-archive: Bug with datetime_created and datetime_updated interfaces

Created on 26 Sep 2019  路  5Comments  路  Source: directus/v8-archive

The datetime_created and datetime_updated interfaces are not behavior as expected.

It appears that when either interface is 'required' the user receives an error during record creation, saying the datetime_created (or datetime_updated) field can't be blank. If you turn off 'required' then the record saves, but the timestamps remain null.

This happens on both my local instance as well as the demo instance at https://directus.app.

Also I imagine that ideally, the user should not be able to decide whether these interfaces are required or not (since if the field exists the assumption is it should always be set).

bug

All 5 comments

Is seems like there's an issue in API which culprit for this. So transferring it to API.

It appears that when either interface is 'required' the user receives an error during record creation, saying the datetime_created (or datetime_updated) field can't be blank.

https://github.com/directus/api/pull/1322 will resolve this issue.

If you turn off 'required' then the record saves, but the timestamps remain null.

Can you please make sure that you have a single Date Created field? As it is working as expected for a single field and the case which you have mentioned is only occurring if you have a multiple Date Created field. In real-world it's not necessary to have a multiple Date Created field. So just confirm that do you have a single/multiple field!

ok I see, so required should always be false, and should only have one date created or date updated field per table

should probably control that at the app level somehow because it's easy to trip on this one, either way my issue is solved for now, thanks

Thank you @bjgajjar :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

HashemKhalifa picture HashemKhalifa  路  3Comments

binary-koan picture binary-koan  路  3Comments

cdwmhcc picture cdwmhcc  路  3Comments

cdwmhcc picture cdwmhcc  路  3Comments

Nitwel picture Nitwel  路  3Comments