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.

Issue fork leaflet-3605769

Command icon 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:

Comments

liam morland created an issue. See original summary.

liam morland’s picture

Assigned: liam morland » Unassigned
Status: Active » Needs review
liam morland’s picture

Current state of merge request.

itamair’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new504 bytes

thanks @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 ...

  • itamair committed 98bb4e22 on 10.4.x
    fix: #3605769 Prevent "Undefined array key" warning in...
itamair’s picture

Status: Reviewed & tested by the community » Fixed

patch #5 committed into 10.4.x branch, will be part of the next Leaflet 10.4.10 release.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.