Problem/Motivation

On certain entities the following error appears:

Error: Call to a member function transformDimensions() on null in Drupal\photoswipe\PhotoswipePreprocessProcessor->getPath() (line 146 of modules/contrib/photoswipe/src/PhotoswipePreprocessProcessor.php).

I guess it happens if the image file is missing or broken.

Should we maybe handle or catch this issue otherwise or simply let this happen?

I don't really think this is a bug in Photoswipe itself. Also see the related issues.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#2 photoswipe-3466284.patch780 bytessarwan_verma

Issue fork photoswipe-3466284

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Anybody created an issue. See original summary.

sarwan_verma’s picture

Status: Active » Needs review
StatusFileSize
new780 bytes

Hi,
I have resolved the 'member function transformDimensions' issue and also attached a patch.
Kindly review and verify.

Thanks!

anybody’s picture

Status: Needs review » Needs work

Thanks @sarwan_verma please use a patch Please use a MR.

anybody’s picture

And I think we shoud log this as error, as we're skipping execution? Perhaps also add something to the message like: "Image could not be processed for photoswipe"? (to be improved)

anybody’s picture

Status: Needs work » Reviewed & tested by the community

Thanks! Let's do it just like in the lines above.

anybody’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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