Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GAPI V3 Causes a popup window requesting Sensor True/False #479

Open
GoogleCodeExporter opened this issue Apr 4, 2015 · 26 comments
Open

Comments

@GoogleCodeExporter
Copy link

Wordpress 3.13 (and 3.2)
Using the latest Geomashup 1.4x Beta Release.

Simple Widget:
[geo_mashup_map height="150" width="150" zoom="5" add_overview_control="false" 
add_map_type_control="false"]

When I view the post I am presented with a popup on any pages that call 
GeoMashup with:
"The google maps API Server rejected your request -  The "sensor" parameter 
specified in the request must be set to either "true" or "false"."


Original issue reported on code.google.com by d...@wetcoast.ca on 25 Jun 2011 at 4:08

@GoogleCodeExporter
Copy link
Author

I'm definitely not seeing that issue. Any chance there is another plugin 
loading the Google API? If you can post a URL I'll see if I can get any clues 
from that.

Original comment by dylankk...@gmail.com on 28 Jun 2011 at 12:30

  • Changed state: Investigating
  • Added labels: Milestone-1.4, Type-Defect

@GoogleCodeExporter
Copy link
Author

Hello - Website url is www.tiredofit.ca - 

I am using your GPX Viewer Plugin, XML Google Maps - and calling Google Maps 
APIv3 via code in different locations. I even get the error when I am trying to 
map a location to a post in the admin screen when set to Google V3. Open maps 
works, but not as detailed.

Original comment by d...@wetcoast.ca on 13 Jul 2011 at 1:14

@GoogleCodeExporter
Copy link
Author

My guess is that multiple plugins are trying to load the API. If you'd like to 
make a temporary admin account for me (dylan cyberhobo at cyberhobo . net) I'll 
see if I can spot the conflict. I do know that sensor=false in Geo Mashup's 
version.

FYI - your front page map doesn't load for me on a mac in Chrome or Safari with 
errors like this:
http://www.tiredofit.ca/cdn-cgi/pe/bag?r[]=http%3A%2F%2Fmaps.google.com%2Fmaps%3
Ffile%3Dapi%26v%3D2%26key%3DABQIAAAA_NoaRsZisU3-4CkpF9d9URQXSDnEmSJxCD-G-_ne-jHD
WCA2khT2XxHA3X9Dwr1dwV19o_0E1KT2UQ&r[]=http%3A%2F%2Fwww.tiredofit.ca%2Fwp-conten
t%2Fplugins%2Fxml-google-maps%2Fxmlgooglemaps_googleMapsAPI.js

Failed to load resource: the server responded with a status of 400 (Bad Request)

Original comment by dylankk...@gmail.com on 13 Jul 2011 at 2:17

  • Removed labels: Milestone-1.4

@GoogleCodeExporter
Copy link
Author

Bizarre, loads here on Chrome/Opera/Safari/IE - I turned off my CDN provider 
about one hour ago and likely this is the issue. Anyways, I have sent an admin 
account to your cyberhobo address. DB Backup taken already.

Original comment by d...@wetcoast.ca on 13 Jul 2011 at 2:24

@GoogleCodeExporter
Copy link
Author

I have also just disabled the caching program - should look a lot cleaner code 
wise now.

Original comment by d...@wetcoast.ca on 13 Jul 2011 at 2:25

@GoogleCodeExporter
Copy link
Author

So something was removing the required script querystring, but we never 
determined what was doing it. Workaround was to use the OpenLayers map provider.

You might still be able to spit out a Google map by setting the map_api 
parameter to 'googlev3'.

Original comment by dylankk...@gmail.com on 18 Jul 2011 at 2:43

  • Changed state: Workaround

@GoogleCodeExporter
Copy link
Author

I had the same error.  After deactivating my cache plugin I turned off "random 
wordpress version number" in Better WP Security and it started working.

Original comment by shane1...@gmail.com on 17 Jul 2012 at 5:35

@GoogleCodeExporter
Copy link
Author

Hi I have just encountered same issue with betterWP and whilst I am not sure 
why the wp version number shoup trip the Google API I will be delighted if that 
is it! Thanks Shane and Dylan!

Original comment by a...@intriguing-networks.com on 7 May 2013 at 1:34

@GoogleCodeExporter
Copy link
Author

Confirm it solves the problem thank you, it is the Better WP randomised WP 
Version number, Cheers.

Original comment by a...@intriguing-networks.com on 7 May 2013 at 2:02

@GoogleCodeExporter
Copy link
Author

Issue 651 has been merged into this issue.

Original comment by dylankk...@gmail.com on 29 May 2013 at 1:28

@GoogleCodeExporter
Copy link
Author

I don't have BetterWP installed despite I have the same exact issue.

Original comment by studiowe...@gmail.com on 29 May 2013 at 2:06

@GoogleCodeExporter
Copy link
Author

@studiowebluciani - any other caching or CDN plugins? Does the issue persist if 
Geo Mashup is the only active plugin?

Original comment by dylankk...@gmail.com on 29 May 2013 at 2:29

@GoogleCodeExporter
Copy link
Author

I have WP Super Cache... can that be it? I turned it off but gives me same 
problem.

Original comment by studiowe...@gmail.com on 29 May 2013 at 2:38

@GoogleCodeExporter
Copy link
Author

When I do a test it says:

Running: 
googlev3 global loads
global failure (1, 0, 1)Rerun2 ms
Uncaught ReferenceError: QTags is not defined
Source:     
http://www.worldwidefood.net/wp-content/plugins/hrecipe/js/hrecipe_launch.js:31

