Problem/Motivation

Follow-up to #3173031: Clean-up \Drupal\system\Plugin\ImageToolkit\GDToolkit when core require php 8.0

Since PHP version 8.0 the GD extension using classed object \GdImage instead of resource but toolkit methods has not a lot of usage and could improve DX for new-comers using nowadays state

Steps to reproduce

See #3156887: \Drupal\system\Plugin\ImageToolkit\GDToolkit needs to support \GdImage objects for PHP 8 compatibility
Usage in contrib http://grep.xnddx.ru/search?text=setResource%28&filename=

Proposed resolution

deprecate setResource() and getResource() in favour of

- public function setImage(\GdImage $gd_image): self https://git.drupalcode.org/project/drupal/-/merge_requests/1486/diffs#no...
- public function getImage(): \GdImage https://git.drupalcode.org/project/drupal/-/merge_requests/1486/diffs#no...

Remaining tasks

agree/patch/commit

User interface changes

no

API changes

\Drupal\system\Plugin\ImageToolkit\GDToolkit::setResource() replaced with setImage()
\Drupal\system\Plugin\ImageToolkit\GDToolkit::getResource() replaced with getImage()
Protected variable to store result renamed from \Drupal\system\Plugin\ImageToolkit\GDToolkit::resource to \Drupal\system\Plugin\ImageToolkit\GDToolkit::image

Data model changes

no

Release notes snippet

no

Issue fork drupal-3265953

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

andypost created an issue. See original summary.

andypost’s picture

Issue summary: View changes

andypost’s picture

daffie’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll
ankithashetty’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
StatusFileSize
new24.86 KB
new8.33 KB

Rerolled patch in #4, thanks!

Status: Needs review » Needs work

The last submitted patch, 7: 3265953-7.patch, failed testing. View results

quietone’s picture

Status: Needs work » Needs review
StatusFileSize
new9.55 KB
new24.97 KB

Just updating the patch and this should fix the failing tests. Although, I am a bit tired ....

andypost’s picture

Status: Needs review » Reviewed & tested by the community

Looks ready

alexpott’s picture

Version: 10.0.x-dev » 10.1.x-dev
Status: Reviewed & tested by the community » Needs work

Can we change all the deprecations to 10.1.x we're targeting 10.1 for stuff like this and not 10.0

Thanks!

