- Issue created by @ben.campbell
- πͺπ¨Ecuador jwilson3
@ben.campbell, does rebuilding all caches after updating, as indicated in the 2.3.4 release notes β resolve the problem?
- πͺπ¨Ecuador jwilson3
@ben.campbell, thanks for the feedback. Can you tell me a little more about your setup please.
Verify plugin file location Confirm the Svg.php file is in the correct location according to the namespace. If installed via composer with a conventional Drupal composer installation the file should be located in web/modules/custom/svg_image_field/src/Plugin/media/Source/Svg.php (the top-level folder "web" might instead be called "docroot" or something similar, or in some rare cases may not even be present).
Confirm case-sensitive filesystem: Are you running on an operating system that leverages a case sensitive filesystem like Windows or Mac?
Confirm title-case filename: Please verify that the filename is exactly
Svg.php
and notSVG.php
, noting correct capitalization of the first letter only. This file is located atmodules/contrib/svg_image_field/src/Plugin/media/Source/Svg.php
. The 'svg' MediaSource plugin not being found could be related to the file's case not getting changed properly in the version upgrade to 2.3.4.Rebuild composer's autoload files. Run a
composer dump-autoload
. Then anotherdrush cache:rebuild
, and then check again to see if the problem goes away.Check file permissions:. Ensure the Svg.php file has proper read permissions and can be read by the webserver with:
chmod 644 web/modules/custom/svg_image_field/src/Plugin/media/Source/Svg.php
Check for stale cache files: Sometimes old cached versions of the plugin definition can persist. Please check and clear:
sites/default/files/php/twig/* sites/default/files/php/*
- πͺπΈSpain penyaskito Seville π, Spain πͺπΈ, UTC+2 πͺπΊ
jwilson3 β credited penyaskito β .
- πͺπ¨Ecuador jwilson3
The workaround for version 2.3.4 of this module is to completely remove the old module, and re-add it, to get the new version of the file name.
composer remove drupal/svg_image_field composer install drupal/svg_image_field
This approach may not be practical for all users, especially if you depend on a continuous integration process and a separate server to build your composer dependencies for deployment.
Therefore, after discussion with @cmlara and @penyaskito Drupal contributors in the #maitainers channel on Drupal Slack, we think the solution architecture for a proper fix is to completely rename the plugin file to
ScalableVectorGraphic.php
, to avoid the case sensitivity issue, and to add class aliases for the old versions of the fileSVG.php
andSvg.php
. - Merge request !41Issue #3516563 by jwilson3, cmlara, penyaskito: Rename ScalableVectorGraphic media source plugin β (Open) created by jwilson3