Closed (fixed)
Project:
Media Thumbnails SVG
Version:
3.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
24 Mar 2026 at 13:11 UTC
Updated:
23 May 2026 at 18:35 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
danrodComment #3
danrodI'll have to port this to the 3.x branch as well.
Comment #5
sapnil_biswas commentedStarting to work on this
Comment #7
sapnil_biswas commentedmarking this as needs review please let me know if there is requirement for any further changes
Comment #8
danrodComment #9
vinodhini.e commentedHi, Tested this module on Drupal 11.2.5 and ran coding standards (PHPCS and PHPStan).
After applying MR !7, I re-ran the checks, but issues are still being reported.
PHPCS warnings:
File: src/Hook/MediaThumbnailsSvgHooks.php
Line 21: t() call used in class; should use StringTranslationTrait and $this->t()
Line 22: t() call used in class; should use StringTranslationTrait and $this->t()
PHPStan errors:
File: src/Plugin/MediaThumbnail/MediaThumbnailSVG.php
Line 24: Extends unknown class MediaThumbnailBase
Line 50: Unknown class FileRepositoryInterface
Line 55: Invalid return type MediaThumbnailBase
Line 56: Calls parent::create() but no valid parent class
Line 73: Undefined property $fileSystem
Line 75: Undefined property $logger and undefined method t()
Line 84: Function _media_thumbnails_svg_has_graphics_magick not found
Line 87: Function _media_thumbnails_svg_has_image_magick not found
Line 100: Class FileInterface not found
Line 170: Unknown class SVG\SVG
Lines 172, 188, 195, 216: Undefined property $logger and undefined method t()
Please refer to the detailed error output above. The MR does not fully resolve the coding standard issues yet. Thanks.
Comment #10
sapnil_biswas commentedThanks @vinodhini.e for testing this out. I have resolved all the remaining warnings checked locally and the pipeline is green now
Comment #11
vinodhini.e commentedHi, @sapnil_biswas,
Applied the patch and re-ran PHPCS. No errors are reported, and it is working as expected. Thanks.
Comment #12
danrodI tested this on my D11.3 instance and works as expected (screen attached) moving this to RTBC.
Comment #13
danrodComment #15
danrodI had to revert the file
media_thumbnails_svg.info.ymlto support older Drupal versions in the 2.x branch.I also changed the file MediaThumbnailSVG.php to use the constant FileSystemInterface::EXISTS_REPLACE to support older Drupal versions
Tested on a D10 instance, worked without issues.
I'll port this to the 3.x branch.
Comment #17
danrodPorted to 3.x and tested on a D11.2 instance, with no issues, I'll mark this as Fixed. Thanks a lot everyone !
Comment #18
danrod