Problem/Motivation

When updating from 2.3.3 to 2.3.4 on D10.4.2, I got the message:

Drupal\Component\Plugin\Exception\PluginException: Plugin (svg) instance class "Drupal\svg_image_field\Plugin\media\Source\SVG" does not exist. in Drupal\Component\Plugin\Factory\DefaultFactory::getPluginClass() (line 97 of core/lib/Drupal/Component/Plugin/Factory/DefaultFactory.php).

Proposed resolution

Donwgrade to 2.3.3

Comments

webmestre created an issue. See original summary.

jwilson3’s picture

I believe this is an expected issue with the cache. We renamed a php class from SVG.php to VectorImage.php Svg.php in order to pass phpstan requirements from GitLab CI on the Drupal infrastructure.

@webmestre After rebuilding the Drupal cache, does the error go away?

jwilson3’s picture

Status: Active » Postponed (maintainer needs more info)
webmestre’s picture

Hi @jwilson3,
I could'nt reproduce the issue after emptying the cache.
Shoud be good now.

jwilson3’s picture

Priority: Critical » Normal
Status: Postponed (maintainer needs more info) » Closed (works as designed)

Thank you @webmestre for confirming this.

It is a good practice to both rebuild caches (and run database updates) any time you update modules.

I will update the release notes of 2.3.4 to ensure people know they should clear caches.

tasc’s picture

A little confusion here..
I can't see that class VectorImage.php, however a class being renamed from SVG.php to Svg.php?

454081d3

jwilson3’s picture

Thanks @tasc for keeping me honest and tracking down the change. I misremembered what we named it, got confused with a totally unrelated change (dd086f0). Will update the release notes accordingly.

jwilson3’s picture

A related issue was reported in #3516563: Drupal\Component\Plugin\Exception\PluginException: The plugin (svg) did not specify an instance class.. I **think** it would also be resolved with a cache rebuild, but needs confirmation from those experiencing the issue to confirm.

jwilson3’s picture

Anyone affected by this issue is recommended to please help test the fix on the other issue by upgrading (if only temporarily) to the 2.3.x-dev branch in composer, clear cache, and confirm the errors are no longer present. If I dont get feedback in 2 weeks, I'm going to cut a release with the fix that casts the net to the wider community using the module. If you're on a case-insensitive file system like Windows, I request your assistance to verify there are no more issues here.

See Issue #3516563