As of Drupal version 9.3, the property $fileUrlGenerator is accessible directly from the Image Link Formatter's parent class ImageFormatter, see corresponding ticket and commit (added more than a year ago):

 
Therefore, going forward, since Drupal core 9.2 is not supported since June 15 2022, a year after verison 9.2.0 was released and more than a year ago, we should probably keep the maintenance of module's 2.1.x branch (D9/10 compatible) focused on the versions currently supported for Drupal core (as of this post (9.3/9.4/9.5).

See for example the Metatag module dropping support for D9.2 at:
#3252150-56: Drupal 10 compatibility for Metatag

For the Image Link Formatter module, dropping support for D9.2 would probably require the following changes:

  • Updating module's info file's core_version_requirement and maybe composer.json dependencies as well.
  • Removing property $fileUrlGenerator from class ImageLinkFormatter.
  • Removin any mention to versions lower than 9.3 in Functional test cases (floatval(\Drupal::VERSION) < 9.1), since they should no longer run on systems prior to D9.3.

 
Feel free to let us know if you have any questions or comments on any of the suggested changes or the ticket in general, we would be glad to have your feedback.

Comments

DYdave created an issue. See original summary.

  • DYdave committed e80e702 on 2.1.x
    Issue #3307068 by DYdave: Dropped support for Drupal 9.2 and removed ''...
dydave’s picture

Status: Active » Fixed

Quick follow-up on this issue:

  • Updated module's info file's core_version_requirement to support 9.3 and above ('^9.3 || ^10') and added version constraint "drupal/core:^9.3 || ^10" to composer.json to specify version dependency (similar to what was done for the Metatag module, see link in issue summary).
  • Removed property $fileUrlGenerator from class ImageLinkFormatter and updated accordingly container methods.
  • Removed special cases for testing HTML rendering results for core versions lower than 9.3 in Functional test case ImageLinkFormatterTest.

 
The changes were committed to branch 2.1.x at:
https://git.drupalcode.org/project/image_link_formatter/-/commit/e80e702...
 
Feel free to let us know if you have any questions, comments, concerns or feedback on any of the recent code changes or the ticket in general, we would certainly be happy to help.
Thanks in advance!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.