- Issue created by @alemadlei
- Merge request !1503522736: You have requested a non-existent service "daterange_compact.date_range.formatter" → (Open) created by alemadlei
- 🇨🇷Costa Rica alemadlei
I've submitted a first MR.
I discovered that this happens when I use alongside the field_limiter module.
But this also seems related to custom formats from date range compact. So if a display setting is using that it will fail. But these updates should take care of linking the classes properly.
- 🇪🇸Spain plopesc Valladolid
Patch looks good, but I would prefer not to add a new dependency for all the module installations.
It might be declared as a soft dependency where the formatter is only available if the service is available as well?
- 🇨🇷Costa Rica alemadlei
So how would you recommend me address this with the patch?
If I remove the composer dependency how should the formatter class be managed? Since it is a plugin it would be automatically loaded.
- 🇪🇸Spain plopesc Valladolid
I would declare the service as an optional parameter in the formatter constructor.
Then in create() method, use the NULL_ON_INVALID_REFERENCE class constant to use NULL instead of throwing an exception if the service is missing.Finally, the isApplicable() method will define the formatter as available if the module is installed.
Another option, probably simpler would be to define the daterange_compact module as formatter provider. Hence will be discoverable if only the provider is installed.
- Merge request !159Issue #3522736: You have requested a non-existent service "daterange_compact.date_range.formatter" → (Merged) created by plopesc
- 🇪🇸Spain plopesc Valladolid
Since many of the issues related to 🌱 Roadmap to modernize code for D11 + PHP 8.3 Active modified this file last days, this issue ended up in a single line MR :)
Automatically closed - issue fixed for 2 weeks with no activity.