georgringer / news

TYPO3 Extension news
GNU General Public License v2.0
265 stars 356 forks source link

Not nullable setter for endtime #2487

Closed runner78 closed 13 hours ago

runner78 commented 5 months ago

Bug Report

The setter of the property "endtime" in the News Model has the non-nullable type "Datetime"

Environment

Possible Solution No type for the parameter or make it nullable.

georgringer commented 5 months ago

wanna make it nullable?

runner78 commented 5 months ago

If you create/edit news in your own extension, this can lead to problems, because you can no longer delete endtime once it has been set, or in my case the field is sent as null and an exception is thrown during mapping. It is also inconsistent with the other setters because other date fields do not have a typed setter and the setter does not correspond to the actual nullable property. I would suggest either making all setters without types or all with the correct type.

keessonnema commented 3 months ago

+1. Running into the same issue as @runner78 when extending news models. It would be very helpful if endtime was nullable.

georgringer commented 13 hours ago

be aware that extbase can handle null datetime values in setters only since 13.2, see https://review.typo3.org/c/Packages/TYPO3.CMS/+/83839