TypeError: Unsupported operand types: array + null in photoswipe_dynamic_caption_photoswipe_js_options_alter() (line 48 of modules/contrib/photoswipe/modules/photoswipe_dynamic_caption/photoswipe_dynamic_caption.module).

Created on 10 October 2023, about 1 year ago

Problem/Motivation

If the mandontory field "Caption position" is empty both photoswipe field formatters throw this error.

See this code (photoswipe/modules/photoswipe_dynamic_caption/photoswipe_dynamic_caption.module):

function photoswipe_dynamic_caption_photoswipe_js_options_alter(array &$settings) {
  $options = $settings['captionOptions'] ?? [];
  // Make sure that users can override options.
  $settings['captionOptions'] = $options + \Drupal::config('photoswipe_dynamic_caption.settings')->get('options');
}

I think "auto" should be the default value here.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

๐Ÿ› Bug report
Status

Fixed

Version

5.0

Component

Code

Created by

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

Comments & Activities

Production build 0.71.5 2024