Skip to content

BUGFIX: handle DateTimeImmutable node property in neos ui#5723

Draft
mhsdesign wants to merge 1 commit intoneos:9.0from
mhsdesign:bugfix/handle-DateTimeImmutable-for-neos-ui
Draft

BUGFIX: handle DateTimeImmutable node property in neos ui#5723
mhsdesign wants to merge 1 commit intoneos:9.0from
mhsdesign:bugfix/handle-DateTimeImmutable-for-neos-ui

Conversation

@mhsdesign
Copy link
Member

@mhsdesign mhsdesign commented Jan 4, 2026

With Neos 9 we fully ensure that DateTimeImmutable are used in node properties. DateTime is an alias for DateTimeImmutable when used as type. Thats why we often refer to DateTimeImmutable already in the tests. Being used to that and knowing that it works on the core i was surprised that the Ui crashes. A missing declaration is the crux here as without the override typeConverter here the Neos Ui will use the Neos\Flow\Property\TypeConverter\ArrayFromObjectConverter which is not incredibly clever when it comes to dates and plain dies:

DateTimeZone::getOffset() expects exactly 1 argument, 0 given

87 DateTimeZone::getOffset()
86 Neos\Utility\ObjectAccess::getPropertyInternal(DateTimeZone, "offset", false, true)
85 Neos\Utility\ObjectAccess::getGettableProperties(DateTimeZone)
84 Neos\Flow\Property\TypeConverter\ArrayFromObjectConverter_Original::getSourceChildPropertiesToBeConverted(DateTimeZone)
83 Neos\Flow\Property\PropertyMapper_Original::doMapping(DateTimeZone, "array", Neos\Flow\Property\PropertyMappingConfiguration, array|1|)
82 Neos\Flow\Property\PropertyMapper_Original::doMapping(DateTimeImmutable, "array", Neos\Flow\Property\PropertyMappingConfiguration, array|1|)
81 Neos\Flow\Property\PropertyMapper_Original::convert(DateTimeImmutable, "array", Neos\Flow\Property\PropertyMappingConfiguration)
80 Neos\Neos\Ui\Domain\Service\NodePropertyConverterService_Original::convertValue(DateTimeImmutable, "DateTimeImmutable")

Upgrade instructions

Review instructions

Checklist

  • Code follows the PSR-2 coding style
  • Tests have been created, run and adjusted as needed
  • The PR is created against the lowest maintained branch
  • Reviewer - PR Title is brief but complete and starts with FEATURE|TASK|BUGFIX
  • Reviewer - The first section explains the change briefly for change-logs
  • Reviewer - Breaking Changes are marked with !!! and have upgrade-instructions

With Neos 9 we fully ensure that `DateTimeImmutable` are used in node properties. `DateTime` is an alias for `DateTimeImmutable` when used als type. Thats why we often refer to `DateTimeImmutable` already in the tests. Being used to that and reading that it works on the core i was suprised that the Ui crashes.
A missing declaration is the crux here as without the override `typeConverter` here the Neos Ui will use the `Neos\Flow\Property\TypeConverter\ArrayFromObjectConverter` which is not incredibly clever when it comes to dates and plain dies:

```
DateTimeZone::getOffset() expects exactly 1 argument, 0 given

87 DateTimeZone::getOffset()
86 Neos\Utility\ObjectAccess::getPropertyInternal(DateTimeZone, "offset", false, true)
85 Neos\Utility\ObjectAccess::getGettableProperties(DateTimeZone)
84 Neos\Flow\Property\TypeConverter\ArrayFromObjectConverter_Original::getSourceChildPropertiesToBeConverted(DateTimeZone)
83 Neos\Flow\Property\PropertyMapper_Original::doMapping(DateTimeZone, "array", Neos\Flow\Property\PropertyMappingConfiguration, array|1|)
82 Neos\Flow\Property\PropertyMapper_Original::doMapping(DateTimeImmutable, "array", Neos\Flow\Property\PropertyMappingConfiguration, array|1|)
81 Neos\Flow\Property\PropertyMapper_Original::convert(DateTimeImmutable, "array", Neos\Flow\Property\PropertyMappingConfiguration)
80 Neos\Neos\Ui\Domain\Service\NodePropertyConverterService_Original::convertValue(DateTimeImmutable, "DateTimeImmutable")
```
@mhsdesign mhsdesign marked this pull request as draft January 4, 2026 11:44
@mhsdesign
Copy link
Member Author

todo

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant