- 🇺🇸United States xjm
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.
-
+++ 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.
-
+++ 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===
? -
+++ 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? -
+++ 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!
-
- 🇺🇸United States xjm
+++ 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". 🧙♂️
- Status changed to Needs review
over 1 year ago 1:00am 23 March 2023 - 🇫🇷France andypost
re-queued and updated CR with
s/resource/image
internal BC break - 🇫🇷France andypost
Re-roll after 🐛 GD toolkit & operations should catch \Throwable to fail gracefully in case of errors Fixed
- Status changed to Needs work
over 1 year ago 1:42am 26 March 2023 - 🇺🇸United States smustgrave
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.
- Status changed to Needs review
over 1 year ago 6:40pm 27 March 2023 - 🇫🇷France andypost
Added to summary rename of
s/resource/image
- there's no other changes - Status changed to RTBC
over 1 year ago 7:04pm 27 March 2023 - 🇫🇷France andypost
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 {
The last submitted patch, 48: 3265953-48.patch, failed testing. View results →
The last submitted patch, 48: 3265953-48.patch, failed testing. View results →
- last update
over 1 year ago 29,203 pass 34:06 31:13 Running- 🇳🇿New Zealand quietone
I have updated the CR for readability and converted to a table.
- last update
over 1 year ago 29,301 pass - last update
over 1 year ago 29,303 pass - last update
over 1 year ago 29,305 pass - last update
over 1 year ago 29,360 pass - last update
over 1 year ago 29,367 pass - last update
over 1 year ago 29,367 pass - last update
over 1 year ago 29,372 pass - last update
over 1 year ago 29,379 pass - last update
over 1 year ago 29,380 pass - last update
over 1 year ago 29,380 pass, 2 fail - last update
over 1 year ago 29,384 pass - last update
over 1 year ago 29,389 pass - last update
over 1 year ago 29,388 pass, 2 fail - last update
over 1 year ago 29,389 pass - last update
over 1 year ago 29,389 pass - last update
over 1 year ago 29,388 pass, 2 fail 19:06 17:54 Running- last update
over 1 year ago 29,396 pass - last update
over 1 year ago 29,400 pass - last update
over 1 year ago 29,400 pass - last update
over 1 year ago 29,401 pass - last update
over 1 year ago 29,410 pass - Status changed to Needs work
over 1 year ago 9:49pm 2 June 2023 - 🇫🇷France andypost
+++ 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
- Status changed to Needs review
over 1 year ago 6:08pm 5 June 2023 - last update
over 1 year ago 29,417 pass - Status changed to RTBC
over 1 year ago 10:39pm 5 June 2023 - 🇺🇸United States smustgrave
Change looks good. Hopefully can get in early for 10.2
- last update
over 1 year ago 29,435 pass -
longwave →
committed 3b44eb23 on 11.x
Issue #3265953 by andypost, quietone, ankithashetty, _utsavsharma,...
-
longwave →
committed 3b44eb23 on 11.x
- Status changed to Fixed
over 1 year ago 5:46pm 9 June 2023 - 🇬🇧United Kingdom longwave UK
Committed and pushed 3b44eb23976 to 11.x. Thanks!
Automatically closed - issue fixed for 2 weeks with no activity.
- Status changed to Fixed
over 1 year ago 4:32pm 13 September 2023 - heddn Nicaragua
Updated the CR to say 10.2 since it doesn't (appear) to have landed in 10.1.