DateTime default property different than empty

I have…

I’m submitting a…

  • [ ] Regression (a behavior that stopped working in a new release)
  • [ x ] Bug report
  • [ ] Performance issue
  • [ ] Documentation issue or request

Current behavior

This is my data. From top to bottom. The first {iv:null} is the default value. The second is a select date.
The third though is when i clear the date. I expected a {iv:null} but receive a {}. This cause errors.

image

Expected behavior

When I clear a DateTime field, the data should be {iv:null}.

Minimal reproduction of the problem

Create DateTime field in schema (invariant). Save a DateTime. Remove DateTime (by using the X).

Environment

  • [ ] Self hosted with docker
  • [ ] Self hosted with IIS
  • [ ] Self hosted with other version
  • [ x ] Cloud version

Version: [VERSION]

Browser:

  • [ ] Chrome (desktop)
  • [ ] Chrome (Android)
  • [ ] Chrome (iOS)
  • [ ] Firefox
  • [ ] Safari (desktop)
  • [ ] Safari (iOS)
  • [ ] IE
  • [ ] Edge

Others:

Hi, I think the main issue would be the invariant converter because there might be other cases where a field is undefined.

Ok if this is by design we will update the converter :+1:

1 Like

A PR is very welcome :slight_smile:

Hi Sebastian,

I just added an ugly value == null check. This works for us, because all our properties are nullable.
I dont know if this behaviour is usefull for others.

In my opinion the best solution would be to set the value to { “iv”, null } when invariant properties are cleared. But again… I can’t say if this is possible / breaking for other code.