Using a media entity reference field referencing a non existent image file, will throw an error

Created on 8 August 2023, over 1 year ago
Updated 9 August 2023, over 1 year ago

Problem/Motivation

This is a follow-up issue to 🐛 Using a media entity reference field in combination with the "Photoswipe" display option throws an error Fixed . Currently, if we use a media reference field using the photoswipe formatter and referencing a non-existent image, the following error gets thrown:

Error: Call to a member function getFileUri() on null in Drupal\photoswipe\ImageDTO->__construct() (line 113 of modules/contrib/photoswipe/src/ImageDTO.php).

Steps to reproduce

Proposed resolution

Fix the issue.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

5.0

Component

Code

Created by

🇩🇪Germany Grevil

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024