Toolbar customizations not applied when calendar block is embedded via viewsreference

Created on 14 April 2025, 11 days ago

Problem/Motivation

When embedding a block that uses the FullCalendar format, customizations to the Toolbar settings are not applied.

This appears to be caused by the preView() method being called multiple times. On the second run, the flattenMultidimensionalArray() method flattens the existing $options array, breaking the data model that the javascript plugin expects.

Adding a check to see if $settings['options'] already exists ensures the settings are passed as expected to the frontend.

Steps to reproduce

  1. Install the FullCalendar and viewsreference β†’ modules
  2. Add a viewsreference field to a content type
  3. Create a view that uses the FullCalendar format with a block display using the default display settings
  4. Embed the view via the viewsreference field
  5. Visit the page, and see the calendar does not have 'month', 'week', or 'year' buttons, and that the title is not centered

Proposed resolution

Updating the preView method to see if $settings['options'] already exists prevents the options from being flattened.

πŸ› Bug report
Status

Active

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States briantschu West Orange, NJ

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

Merge Requests

Comments & Activities

  • Issue created by @briantschu
  • Merge request !60Check if options is already set β†’ (Open) created by briantschu
  • Pipeline finished with Failed
    11 days ago
    Total: 154s
    #473260
  • Pipeline finished with Failed
    11 days ago
    Total: 138s
    #473278
  • Pipeline finished with Success
    11 days ago
    Total: 142s
    #473279
  • πŸ‡ΊπŸ‡ΈUnited States briantschu West Orange, NJ

    The merge request is ready for review. I'm also attaching a patch file so I can deploy these changes in the meantime.

Production build 0.71.5 2024