Getting the above error and always shows
"None of the 32 result rows in view Search Node (Attachment) had their field_location_coordinate_lat set. Therefore those rows could not be displayed as locations on the map. Are you using the correct field names?"

Confirmed correct field name as the same longitude and latitude fields are displayed.

Comments

ckng created an issue. See original summary.

rdeboer’s picture

Using Google, Leaflet or OpenLayers API's?

ckng’s picture

Google.

ckng’s picture

Issue summary: View changes
StatusFileSize
new68.17 KB

Tested with
- dev and 7.x-1.28
- Google map and Leaflet map

All combinations having the same issue. Longitude and latitude are returned from Search API Solr, which have the correct data.

rdeboer’s picture

Thanks for trying all those combinations... .that would have taken you a while...
Thanks also for the screenshot. From it I can see...... Search API is causing troubles again....

When Search API is involved, Views returns its results in a different format.

I thought I had most formats covered.... Apparently not this one....

Sigh...

Need to think about how to progress this. Best would be to have your site or something very similar on my laptop so I can run Xdebug....
I just takes a while to set up Search API, Solr (if that is what you are using) etc...

ckng’s picture

StatusFileSize
new6.09 KB

That would be rather tedious to replicate the setup.

Attached is a patch that add support for Search API. However, I'm not sure if there are other ways the result could be returned. It works for my case.

Potential code that would break existing implementation is

<?php
@@ -641,7 +641,7 @@ function ip_geoloc_plugin_style_extract_locations($views_plugin_style) {

   foreach ($latitudes as $latitude) {
     if (isset($view->field[$latitude])) {
-      $loc_field_names[] = $view->field[$latitude]->definition['field_name'];
+      $loc_field_names[] = $view->field[$latitude]->field;
       $loc_field_aliases[] = $view->field[$latitude]->field_alias;
       // Example: $loc_field_name == 'field_geo'; $loc_field_alias == 'nid';
     }
?>

_ip_geoloc_plugin_style_get_base1(), _ip_geoloc_plugin_style_get_base2(), _ip_geoloc_plugin_style_extract_lat_lng() all looks rather hackish, are there better way?

ckng’s picture

Status: Active » Needs review
ckng’s picture

The patch is working for Leaflet map. Getting error for Gmap in ip_geoloc_output_map_multi_location(), I believe due to bad lat/long passed. Likely need to add some checking there. Will update the patch.

ckng’s picture

StatusFileSize
new5.2 KB

Updated the patch that works for both Gmap and Leaflet. Not map specifically, but due to invalid lat/long in the results.

rdeboer’s picture

Title: Notice: Undefined index: field_name in ip_geoloc_plugin_style_extract_locations() (line 644 of ip_geoloc/views/ip_geoloc_plugin_style.inc). » Search API Notice: Undefined index: field_name in ip_geoloc_plugin_style_extract_locations() (line 644 of ip_geoloc/views/ip_geoloc_plugin_style.inc).
rdeboer’s picture

marc.groth’s picture

I can confirm that I too was having the exact same problem, and that the patch in #9 fixed the issue (thanks a lot ckng).

For some reason I had to apply the patch manually, but I think it's more to do with my set up than the patch itself (kept getting a 'invalid path' error when using SourceTree to attempt to apply the patch automatically).

For what it's worth, I am using the 'Map (Leaflet API, via IPGV&M)' display option for a Solr index view. I have another similar view that just uses standard Drupal nodes (i.e. not a Solr index) that has no problems; so the issue seems to be specific to Solr in this case.

Marking this as reviewed/tested.

marc.groth’s picture

Status: Needs review » Reviewed & tested by the community
rdeboer’s picture

@mark.groth

Thanks for confirming and for providing details regarding the exact circumstances.
This all adds up to further evidence that I should apply @ckng's patch soon!

Thanks to you both!

Rik

rdeboer’s picture

Patch applied. Sorry for the delay. Better late than never, I guess.
Thanks Marc, and ckng.
Rik

  • RdeBoer committed 93d3573 on 7.x-1.x authored by ckng
    Issue #2603450 by ckng, RdeBoer: Search API Notice: Undefined index:...
rdeboer’s picture

Assigned: Unassigned » rdeboer
Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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

pyxio’s picture

I have the same issue. I am using search api with database server. i have tried both 7.x-1.30 and dev version. I tried to apply the patch and it would not apply, I checked the code and see it was already committed. so in my case, it is not yet resolved. cheers.