WSOD with:

Call to a member function getCacheTags() on null in Drupal\svg_image\Plugin\Field\FieldFormatter\SvgImageFormatter->viewElements() (line 102 of modules/contrib/svg_image/src/Plugin/Field/FieldFormatter/SvgImageFormatter.php).

Occurs if an image style was selected that doesn't exist anymore.

So I guess in these lines it should be checked, if the image style could be loaded, before proceeding:

$cacheTags = [];
    if (!empty($imageStyleSetting)) {
      $imageStyle = $this->imageStyleStorage->load($imageStyleSetting);
      $cacheTags = $imageStyle->getCacheTags();
    }
CommentFileSizeAuthor
#6 3069658.patch660 bytesbatkor
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Anybody created an issue. See original summary.

imyaro’s picture

Assigned: Unassigned » imyaro

  • zvse committed d18ca07 on 8.x-1.x
    Issue #3069658 by Anybody, zvse: Call to a member function getCacheTags...
imyaro’s picture

Status: Active » Fixed

Hello!
Thank you for your contribution.
I've added fix into the dev branch, release coming soon.

Status: Fixed » Closed (fixed)

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

batkor’s picture

FileSize
660 bytes

New release not created.
This patch help you now.

Anybody’s picture

New stable release would be very helpful @zvse. Thank you very much for your work on this.