I'm using the Set My Location block on the homepage of my site. IPGV&M is configured to use a Maxmind lookup with the Google HTML5 fallback. When the HTML5 Location comes in, the Set My Location block refreshes and the user's specific location is displayed. In the console, ip_geoloc_current_location.js reports the time it took to locate the visitor and reverse geocode the address. Immediately after that ip_geoloc_current_location.js logs an error that reads

IPGV&M, ip_geoloc_current_location.js parsererror: SyntaxError: Unexpected end of input (200)

The error is being thrown by the AJAX call in the callbackServer function on line 94 of ip_geoloc_current_location.js, and prevents any other JS from executing on the Set My Location block. I have also tried version 7.x-1.28 and received the same error.

Comments

rdeboer’s picture

Hi Drew,

Thanks for your report.

"IPGV&M is configured to use a Maxmind lookup with the Google HTML5 fallback". You mean
"IPGV&M is configured to use the Google HTML5 lookup with Maxmind as a fallback"?

Not that it matters, as it sound like it doesn't get to the fallback...

This is the first time I've heard of this error. Wondering whether it's the data? Is it location dependent? Or does it always happen no matter where you are? I'm wondering whether the code doesn't properly escape "funny" characters in the location string.

Does the error happen when you press "Find me" or do you have the periodic HTML5 repeat on as well? Just wondering what it is that triggers it.

Rik

drewble’s picture

Rik,

Thanks for your help!

Sorry about getting my wording mixed up on which service is the fallback. You have it right.

I don't think that this error is location dependent. I have been traveling a lot over the last few weeks and I have received the same error in every location. The error also happens when I press "find me." The odd thing to me is that the block and the data all work and come through properly, but an error is thrown at the very last second. I have tried debugging in that function to see at what point the error is thrown, but all I have been able to determine is that it happens in the jQuery.ajax call of the callbackServer function.

rdeboer’s picture

Hi Drew,
Well at least it doesn't seem to affect functionality.
Still, strange...
I haven't heard about this error before... So am at a loss. Interference with... yeah with what?
Maybe someone else out there in the community finds this issue and has a clue...
Not sure where to start at the mo'... and do not have a reproducible test-case on my laptop.
Rik

mariano.barcia’s picture

Chipin' in, I'm also getting this error now.

6.828 s to locate visitor ip_geoloc_current_location.js:37:1
0.02 s to reverse-geocode to address ip_geoloc_current_location.js:78:1
IPGV&M, ip_geoloc_current_location.js parsererror: SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data (200) ip_geoloc_current_location.js:126:11
AJAX call completed with parsererror ip_geoloc_current_location.js:133:9

I've been getting this while I'm developing a new site. This is the first time I use this module, but not my first drupal website ;-)

I haven't been able find the time to track this down. I will keep you updated, thank you in advance.

mariano.barcia’s picture

So this wasn't happening on Bartik, but on a custom theme.

I got it working. I've added 2 lines to the bottom of the callback function ip_geoloc_current_location_ajax_recipient(), just before returning

  _ip_geoloc_set_session_value('position_pending_since', NULL);
  drupal_json_output(''); // this
  drupal_exit(); // and this
}

Not sure why it would work on Bartik and not the other theme though.

rdeboer’s picture

Great work Mariano,
Will add to the module ASAP.
Rik

sistro’s picture

Hi guys,

I have the same error, the fix provided by Mariano works also for me!
Thanks!

rdeboer’s picture

Patch applied.
Thanks Mariano.
Thanks sistro for confirming the fix.
Rik

  • RdeBoer committed f6f45a5 on 7.x-1.x
    Issue #2599950 by RdeBoer, mariano.barcia: Set My Location block returns...
rdeboer’s picture

Assigned: Unassigned » rdeboer
Status: Active » Fixed
rdeboer’s picture

Status: Fixed » Closed (fixed)

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