Don't delete image derivatives on module uninstall

Created on 4 December 2024, 4 months ago

Problem/Motivation

When uninstalling the webp module, webp's hook_uninstall() implementation wipes out all image derivatives, at least if imageapi_optimize is not installed.

Steps to reproduce

Uninstall the webp module without imageapi_optimize installed.

Proposed resolution

At the least, I think the webp module's uninstall hook should only selectively delete .webp files in the styles folder. It's not responsible for creating any other formats, and should not wipe them out.

Arguably it shouldn't even delete the .webp files. In many cases people may be uninstalling the webp module in order to continue serving webp by other means, such as Core's own support for conversion to webp β†’ . In these cases, the same path and filename may well remain vaild (that's been our experience) and so keeping the .webp derivatives around is useful and desirable.

There are other manual methods that can be taken by people that proactively wish to wipe out all their generated derivatives, such as the drush command image:flush, or deleting the style folder manually.

Remaining tasks

Choose and implement a change to the uninstall hook.

✨ Feature request
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States bvoynick

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024