Closed (fixed)
Project:
Smart IP
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
8 Apr 2012 at 20:24 UTC
Updated:
16 Jul 2012 at 04:41 UTC
Jump to comment: Most recent file
As discovered at #1522040: Google server returns 404 for gears_init.js, results in PHP warning (and likely broken functionality), Google has removed the gears_init.js file from their servers.
Which will cause a warning like this in device_geolocation_init() of the Device Geolocation sub-module:
Warning: file_get_contents(http://code.google.com/apis/gears/gears_init.js): failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found in drupal_build_js_cache()
The attached patch is a workaround that adds gears_init.js locally and loads from the module's js directory instead.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | smart_ip-gears_init_new_location-1522102-3.patch | 4.77 KB | damien_vancouver |
| smart_ip-gears_init_new_location_7.x-1.x.patch | 4.77 KB | damien_vancouver |
Comments
Comment #1
socialnicheguru commentedgit apply s*patch
smart_ip-gears_init_new_location_7.x-1.x.patch:11: trailing whitespace.
drupal_add_js(drupal_get_path('module', 'device_geolocation') . '/js/gears_init.js');
warning: 1 line adds whitespace errors.
Comment #2
damien_vancouver commentedHi, I'll re-roll the patch because...
I submitted a bug request upstream at the ip_geolocation javascript library, and the maintainer there has included the gears_init.js code into the main ip_geo.js.
@see http://code.google.com/p/geo-location-javascript/issues/detail?id=48
Anyway, the fix has now changed for downstream modules. Rather than include a locally cached gears_init.js, we just need to not drupal_add_js() it at all.
Also it means that failing configurations will now just start working again (though the 404 error will remain).
So, I will prepare a revised patch and resubmit here (without extra whitespace). Thanks!
Comment #3
damien_vancouver commentedDisregard what I said in #2, smart_ip doesn't use geo-location-javascript.
So my first patch was right (other than the whitespace). I've re-rolled it to fix that - this one should apply cleanly.
Comment #4
imoreno commentedHi,
applying patch #3 on 7.x - 1.5 version from 2012-Feb-29 eliminates the error and now it's gone.
I think it can be committed.
BR
Itzhak
Comment #5
socialnicheguru commentedsame here
Comment #6
arpeggio commentedHi, I have committed/pushed the patch @ #3 and I've also ported this fix to 6.x. Please use the dev version. Thank you damien_vancouver for sharing the fix.