Undefined array key 'weight' breaks Views editing

Created on 4 December 2024, 6 months ago

Problem/Motivation

After creating a new View which renders a Leaflet map, it is not possible to edit the map settings in the view. An ajax error is thrown in the console.

Steps to reproduce

  • Add a new Views
  • Set the the Layout to 'Leaflet Map'
  • Save the view
  • Try to edit the map settings under Layout

Proposed resolution

The following error is thrown: Warning: Undefined array key \"weight\" in /var/www/html/web/modules/contrib/leaflet/src/LeafletSettingsElementsTrait.php on line 418

After investigation, there is no value weight set in the getDefaultSettings() function, if the weight value is missing. Attached patch fixes this problem.

🐛 Bug report
Status

Active

Version

10.2

Component

Code

Created by

🇳🇱Netherlands mrcdrx

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

Comments & Activities

Production build 0.71.5 2024