Original comment by studiowe...@gmail.com on 29 May 2013 at 2:42

@GoogleCodeExporter
Copy link
Author

@studiowebluciani - that error is coming from the hrecipe plugin. What are your 
results if you deactivate that plugin?

Original comment by dylankk...@gmail.com on 31 May 2013 at 2:34

@GoogleCodeExporter
Copy link
Author

I deactivated the plugin but still having the same issue: The Google Maps API 
server rejected your request. The "sensor" parameter specified in the request 
must be set to either "true" or "false".

Original comment by studiowe...@gmail.com on 2 Jun 2013 at 12:35

@GoogleCodeExporter
Copy link
Author

@studiowebluciani - the next step would be to try it with all other plugins 
deactivated. It might help me also if you could provide a link to a map with 
the issue.

Original comment by dylankk...@gmail.com on 2 Jun 2013 at 4:22

@GoogleCodeExporter
Copy link
Author

Hi. My discovery on this matter, as upon activating a new theme this message 
started appearing for me.

My new theme, for some reason (I am making enquiries) strips "version numbers" 
from all scripts queued for printing using wp_print_styles which Geo Mashup 
uses when populating the header.

My theme file:

function shoestrap_remove_script_version( $src ){
  $parts = explode( '?', $src );
  return $parts[0];
}
add_filter( 'script_loader_src', 'shoestrap_remove_script_version', 15, 1 );

So when Geo Mashup (render-map.php) calls GeoMashupRenderMap::head() which 
calls wp_print_scripts( $scripts ), instead of the output being something like:

<script type='text/javascript' 
src='http://maps.google.com/maps/api/js?sensor=false&key=[KEY]&language=en&ver=3
.5.1'></script>

It's:

<script type='text/javascript' 
src='http://maps.google.com/maps/api/js'></script>

Is there any way that Geo Mashup can make provisions to override any 
theme/plugin filters which do this?

In the mean time I am going to ask a similar question with Shoestrap.

Dylan, Geo Mashup is an awesome plug-in. Thanks for all your hard work on it.

Original comment by james.c...@gmail.com on 4 Jun 2013 at 11:45

@GoogleCodeExporter
Copy link
Author

Good work. It seems like the false assumption that scripts never require 
querystring parameters is becoming more common. I would suggest to those 
developers that if they really must remove the WP-specific "ver" parameter, 
that they remove only that one.

I'll think about how I might avoid this on the Geo Mashup side, but part of the 
power of WordPress hooks is that they offer themes and plugins an opportunity 
to break things. I don't think we'll avoid that without giving up the much 
greater integration benefits that hooks provide.

For your specific case, you could use a custom map frame template 
(https://code.google.com/p/wordpress-geo-mashup/wiki/Documentation#Customize_the
_info_window_and_other_content) with some code added like this at the top:

remove_filter( 'script_loader_src', 'shoestrap_remove_script_version', 15, 1 );

Original comment by dylankk...@gmail.com on 4 Jun 2013 at 2:36

@GoogleCodeExporter
Copy link
Author

I have raised my specific case with regards to the theme causing issues with 
the plug-in at 
http://shoestrap.org/forums/topic/stripping-of-version-numbers-from-queued-scrip
ts-causing-issues/.

The iframe work-around is good. I will explore that option if nothing gets 
addressed from the theme side of things.

Original comment by james.c...@gmail.com on 5 Jun 2013 at 1:47

@GoogleCodeExporter
Copy link
Author

I'm having issues too, but for the life of me, I cannot figure out what plugin 
and/or where in my theme this would happen.  I disabled all plugins that could 
potentially affect it, to no avail.  Any thoughts on how to search for what is 
doing it?

Original comment by jeannemh...@gmail.com on 9 Jun 2013 at 6:30

@GoogleCodeExporter
Copy link
Author

Sorry for the double-posting-- my website is HeelsFirstTravel.com in case 
anyone wants to look at it.

Original comment by jeannemh...@gmail.com on 9 Jun 2013 at 6:31

@GoogleCodeExporter
Copy link
Author

If a map works with the default TwentyTwelve theme but not your theme, then the 
theme is the source of the issue.

If you post a link to a map with the issue I can verify the symptoms, but not 
the root cause.

Original comment by dylankk...@gmail.com on 9 Jun 2013 at 6:41

@GoogleCodeExporter
Copy link
Author

Thanks!  I used a site I have with no plug ins installed, and I installed geo 
mashup (worked), installed the theme, got this: 

http://www.smartbloggingtools.com/2013/06/09/im-the-king-of-the-world/


Are there any parts of code you recommend I search for in the theme files? 

re: the previous poster's

function shoestrap_remove_script_version( $src ){
  $parts = explode( '?', $src );
  return $parts[0];
}
add_filter( 'script_loader_src', 'shoestrap_remove_script_version', 15, 1 );

Original comment by jeannemh...@gmail.com on 9 Jun 2013 at 7:02

@GoogleCodeExporter
Copy link
Author

the key part to search for is 'script_loader_src'. The theme will probably add 
that filter in it's functions.php or other included PHP files.

You might point the theme authors to 
http://shoestrap.org/forums/topic/stripping-of-version-numbers-from-queued-scrip
ts-causing-issues/ to reference as a description of the problem.

Original comment by dylankk...@gmail.com on 9 Jun 2013 at 7:21

@GoogleCodeExporter
Copy link
Author

Thank you so much!

Original comment by jeannemh...@gmail.com on 9 Jun 2013 at 7:42

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant