Hi!

I'm getting this error

Notice: Undefined index: entity in leaflet_apply_map_settings() (line 396 of (...)leaflet/leaflet.formatters.inc).
    EntityMalformedException: Missing bundle property on entity of type taxonomy_term. in entity_extract_ids() (line 7697 of (...)/includes/common.inc).

when using Leaflet formatter.

I think it is related to:

Line 381:

 // Unset the entity here so it does not get returned to the client in JS.
    unset($feat['entity']);

Line 394:

    // Apply Icon settings:
    if ($icon == 'html') {
      $icon_field = field_view_field($entity_type, $feat['entity'], $settings['icon']['html'], array('label' => 'hidden'));

$feat['entity'] is unset, but later it's required in order to perform field_view_field, to get marker's icon.

What can we do here? I guess removing the "unset" line, but I don't know what can happen if I do that.

CommentFileSizeAuthor
#1 fix-undefined-entity-2174091-1.patch789 bytesm0d

Comments

m0d’s picture

StatusFileSize
new789 bytes

Ok, here's a patch! :)

c-c-m’s picture

Status: Active » Needs review
tormi’s picture

I believe this commit was supposed to solve the issue: http://drupalcode.org/project/leaflet.git/commit/3bacba3

gcb’s picture

Status: Needs review » Closed (fixed)

Yes, that commit fixes the issue.