mondrake’s picture

  1. +++ b/core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php
    @@ -31,9 +31,21 @@ class GDToolkit extends ImageToolkitBase {
    +  /**
    +   * A GD image.
    +   *
    +   * @var \GdImage|null
    +   */
    +  protected $image = NULL;
    +
    

    We can typehint the property as ?\GdImage and remove from the docblock

  2. +++ b/core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php
    @@ -135,12 +151,43 @@ public function setResource($resource) {
    +  public function setGdImage(\GdImage $image): self {
    

    self or static? static would allow extending the class IIRC

  3. +++ b/core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php
    @@ -135,12 +151,43 @@ public function setResource($resource) {
    +  public function getGdImage(): \GdImage|NULL {
    

    typehint should be ?\GdImage

  4. +++ b/core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php
    @@ -182,7 +229,7 @@ protected function load() {
    +      $this->setGdImage($resource);
    

    IMHO we should also rename the local $resource variable

  5. +++ b/core/modules/system/src/Plugin/ImageToolkit/Operation/gd/Crop.php
    @@ -85,15 +85,15 @@ protected function execute(array $arguments) {
    +        imagedestroy($this->getToolkit()->getGdImage());
    

    imagedestroy is a noop since PHP 8.0, we can remove it and adjust the inline comment. Also rename $original_resource

  6. +++ b/core/modules/system/src/Plugin/ImageToolkit/Operation/gd/Resize.php
    @@ -55,7 +55,7 @@ protected function execute(array $arguments = []) {
    +    $original_resource = $this->getToolkit()->getGdImage();
    

    Rename $original_resource

  7. +++ b/core/modules/system/src/Plugin/ImageToolkit/Operation/gd/Resize.php
    @@ -64,15 +64,15 @@ protected function execute(array $arguments = []) {
    +        imagedestroy($this->getToolkit()->getGdImage());
    

    imagedestroy is noop

  8. +++ b/core/modules/system/src/Plugin/ImageToolkit/Operation/gd/Rotate.php
    @@ -94,18 +94,18 @@ protected function execute(array $arguments) {
    +    $original_res = $this->getToolkit()->getGdImage();
    ...
    +    if ($new_res = imagerotate($this->getToolkit()->getGdImage(), 360 - $arguments['degrees'], $arguments['background_idx'])) {
    +      $this->getToolkit()->setGdImage($new_res);
    

    Rename $original_res and $new_res

  9. +++ b/core/tests/Drupal/KernelTests/Core/Image/ToolkitGdTest.php
    @@ -460,7 +460,7 @@ public function testGifTransparentImages(): void {
    +    $resource = $image->getToolkit()->getGdImage();
    

    Rename $resource

  10. +++ b/core/tests/Drupal/KernelTests/Core/Image/ToolkitGdTest.php
    @@ -473,7 +473,7 @@ public function testGifTransparentImages(): void {
    +    $resource = $image->getToolkit()->getGdImage();
    

    Rename $resource

  11. +++ b/core/tests/Drupal/KernelTests/Core/Image/ToolkitGdTest.php
    @@ -481,7 +481,7 @@ public function testGifTransparentImages(): void {
    +    $resource = $image_reloaded->getToolkit()->getGdImage();
    

    Rename $resource

andypost’s picture

Status: Needs work » Needs review
StatusFileSize
new18.15 KB
new643.42 KB

Address #11 and #12, removed all imagedestroy() as it's no-op and useless since PHP 8.1

andypost’s picture

StatusFileSize
new27.62 KB

proper patch(

andypost’s picture

Re #12.2 static vs self - I changed to static as the class is not final and https://phpstan.org/writing-php-code/phpdoc-types#static-and-%24this

andypost’s picture

StatusFileSize
new5.94 KB
new31.01 KB

fix remaining mentions

andypost’s picture

+++ b/core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php
@@ -135,12 +149,43 @@ public function setResource($resource) {
+  public function setGdImage(\GdImage $image): static {

the only question is should we allow to pass NULL as GD image object, looks no way to reset it to null

andypost’s picture

mondrake’s picture

Status: Needs review » Needs work
  1. +++ b/core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php
    @@ -135,12 +149,43 @@ public function setResource($resource) {
    +  public function setGdImage(\GdImage $image): static {
    

    this signature will potentially cause BC break if NULL is passed to legacy setResource() or to the method directly. We cannot rule that out from contrib, setting the resource to null can be a way to invalidate the image if for any reason a toolkit operation fails.

    So either we allow null like
    public function setGdImage(?\GdImage $image): static
    or we introduce a separate method to null the property.

  2. +++ b/core/modules/system/src/Plugin/ImageToolkit/Operation/gd/Rotate.php
    @@ -93,19 +93,15 @@ protected function execute(array $arguments) {
    -    // Stores the original GD resource.
    -    $original_res = $this->getToolkit()->getResource();
    -
    

    seems like this is removed with no replacement?

andypost’s picture

Status: Needs work » Needs review
StatusFileSize
new619 bytes
new31.01 KB

Thank you!

1) fixed, that's what I was confused in #17
2) it's done intentionally as this variable no longer used - was supposed to be used in imagedestroy() but as it's no-op I removed it

andypost’s picture

StatusFileSize
new503 bytes
new31.01 KB

fix docblock

mondrake’s picture

Status: Needs review » Reviewed & tested by the community

#20.2 oh yeah I missed that!

Thanks looks all good to me now.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php
@@ -31,9 +31,19 @@ class GDToolkit extends ImageToolkitBase {
    * @var \GdImage|null
+   *
+   * @deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use
+   *   \Drupal\system\Plugin\ImageToolkit\GDToolkit::image instead.
+   *
+   * @see https://www.drupal.org/node/3265963
    */
   protected $resource = NULL;

This change results in this property no longer being set. So keeping it around but unused feels odd. If we feel we need to maintain the protected property that we should maintain the value.

I think we should do something similar to the \Drupal\Core\DependencyInjection\DeprecatedServicePropertyTrait and leverage the __get() function to trigger a deprecation if someone tries to use $this->resource and then we should give them $this->image.

andypost’s picture

Status: Needs work » Needs review

Not sure it's ok to use magic __get() as it makes this property accessible outside of child classes https://3v4l.org/0XIA9

andypost’s picture

StatusFileSize
new2.25 KB
new31.65 KB

Discussed in slack and value of having BC is preferable and there's getter for property so it's like public initially

mondrake’s picture

Status: Needs review » Needs work

Well, that would be only relevant for classes that extend the GDToolkit class itself, which I am not sure there are any... the toolkit operations would not access it directly anyway.

However, this is already agreed, so fine, but we also need a __set() implementation to fully cover BC.

andypost’s picture

Status: Needs work » Needs review
StatusFileSize
new1.84 KB
new32.37 KB

Added, do we need to implement __isset() and __unset()?

PS: there's only 3 classes using to override it in contrib http://codcontrib.hank.vps-private.net/search?text=GDToolkit&filename= but none of them accessing this property

mondrake’s picture

I suppose so, if we need to be fully BC... you're right.

andypost’s picture

StatusFileSize
new3.52 KB
new33.83 KB

Added both

mondrake’s picture

Status: Needs review » Reviewed & tested by the community

Thanks. Cannot see anything else.

longwave’s picture

Status: Reviewed & tested by the community » Needs work
  1. +++ b/core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php
    @@ -28,11 +28,9 @@
    -  protected $resource = NULL;
    +  protected ?\GdImage $image = NULL;
    

    I wonder if this is really necessary, is it worth doing the deprecation dance for an internal property? It can just live as $resource for historical reasons - we only really need to update the public API?

  2. +++ b/core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php
    @@ -135,12 +178,43 @@ public function setResource($resource) {
    +  public function setGdImage(?\GdImage $image): static {
    ...
    +  public function getGdImage(): ?\GdImage {
    

    Maybe bikeshedding here but do we need Gd in the method name, given the class is already the GDToolkit? Is setImage/getImage better?

  3. +++ b/core/modules/system/src/Plugin/ImageToolkit/Operation/gd/CreateNew.php
    @@ -39,7 +39,7 @@ protected function arguments() {
    -        'description' => 'If TRUE, this operation is being used to create a temporary image by another GD operation. After performing its function, the caller is responsible for destroying the original GD resource.',
    +        'description' => 'If TRUE, this operation is being used to create a temporary image by another GD operation. After performing its function, the caller is responsible for destroying the original GD object.',
    

    Does the statement about destroying still hold true now we are no longer using resources?

  4. +++ b/core/tests/Drupal/KernelTests/Core/Image/ToolkitGdTest.php
    @@ -460,9 +460,9 @@ public function testGifTransparentImages(): void {
    +    $gdImage = $image->getToolkit()->getGdImage();
    

    Variables should be snake_case when snake case is used elsewhere in the same file.

andypost’s picture

Great points! will work on 2-4 because 1 requested by alexpott

andypost’s picture

Status: Needs work » Needs review
StatusFileSize
new26.04 KB
new33.79 KB

Addressed #31 2-4

andypost’s picture

I think it should be improved as is_temp no longer used and is just an indicator of that operation happening in pipeline

+++ b/core/modules/system/src/Plugin/ImageToolkit/Operation/gd/Convert.php
@@ -40,12 +40,12 @@ protected function validateArguments(array $arguments) {
+    // the original image on it with resampling. Restore the original image upon
+    // failure.

+++ b/core/modules/system/src/Plugin/ImageToolkit/Operation/gd/CreateNew.php
@@ -39,7 +39,7 @@ protected function arguments() {
-        'description' => 'If TRUE, this operation is being used to create a temporary image by another GD operation. After performing its function, the caller is responsible for destroying the original GD resource.',
+        'description' => 'If TRUE, this operation is being used to create a temporary image by another GD operation. After performing its function, the original GD object will be destroyed automatically.',

+++ b/core/modules/system/src/Plugin/ImageToolkit/Operation/gd/Crop.php
@@ -73,10 +73,10 @@ protected function validateArguments(array $arguments) {
-    // Create a new resource of the required dimensions, and copy and resize
-    // the original resource on it with resampling. Destroy the original
-    // resource upon success.
-    $original_resource = $this->getToolkit()->getResource();
+    // Create a new image of the required dimensions, and copy and resize
+    // the original image on it with resampling. Restore the original image upon
+    // failure.
+    $original_image = $this->getToolkit()->getImage();

@@ -85,16 +85,11 @@ protected function execute(array $arguments) {
+      // In case of failure, restore the original image.
+      $this->getToolkit()->setImage($original_image);

+++ b/core/modules/system/src/Plugin/ImageToolkit/Operation/gd/Resize.php
@@ -52,10 +52,9 @@ protected function validateArguments(array $arguments) {
-    // Create a new resource of the required dimensions, and copy and resize
-    // the original resource on it with resampling. Destroy the original
-    // resource upon success.
-    $original_resource = $this->getToolkit()->getResource();
+    // Create a new image of the required dimensions, and copy and resize
+    // the original image on it with resampling.
+    $original_image = $this->getToolkit()->getImage();

@@ -64,16 +63,11 @@ protected function execute(array $arguments = []) {
+      // In case of failure, restore the original image.
+      $this->getToolkit()->setImage($original_image);

looks needs better clarification, as if operation creates new image then depending on result original will be restored or not

andypost’s picture

+++ b/core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php
@@ -211,7 +284,7 @@ protected function load() {
   public function isValid() {
-    return ((bool) $this->preLoadInfo || (bool) $this->resource);
+    return ((bool) $this->preLoadInfo || isset($this->image));

This change to isset() is covered by tests

mondrake’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me, #31.2-4 addressed. #34 would be an interesting follow-up I guess, even if at first sight I'd daresay we cannot exclude that a class extending this would not use it - so, is it or isn't it API? Just checked and in the ImageMagick module that argument is not implemented.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 33: 3265953-33.patch, failed testing. View results

mondrake’s picture

Status: Needs work » Reviewed & tested by the community

Flaky test failure?

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 33: 3265953-33.patch, failed testing. View results

andypost’s picture

Status: Needs work » Reviewed & tested by the community

re-queued

mondrake’s picture

Status: Reviewed & tested by the community » Needs work
andypost’s picture

Status: Needs work » Reviewed & tested by the community
Related issues: +#2583041: GD toolkit & operations should catch \Throwable to fail gracefully in case of errors
xjm’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs change record updates

Thanks for working on this! I guess the patch is the latest/canonical version here and not the merge request, so I am going to close the MR for clarity.

I made some small improvements to the change record.

  1. +++ b/core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php
    @@ -28,11 +28,9 @@
    -  protected $resource = NULL;
    +  protected ?\GdImage $image = NULL;
    

    This is, technically, an internal BC break to make the typehint stricter. I think it is probably low-risk, but should be restricted to a minor only and maybe be mentioned in the CR.

  2. +++ b/core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php
    @@ -112,6 +110,47 @@ public static function create(ContainerInterface $container, array $configuratio
    +    if ($name === 'resource') {
    ...
    +    if ($name == 'resource') {
    ...
    +    if ($name == 'resource') {
    ...
    +    if ($name == 'resource') {
    

    Why are some of these == but the others ===?

  3. +++ b/core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php
    @@ -112,6 +110,47 @@ public static function create(ContainerInterface $container, array $configuratio
    +      @trigger_error('Accessing the \Drupal\system\Plugin\ImageToolkit\GDToolkit::resource property is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use \Drupal\system\Plugin\ImageToolkit\GDToolkit::image instead.', E_USER_DEPRECATED);
    ...
    +      @trigger_error('Setting the \Drupal\system\Plugin\ImageToolkit\GDToolkit::resource property is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use \Drupal\system\Plugin\ImageToolkit\GDToolkit::image instead.', E_USER_DEPRECATED);
    ...
    +      @trigger_error('Checking the \Drupal\system\Plugin\ImageToolkit\GDToolkit::resource property is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use \Drupal\system\Plugin\ImageToolkit\GDToolkit::image instead.', E_USER_DEPRECATED);
    ...
    +      @trigger_error('Unsetting the \Drupal\system\Plugin\ImageToolkit\GDToolkit::resource property is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use \Drupal\system\Plugin\ImageToolkit\GDToolkit::image instead.', E_USER_DEPRECATED);
    

    Method names in all the deprecation messages should have parens. OTOH the correct way to document PHP member properties is \Drupal\whatever\Class::$property. Both ::resource and ::image need to be fixed one way or the other.

    Also, these seem to refer to an image method or property that does not exist?

  4. +++ b/core/tests/Drupal/Tests/Component/Utility/RectangleTest.php
    @@ -77,13 +77,10 @@ public function testRotateDimensions($width, $height, $angle, $exp_width, $exp_h
    -   *     if (is_resource($old_res)) {
    -   *       imagedestroy($old_res);
    -   *     }
    

    I wondered why this is being removed from the example code. Answer above is:

    imagedestroy is a noop since PHP 8.0, we can remove it and adjust the inline comment.

    So that's fine.

NW mainly for #2, although the CR could use some expansion about deprecated properties/stricter property types and etc. as well. Thanks!

xjm’s picture

Saving credits for reviewers.

xjm’s picture

+++ b/core/tests/Drupal/KernelTests/Core/Image/ToolkitGdTest.php
@@ -460,9 +460,9 @@ public function testGifTransparentImages(): void {
+    $gd_mage = $image->getToolkit()->getImage();
+    $color_index = imagecolorat($gd_mage, $image->getWidth() - 1, 0);
+    $color = array_values(imagecolorsforindex($gd_mage, $color_index));

@@ -473,17 +473,17 @@ public function testGifTransparentImages(): void {
+    $gd_mage = $image->getToolkit()->getImage();
+    $color_index = imagecolorat($gd_mage, $image->getWidth() - 1, 0);
+    $color = array_values(imagecolorsforindex($gd_mage, $color_index));

One more thing -- the local variable here is mis-named. While it is kind of magic, I think this should be "image" and not "mage". 🧙‍♂️

_utsavsharma’s picture

StatusFileSize
new4.47 KB
new33.8 KB

Addressed 43.2 and 45.
Please review.

andypost’s picture

Status: Needs work » Needs review
Issue tags: -Needs change record updates

re-queued and updated CR with s/resource/image internal BC break

andypost’s picture

smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs Review Queue Initiative, +Needs issue summary update, +Needs change record updates

The changes in patch #48 look good.

Wonder if we can update the IS and CR with the additional things being deprecated outside the 2 mentioned.

andypost’s picture

Issue summary: View changes
Status: Needs work » Needs review
Issue tags: -Needs issue summary update, -Needs change record updates

Added to summary rename of s/resource/image - there's no other changes

mondrake’s picture

Status: Needs review » Reviewed & tested by the community

the name of the methods on the CR is outdated

andypost’s picture

Issue summary: View changes

ah, yes, s/GdImage/Image - updated IS and CR

+++ b/core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php
@@ -28,11 +28,9 @@
-  protected $resource = NULL;
+  protected ?\GdImage $image = NULL;

@@ -135,12 +178,43 @@ public function setResource($resource) {
+  public function setImage(?\GdImage $image): static {
...
+  public function getImage(): ?\GdImage {
andypost’s picture

Issue summary: View changes
andypost’s picture

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 48: 3265953-48.patch, failed testing. View results

smustgrave’s picture

Status: Needs work » Reviewed & tested by the community

Seems random failure.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 48: 3265953-48.patch, failed testing. View results

andypost’s picture

Status: Needs work » Reviewed & tested by the community
quietone’s picture

I have updated the CR for readability and converted to a table.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

andypost’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php
@@ -112,6 +110,47 @@ public static function create(ContainerInterface $container, array $configuratio
+      @trigger_error('Accessing the \Drupal\system\Plugin\ImageToolkit\GDToolkit::resource property is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use \Drupal\system\Plugin\ImageToolkit\GDToolkit::image instead.', E_USER_DEPRECATED);
...
+      @trigger_error('Setting the \Drupal\system\Plugin\ImageToolkit\GDToolkit::resource property is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use \Drupal\system\Plugin\ImageToolkit\GDToolkit::image instead.', E_USER_DEPRECATED);
...
+      @trigger_error('Checking the \Drupal\system\Plugin\ImageToolkit\GDToolkit::resource property is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use \Drupal\system\Plugin\ImageToolkit\GDToolkit::image instead.', E_USER_DEPRECATED);
...
+      @trigger_error('Unsetting the \Drupal\system\Plugin\ImageToolkit\GDToolkit::resource property is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use \Drupal\system\Plugin\ImageToolkit\GDToolkit::image instead.', E_USER_DEPRECATED);

@@ -120,14 +159,18 @@ public static function create(ContainerInterface $container, array $configuratio
+   * @deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use
...
+    @trigger_error(__METHOD__ . '() is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use \Drupal\system\Plugin\ImageToolkit\GDToolkit::setImage() instead. See https://www.drupal.org/node/3265963', E_USER_DEPRECATED);

@@ -135,12 +178,43 @@ public function setResource($resource) {
+   * @deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use
...
+    @trigger_error(__METHOD__ . '() is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use \Drupal\system\Plugin\ImageToolkit\GDToolkit::getImage() instead. See https://www.drupal.org/node/3265963', E_USER_DEPRECATED);

+++ b/core/tests/Drupal/KernelTests/Core/Image/ToolkitGdTest.php
@@ -532,4 +532,29 @@ public function testGetRequirements(): void {
+    $this->expectDeprecation('Drupal\system\Plugin\ImageToolkit\GDToolkit::setResource() is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use \Drupal\system\Plugin\ImageToolkit\GDToolkit::setImage() instead. See https://www.drupal.org/node/3265963');
...
+    $this->expectDeprecation('Checking the \Drupal\system\Plugin\ImageToolkit\GDToolkit::resource property is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use \Drupal\system\Plugin\ImageToolkit\GDToolkit::image instead.');
...
+    $this->expectDeprecation('Drupal\system\Plugin\ImageToolkit\GDToolkit::getResource() is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use \Drupal\system\Plugin\ImageToolkit\GDToolkit::getImage() instead. See https://www.drupal.org/node/3265963');
...
+    $this->expectDeprecation('Accessing the \Drupal\system\Plugin\ImageToolkit\GDToolkit::resource property is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use \Drupal\system\Plugin\ImageToolkit\GDToolkit::image instead.');
...
+    $this->expectDeprecation('Setting the \Drupal\system\Plugin\ImageToolkit\GDToolkit::resource property is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use \Drupal\system\Plugin\ImageToolkit\GDToolkit::image instead.');
...
+    $this->expectDeprecation('Unsetting the \Drupal\system\Plugin\ImageToolkit\GDToolkit::resource property is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use \Drupal\system\Plugin\ImageToolkit\GDToolkit::image instead.');

needs update to 10.2.0

andypost’s picture

Status: Needs work » Needs review
StatusFileSize
new8.9 KB
new34.11 KB

Updated

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Change looks good. Hopefully can get in early for 10.2

  • longwave committed 3b44eb23 on 11.x
    Issue #3265953 by andypost, quietone, ankithashetty, _utsavsharma,...
longwave’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed 3b44eb23976 to 11.x. Thanks!

quietone’s picture

Published the change record.

Status: Fixed » Closed (fixed)

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

heddn’s picture

Updated the CR to say 10.2 since it doesn't (appear) to have landed in 10.1.