This module is very useful and so I have installed it to test out. I followed Readme instructions which mostly worked fine, certainly for displaying the map for field display all worked well.

However I had trouble getting the view working as it kept telling me I had not got a country field in my view, I tried various things renaming and recreating field, adding display again and adding field over again etc, but nothing helped.

There is a similar issue in leaflet module queue with a patch here:
https://www.drupal.org/node/2839538

I noticed similar code in this module - so also changed Field to EntityField, as in this patch, and bingo it works!

Line 162 of modules/leaflet_countries/src/Plugin/views/row/LeafletCountry.php changed:

//      if (is_a($handler, 'Drupal\views\Plugin\views\field\Field')) {
      if (is_a($handler, 'Drupal\views\Plugin\views\field\EntityField')) {
CommentFileSizeAuthor
#3 views_not_regonising_field-2906645-3.patch872 bytestanc

Comments

gsquirrel created an issue. See original summary.

tanc’s picture

Assigned: Unassigned » tanc
Priority: Normal » Major
Status: Active » Needs review

Great! Thanks so much for testing and feeding back. I'm pressed for time to work on this module at the moment but when I do I'll test your code change and let you know. Thanks again!

tanc’s picture

StatusFileSize
new872 bytes

Finally! I have some time for this module. Here is a patch of your change.

  • tanc committed b9ba025 on 8.x-1.x
    Issue #2906645 by tanc, gsquirrel: Views not recognising field
    
tanc’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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