Mutliple Timeline blocks on one page not supported

Created on 18 February 2025, 2 months ago

Problem/Motivation

In Drupal 7 we were able to place two Timelines on the same page without issues. Since upgrading to Drupal 10, we have been unable to load the second timeline.

Steps to reproduce

Place two Views Timeline blocks on the same page, only the first one will render the timeline.

Proposed resolution

When I debugged this issue, there was only data for one block in the drupalSettings variable. It seems that when the data is being prepared inside template_preprocess_views_timelinejs_view_timelinejs(), the attached data is not being preserved.

This is an indexed array. When I change this to use the ID for each array key, the data for both blocks comes through into drupalSettings.

I will create an issue fork and merge request shortly. This will contain the changes to the template_preprocess hook and to the Javascript.

πŸ› Bug report
Status

Active

Version

4.1

Component

Code

Created by

πŸ‡¦πŸ‡ΊAustralia akoepke

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