With last Leaflet module version I have two warnings at every LeafletDefaultFormatter rendering.

Warning: count(): Parameter must be an array or an object that implements Countable в Drupal\leaflet\Plugin\Field\FieldFormatter\LeafletDefaultFormatter->viewElements() (line 344 ...

And the same for line 343

These line contains the following code:

$settings['icon']['iconUrl'] = count($settings['icon']['iconUrl']) > 0 ? $this->token->replace($settings['icon']['iconUrl'], $token_context) : '';
        $settings['icon']['shadowUrl'] = count($settings['icon']['shadowUrl']) > 0 ? $this->token->replace($settings['icon']['shadowUrl'], $token_context) : '';
        

Obviously, 'count' should be replaced by 'strlen'.

Comments

gun_dose created an issue. See original summary.

gun_dose’s picture

StatusFileSize
new1.16 KB

And this is patch to fix this.

itamair’s picture

StatusFileSize
new1.16 KB

Thanks @gun_dose perfectly right. But for sake of uniformity (with the Leaflet View Display style) let's use this attached patch instead.

  • itamair committed 1f2c5d7 on 8.x-1.x authored by gun_dose
    Issue #3041987 by gun_dose, itamair: Watchdog warnings "Warning: count...
itamair’s picture

just committed into dev, will be part of the next release ...

itamair’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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