Attempt to remove ImageStyleDownloadController override completely

Created on 7 August 2024, 4 months ago

Problem/Motivation

Core has added support for derivative handling.. We can potentially remove the need for this module to override Drupal\image\Controller\ImageStyleDownloadController completely. While this does not completely solve the problem of when we are creating the webp deriver, it would at least avoid issues around multiple modules all trying to override the same class.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

✨ Feature request
Status

Active

Version

2.1

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States michaellander

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @michaellander
  • Status changed to Needs review 4 months ago
  • πŸ‡ΊπŸ‡ΈUnited States michaellander

    This version seems to fix issues around overriding the Drupal\image\Controller\ImageStyleDownloadController completely and is much more elegant. We will need to test to make sure everything is flushing correctly when the image is replaced.

  • πŸ‡ΊπŸ‡ΈUnited States michaellander

    This should give us a path forward for modules like ImageAPI Optimize AVIF β†’ to run alongside this module without needing glue modules like ImageAPI Optimize AVIF & WebP β†’ .

  • Status changed to Needs work 4 months ago
  • πŸ‡ΊπŸ‡ΈUnited States michaellander

    I had this consistently working and now with a fresh install it's not... needs more work.

  • Status changed to Needs review 4 months ago
  • πŸ‡ΊπŸ‡ΈUnited States michaellander

    This should be working better now.

  • πŸ‡«πŸ‡·France tostinni

    For those still on 2.0.0 here is a patch from the MR16.

  • πŸ‡³πŸ‡±Netherlands Martijn de Wit πŸ‡³πŸ‡± The Netherlands

    Needed this path after we've got an error after upgrading the module

    PHP Fatal error:  Declaration of Drupal\imageapi_optimize_webp\Controller\ImageStyleDownloadController::deliver(Symfony\Component\HttpFoundation\Request $request, $scheme, Drupal\image\ImageStyleInterface $image_style) must be compatible with Drupal\image\Controller\ImageStyleDownloadController::deliver(Symfony\Component\HttpFoundation\Request $request, $scheme, Drupal\image\ImageStyleInterface $image_style, string $required_derivative_scheme) in ..../web/modules/contrib/imageapi_optimize_webp/src/Controller/ImageStyleDownloadController.php on line 36
    

    we are on php v 8.3.1
    using D Core 10.3.6

Production build 0.71.5 2024