- Status changed to Needs work
over 1 year ago 8:03am 1 August 2023 - 🇫🇷France fgm Paris, France
@mitsuko: could you apply that patch to the existing MR at https://git.drupalcode.org/issue/image_delta_formatter-3173945/-/tree/31... ? As it stands, the current MR does not include D10 support.
Also, more importantly, I think there is no reason to have separate modules to support that use case: we could just as well have the two plugins in the same module, and spare the extra load for an additional module.
In addition, since both plugins ultimately derive from the same underlying ImageFormatter (via MediaThumbnailFormatter in the case of image_delta_formatter_media), it would make sense to just reuse the code instead of duplicating it. One possibility would be to defined a Trait holding that common code, and reduce both plugins to one-liners using that trait.
- 🇳🇱Netherlands neograph734 Netherlands
Also, more importantly, I think there is no reason to have separate modules to support that use case: we could just as well have the two plugins in the same module, and spare the extra load for an additional module.
Please also check comment #7. It is split because of the dependency on the media module.
- Status changed to Needs review
over 1 year ago 8:58am 1 August 2023 - 🇫🇷France fgm Paris, France
@neogrpah734 indeed, since media is a core module and has all but replaced image module for most common use cases since Drupal 8.4, I do not consider the dependency on media to be an issue any longer: this is no longer 2021.
I just pushed a combined version on the MR, which also drop D8 support since it has been unsupported for almost 3 years already: comments welcome.
- Status changed to Needs work
over 1 year ago 1:38pm 1 August 2023 - 🇫🇷France fgm Paris, France
With the added dependency, the code is now missing a hook_update_N to enabled media if needed.
- Status changed to Needs review
over 1 year ago 6:42am 2 August 2023 - 🇫🇷France fgm Paris, France
There was a typo in the media formatter name ("medial_delta_formatter").
Regarding the conditional loading with isApplicable, it couldn't work because to call the method, the class first needs to be loaded and that will fail if media.module is not loaded.
Another approach could be to compose the thumbnail formatter instead of inheriting from it, to support conditional loading, but it would make the code significantly more complex.
- 🇫🇷France fgm Paris, France
@berdir suggested a smarter approach on Slack: the Media delta plugin is now conditional, which avoids both the extra submodule and depending on media.module and will still enable the Media formatter automatically if media is present.
I guess that's a better choice for everyone ?
- Status changed to Fixed
over 1 year ago 3:52pm 2 August 2023 - 🇫🇷France fgm Paris, France
Merged that simplified version to current dev HEAD, thanks everyone.
Automatically closed - issue fixed for 2 weeks with no activity.
- Status changed to Fixed
11 months ago 12:48pm 9 December 2023 - 🇳🇱Netherlands neograph734 Netherlands
@fgm thanks for all the work. Is there any chance you could create a tagged release with these changes included?
- 🇫🇷France fgm Paris, France
@Neograph734 the plan is to do it after D10.2 release, along with 📌 Update Drupal / PHP support Active . Think it's worth doing one before ?
- 🇳🇱Netherlands neograph734 Netherlands
Thanks for the fast reply! I believe that 10.2 is planned for next week or so? No need to create a new release now then.
I was only asking because I figured that I was still on the dev version.