Problem/Motivation
We are seeing this warning message when displaying maps:
Warning: Undefined array key "label" in Drupal\leaflet_views\Plugin\views\style\LeafletMap::getLeafletMaps() (line 30 of modules/contrib/leaflet/src/LeafletSettingsElementsTrait.php).
Proposed resolution
Set null as a the fallback value.
Remaining tasks
Implement.
User interface changes
None.
API changes
None.
Data model changes
None.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | leaflet-prevent_undefined_array_key-3605769-5.patch | 504 bytes | itamair |
Issue fork leaflet-3605769
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3605769-prevent-undefined-array
changes, plain diff MR !76
Comments
Comment #3
liam morlandComment #4
liam morlandCurrent state of merge request.
Comment #5
itamair commentedthanks @liam for rising this up.
This use case might happen when the "'label" property is not defined in the hook_leaflet_map_info().
But in that case better rather than NULL better set the $options[$key] value as the $key itself.
Updated patch attached ...
Comment #7
itamair commentedpatch #5 committed into 10.4.x branch, will be part of the next Leaflet 10.4.10 release.