-
-
Notifications
You must be signed in to change notification settings - Fork 224
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
BUGFIX: DateTime
node property with defaultValue
#4902
BUGFIX: DateTime
node property with defaultValue
#4902
Conversation
DateTime
node property inconsistenciesDateTime
node property with defaultValue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this only fix now
or other relative strings?
Neos.ContentRepository.Core/Classes/Infrastructure/Property/PropertyConverter.php
Show resolved
Hide resolved
no this fixes EVERYTHING. |
the property should be a `DateTimeImmutable` and thus NOT mutable - Add test for that `type: DateTime` is now a `DateTimeImmutable`
That will lead to relative `DateTime` values like `now` reflecting the actual time when the command was handled, rather glitching around and reflecting the date when being fetched.
…CreateNodeAggregateWithNode` This is now part of the inner `handleCreateNodeAggregateWithNodeAndSerializedProperties` via `SerializedPropertyValues::defaultFromNodeType`
With neos#4251 `NodeType::getDefaultValuesForProperties` doesnt return a `DateTime` anymore for dateTime default values
b9b843b
to
41bc886
Compare
ede965b
to
3117ab0
Compare
Resolves: #4901
Upgrade instructions
In case you already used
defaultValue
with a relative string likenow
, you have to manually migrate the events by hand.Not doing so is not critical as the node property will still work, just a little unexpected as
now
will always be now.If there is much demand for it, we can provide an optional migration to handle
DateTime
ininitialProperties
correctly.But it is to be suspected that this feature was not yet used as its a niche thing.
Review instructions
Checklist
FEATURE|TASK|BUGFIX
!!!
and have upgrade-instructions