Problem/Motivation

The Thumbnail image style is resetted to "None (Original Image)" after updating to 5.x.
In this case it happens within layout builder, using the regular "Photoswipe" formatter:

We had another case where the "modal image style" was resetted also, but its not confirmed that this was related to the 5.x update.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
photoswipe_formatter_reset.png20.11 KBthomas.frobieter

Issue fork photoswipe-3389591

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

thomas.frobieter created an issue. See original summary.

anybody’s picture

Assigned: grevil » Unassigned
Priority: Major » Normal

Someone please needs to find out, if this only happens for formatters within layout builder or also happens for regular entity formatters.

photoswipe_update_9003()
is responsible for updating the field formatters.

So could someone please provide details, when this happens and when not?

anybody’s picture

Assigned: Unassigned » grevil

My bet is, that this is "just" an issue with layout builder. Layout builder leads to different structures in the entity displays that need to be handled.

Luckily I found some other projects that had similar issues and code:

Guess we can be quite sure such a solution needs to be adopted?

anybody’s picture

Title: Photoswipe field formatter settings are resetted after updated from 4.x to 5.x (in Layout Builder) » Photoswipe field formatter settings are reset in Layout Builder updating from 4.x to 5.x

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

grevil’s picture

Ok, I just tested this, and indeed the formatter settings are only still there for entities NOT using Layout Builder. Any entity using layout builder will have all of their formatter settings reset (except "Photoswipe modal image style" for some reason).

grevil’s picture

Status: Active » Needs review

Fixed and tested, works like a charm!

grevil’s picture

Assigned: grevil » anybody

anybody’s picture

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

Nice work @Grevil! I left some final comments to make it more bulletproof. Afterwards please test it one last time and I'll do the final review!

anybody’s picture

Assigned: grevil » anybody
Status: Needs work » Needs review
anybody’s picture

Status: Needs review » Reviewed & tested by the community

Very well done!

anybody’s picture

Assigned: anybody » Unassigned

  • Anybody committed 53801261 on 5.x
    Issue #3389591 by Grevil, thomas.frobieter, Anybody: Photoswipe field...
anybody’s picture

Status: Reviewed & tested by the community » Fixed
anybody’s picture

Assigned: Unassigned » grevil
Status: Fixed » Needs work

Seems we were too quick:

[notice] Update started: photoswipe_update_9005
[warning] Undefined array key "photoswipe_caption" photoswipe.install:276
[warning] Undefined array key "photoswipe_caption_custom" photoswipe.install:277
[warning] Undefined array key "photoswipe_node_style" photoswipe.install:284
[warning] Undefined array key "photoswipe_node_style_first" photoswipe.install:285
[notice] Update completed: photoswipe_update_9005

and in one case photoswipe_caption: 'alt' was modified to null

  • Anybody committed e6ce59fd on 5.x
    Issue #3389591 by Grevil, Anybody, thomas.frobieter: Photoswipe field...
anybody’s picture

Assigned: grevil » Unassigned
Status: Needs work » Fixed

Fixed, I'll tag 5.0.0-beta1 now!

Status: Fixed » Closed (fixed)

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