Problem/Motivation

When updating a Drupal 10 site to the newest version of the module (5.0.11), opening pages where photoswipe is active produces a fatal error, and a WSOD. This is at least partially caused by usage of a class that is not present in Drupal 10 and lower.

One example is the usage of the "ImageDerivativeUtilities" class in src/Plugin/Field/FieldFormatter/PhotoswipeFieldFormatter.php. This class does not exist in Drupal 10 and lower.

Steps to reproduce

Install Photoswipe 5.0.11 on a Drupal 10 site, use it on a field, and open the page.

Proposed resolution

As a temporary fix, downgrade to Photoswipe 5.0.10 and fix the version in composer (composer require 'drupal/photoswipe:5.0.10), or do not upgrade from 5.0.10

Thanks,
Mark.

Issue fork photoswipe-3629506

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

cpdp created an issue. See original summary.

nicodh’s picture

I attach a patch that fixes this issue (use ImageDerivativeUtilities::styleOptions() if present D11+, image_style_options() if not).

nicodh’s picture

Status: Active » Needs review
apotek’s picture

We just ran into this issue too. Site whitescreened. Minor patch version updates really shouldn't drop compatibility with a Drupal version.

Thank you @nicodh for the patch.

steveoriol’s picture

Status: Needs review » Reviewed & tested by the community

The patch works for me.

anybody’s picture

Status: Reviewed & tested by the community » Needs work

Please prepare this as MR, we'll merge it then, once tests go green.

anybody’s picture

Assigned: Unassigned » grevil

grevil made their first commit to this issue’s fork.

grevil’s picture

Minor patch version updates really shouldn't drop compatibility with a Drupal version.

Thanks for this great information!

grevil’s picture

Assigned: grevil » Unassigned
Status: Needs work » Needs review

Please review

anybody’s picture

Status: Needs review » Reviewed & tested by the community

  • anybody committed c4f7d025 on 5.x authored by grevil
    fix: #3629506 Update 5.0.11 breaks Drupal 10 compatibility
    
anybody’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

anybody’s picture

Assigned: Unassigned » grevil
Status: Fixed » Needs work
Issue tags: +Needs tests

@grevil:

Please see #3623808: You have requested a non-existent service "Drupal\image\ImageDerivativeUtilities". - is that approach superior or is it good enough like this?
Anyway I wonder why our tests didn't catch this! We should add one to see this in the future, before breaking things!

grevil’s picture

Issue tags: -Needs tests

@anybody it is basically the same outcome, but generally speaking, the DeprecationHelper is code wise cleaner yea.

But not really worth changing again IMO. Although the tests started to fail after rebase?

grevil’s picture

Assigned: grevil » Unassigned
Status: Needs work » Fixed

Ok, all green in dev!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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