open-y-subprojects / openy_custom

Custom modules from Open Y core. Decoupled for ability to use outside of Open Y when needed.
GNU General Public License v3.0
0 stars 14 forks source link

"Failed to open stream ..." when svg file is missing #4

Closed froboy closed 2 years ago

froboy commented 2 years ago
Message | Warning: file_get_contents(public://strength-equipment.svg): Failed to open stream: "Drupal\Core\StreamWrapper\PublicStream::stream_open" call failed in Drupal\openy_svg_formatter\Plugin\Field\FieldFormatter\OpenYSvgFormatter->viewElements() (line 46 of /var/www/html/docroot/modules/contrib/openy_custom/openy_svg_formatter/src/Plugin/Field/FieldFormatter/OpenYSvgFormatter.php)

These sorts of warnings can be thrown when SVGs are missing. There is a long-standing Drupal issue related to this but it seems to have been forgotten: https://www.drupal.org/project/drupal/issues/1803330. We can fix it ourselves here while we wait.