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
| Comment | File | Size | Author |
|---|---|---|---|
| photoswipe_formatter_reset.png | 20.11 KB | thomas.frobieter |
Issue fork photoswipe-3389591
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
Comment #2
anybodySomeone 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?
Comment #3
anybodyMy 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?
Comment #4
anybodyComment #6
grevil commentedOk, 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).
Comment #7
grevil commentedFixed and tested, works like a charm!
Comment #8
grevil commentedComment #10
anybodyNice 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!
Comment #11
anybodyComment #12
anybodyVery well done!
Comment #13
anybodyComment #15
anybodyComment #16
anybodySeems we were too quick:
and in one case photoswipe_caption: 'alt' was modified to null
Comment #18
anybodyFixed, I'll tag 5.0.0-beta1 now!