Dynamic caption settings not applied

Created on 3 April 2025, 3 days ago

Problem/Motivation

When dynamic caption settings are changed, they have no effect when viewing a page.

Steps to reproduce

  1. Enable the BigPipe module (enabled by default in the standard profile)
  2. On /admin/config/media/photoswipe_dynamic_caption, change "Caption Position" to "Below".
  3. View a Photoswipe page.

Result: the caption still appears to the right of the image, not below it.

Proposed resolution

When a page is initially loaded, Drupal.behaviors.photoswipeCaption deletes the caption options from drupalSettings, so the options are empty during all subsequent executions of attach(). The caption options should be stored so they can be applied every time attach() is called, not just the first time.

🐛 Bug report
Status

Active

Version

5.0

Component

Code

Created by

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024