Using the latest dev I have created a view of IP geolocations and included all the available fields for testing. In my case the a suburb field includes an apostrophe ' in the suburb name. The apostrophe is returned as the html code for an apostrophe.

In my case specifically:

The correct suburb name is "Coeur d'Alene".
The value returned by IPGV&M is "Coeur d'Alene"

Please let me know if you need any more information. Love your module!

Comments

rdeboer’s picture

Hi Levi,
Glad you like the module.
I'd like to pinpoint your statement value returned by IPGV&M is ... a bit more...

Do you mean that the HTML codes appear in
a) marker balloons
b) marker tags
c) marker tooltips
d) somewhere else ?

Which map style are you using in Views?
1) Map (Google, via IPGV&M)
2) Map (Leaflet, via IPGV&M)
3) Map (OpenLayers, via IPGV&M)

Did you use Views' "Rewrite output" and token replacement?

If at all possible, a screenshot would be great.

Rik

rdeboer’s picture

StatusFileSize
new243.79 KB

So I've done some experimenting, but can't reproduce your case on my system. See screenshot below.

Does some input filter get applied to the content field in question in your case?

Apostrophe in IPGV&M map

LeviThomason’s picture

Rik,

It took me a while to reproduce this myself, but I finally did so. My first description of the issue was far too vague. Let me try again here beginning with the steps to reproduce the issue:

  1. Download and install IPGV&M 7.x-1.22+5-dev
  2. Create a view of 'IP Geolocations' OR 'Access log'
  3. Add fields 'IP Geolocation: Suburb" OR 'IP Geolocation: Address'
  4. Use any display formatter you like, unformatted list works fine
  5. Here's the catch, visit your site from a city with an apostrophe in its name (I can provide this if you give me an web address to visit)
  6. Now check the value of the suburb name in the view and you will see the apostrophe is returned by its HTML code of '

Since I could not remember how to create this issue myself I ended up testing and confirming IPGV&M does in fact display apostrophes correct. I tried entering Coeur d'Alene as for the city in both Address Field and Location, then displaying them in IPGV&M Leaflet map formatter and a regular Views grid formatter. I then tried indexing those fields as both String and Full Text using Search API Solr and displaying the indexed fields in IPV&M as well as grid. In all cases the apostrophe is returned correctly, as an apostrophe.

Once finding the issues only occurs with reverse geocoded ip addresses. I have set my suspicions on the process responsible for that. By default my configuration options for IPGV&M have checked:

[X] Employ the Google Maps API to reverse-geocode HTML5 visitor locations to street addresses
[X] Employ Smart IP as a backup to the Google Maps JS API as well as declined or failed HTML5 location retrievals in Views

Note, I do not have Smart IP nor GeoIP modules installed.

Lastly, here are screenshots of a View of IP Geolocations with the field 'IP Geolocations: Suburb' added and formatted as list and map. The data shown is from a visit I performed by remote control to a computer in Coeur d'Alene, ID.

map view
list view

Hopefully that helps. Let me know how else I can help track this down.

Thanks Again,
Levi

rdeboer’s picture

Hi Levi,
So sorry this fell between the cracks

I believe your symptoms may stem from the fact that IPGV&M puts reverese-geocoded addresses through the utf8_encode function before storing these on the database. I added the encoding function because there was an issue reported that the database failed to insert addresses with special symbols, as occur in certain languages: #1793674: SQLSTATE[HY000]: General error: 1366 Incorrect string value.

I suggest you edit file ip_geoloc_api.inc and comment out these 2 lines (#58,59):

      $location['city'] = utf8_encode($location['city']);
      $location['formatted_address'] = utf8_encode($location['formatted_address']);

That is, put double slashes in front of both lines:

      //$location['city'] = utf8_encode($location['city']);
      //$location['formatted_address'] = utf8_encode($location['formatted_address']);

and see what happens.
Should you get the message "IPGV&M: could not save location to db ...." then you'll have to switch back or we need to find an alternative to utf8_encode

Rik

rdeboer’s picture

Issue summary: View changes
Status: Active » Closed (fixed)
danthorne’s picture

Was there ever a solution to this issue? Commenting out the 2 lines stops the module from locating the user.