Closed (fixed)
Project:
Drupal core
Version:
11.x-dev
Component:
datetime.module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
22 Nov 2025 at 00:00 UTC
Updated:
2 Feb 2026 at 19:14 UTC
Jump to comment: Most recent
Comments
Comment #3
nicxvan commentedDo we need to deprecate dateFormatStorage? How do we do that since we populate it in the constructor without it triggering.
Comment #4
nicxvan commentedComment #5
berdirWe could do a __get() for BC, I'm no sure it's worth it.
FWIW, the added types are also a possible BC issue, I'm pretty sure https://git.drupalcode.org/project/hijri/-/blob/3.0.x/src/HijriFormatter... will break because it for some reason redefines the properties. Feels a bit pointless to worry about the storage property but knowingly break that module?
So either we are extra careful, add BC and don't change any other properties here, or we clean it up and live with a possible break?
Comment #6
nicxvan commentedI don't think anything will break except the missing storage property i didn't mark anything readonly and they are defining them to the same type.
Comment #7
berdirThe example I shared does not use types, so it will fail: https://3v4l.org/Zf54T#vnull
If the parent has a type, you must have one as well. That's the problem with these sort of cleanups.
Comment #8
mstrelan commentedThat module is only compatible with D8/9, are there other examples?
Comment #9
berdirThere are a few that extend DateFormatter, that's the only one that I found that would be affected by this change. But it's just meant as an example that it can be a BC break in some cases. What it does is weird and completely unnecessary, but it can't be ruled out that there's custom code out there that would break too.
Again, my argument is just that we decide we either do full BC, and then we don't include the other constructor changes, or we don't (which is essentially this MR as it is now), not a mix between those options. As a reply to #3.
Comment #10
berdirLooks fine to me, just the BC question. I'm not sure, like we recently saw with that webform __get() issue on the entity storage handler, it's even possible that attempting to do BC can do more harm than good, even though it's unlikely to be a problem here.
Comment #11
anybodyJust hit date.formatter again in a circular reference in Drupal commerce and it seems related. So clear +1 on getting this fixed in core. Thank you @nicxvan and @berdir!
Comment #12
catchLet's go ahead here. bc for constructors is 'best effort' and sometimes 'best' is 'none'.
Committed/pushed to main and 11.x, thanks!