Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
With the Upgrade Status module I found two functions which are deprecated and which will no longer be available with Drupal 9.
I have attached the two warnings as a screenshot to this issue.
I will try to create a patch that replaces these two deprecations so that WebP is ready for Drupal 9.
Comments
Comment #2
malte.koelle CreditAttribution: malte.koelle at Unic commentedI have removed the two deprecated functions with the suggested functions from Upgrade Status Module.
I hope this works.
Comment #3
malte.koelle CreditAttribution: malte.koelle at Unic commentedComment #4
malte.koelle CreditAttribution: malte.koelle at Unic commentedI removed the @ Sign and replaced it with a try catch clause.
Comment #5
andypostBetter to use DI for the services
Comment #6
malte.koelle CreditAttribution: malte.koelle at Unic commentedThank you @andypost for your answer.
I have changed my code and I'm using DI now for the services.
Comment #7
dermarioThe DI implementation looks fine from my side. I found some minor stuff regarding code style.
The description of $fileSystem missing.
I'm not sure whether it's "wrong" to use lowerCamelCase variable names here. To stay consistent with $image_factory we maybe could use $file_system here.
Comment #8
malte.koelle CreditAttribution: malte.koelle at Unic commentedThank you @dermario for your fast response
I have changed the variable name to a lowerCamelCase name.
Comment #9
malte.koelle CreditAttribution: malte.koelle at Unic commentedI changed the variable name from fileSystem to file_system for the Webp.php class as well.
Comment #10
malte.koelle CreditAttribution: malte.koelle at Unic commentedI realised that my patch isn't working. I will have a look on it.
Comment #11
malte.koelle CreditAttribution: malte.koelle at Unic commentedI added the file system service as an argument in the services.yml file. Now it works after testing it.
Comment #12
alexmoreno CreditAttribution: alexmoreno at Acquia commentedthanks all, looks good to me.
Comment #14
alexmoreno CreditAttribution: alexmoreno at Acquia commentedComment #16
bjaxelsen CreditAttribution: bjaxelsen commentedCurrent development version does not work on Drupal 9 - I've created patch.