• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

Map visualisation error "Image.php on line 187"

Cre

New Member
Hi guys,

Am getting these errors even after updating API keys;

Warning: file_get_contents(https://maps.google.com/maps/api/st...bile=true&markers=0,0&sensor=false&key=XXXXXX &visual_refresh=true): failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request in /home/gfnc8572/public_html/libraries/fabrik/fabrik/Helpers/Image/Image.php on line 187

They go away after a refresh but even then the location icons take quite a while for all to load.

Has anyone else been down this path?

Cheers
 
Last edited:
Static maps are cached, "rebuilding" may take a while.
"Bad request": maybe you were hitting Google maps limits (by loading to many static maps)?
Check in your Google account.
 
Yup, a 400 is an error response from Google.

You should be able to see the error if you just paste the full URL in that error message into your browser.

-- hugh
 
Thanks guys,

It has been confusing because it had been working on my computers in various browsers but not on the club's webmaster's ipad or laptop.

I thought it was just a matter of it propagating through the servers but the issue is back again.

The link returns the error: "The Google Maps Platform server rejected your request. The provided API key is invalid."

Seems fine via the API console.
 
Well the issue may have been a space at the end of the API I entered into the Fabrik Global Configuration putting a %20 in the code. Seems to be okay now, at least at my end, so fingers crossed.

Thanks again.
 
Ah, OK.

I should probably trim white space from that when we use it, which would avoid fat finger issues like that.

-- hugh
 
  • Like
Reactions: Cre
Hi Hugh,

Thank you for doing that. It has been a bit of a sisyphean effort this one. Get one problem solved and another pops up. One thing I needed to do was disable the Ajax refresh.

While both my laptops and my desktop were accessing the maps without issue others were receiving an "Oops something went wrong" message after the map came up for a few seconds.

I'm now getting a sense of how frustrating not being able to replicate and error can be. You must have the patience of Job my friend.

This was the console error they were getting.

Google Maps JavaScript API error: RefererNotAllowedMapError
https://developers.google.com/maps/.../error-messages#referer-not-allowed-map-error
Your site URL to be authorized: https://www.XXXX.org.au/observations/bird-observations/bird-observations-map js:53:173

However nothing at my end.

My only idea was that the API restriction I had put in place XXXX.org.au/* may have been picked up by their virus software so tried *XXXX.org.au/*. This worked for about 5 minutes then the errors started again so I removed the restrictions entirely. For some reason this seems to have worked but my confidence is not that high as the issue seems to rear it head soon after fixes are thought to be found.

Anyway even though I think this is an API issue rather than a Fabrik one I thought this was worth documenting in case it helped anyone else out.

Cheers

Cre
 
Yup, I've been seeing a number of those API referrer issues cropping up recently, and there's been an uptick in people reporting the same problem in places like Google's forums and Stack Exchange. I think it's a problem at Google's end.

And yes, there's definitely an issue with wildcard domains. People are reporting that *.domain.name doesn't seem to work, which it does for other people. Other people say it seems like you have to include the schema, like https://*.domain.name.

I've simply removed the referrer from my sites until Google get their act together again, and/or we get a clearer indication of exactly how it needs to be specified.

-- hugh
 
  • Like
Reactions: Cre
Hi Hugh,

This issue has popped up again. I advised the club to get a fresh Google Maps API as the previous web manager had left.

It seemed to have fixed it but the error messages have returned although after a page refresh they disappear.

Warning: file_get_contents(https://maps.google.com/maps/api/staticmap?center=-38.25666768279967,144.5287124781113&zoom=10&size=200x100&maptype=hybrid&mobile=true&markers=-38.25666768279967,144.5287124781113&sensor=false&key=....&visual_refresh=true): failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden in /home/XXXX/public_html/libraries/fabrik/fabrik/Helpers/Image/Image.php on line 195

I'm hoping you might have a heads up for them.

Cheers

Cre
 
Last edited:
The Google Maps Platform server rejected your request. This API project is not authorized to use this API.
So there seems to be something wrong with your API key or your API settings (maybe you've hit some limits).
 
So there seems to be something wrong with your API key or your API settings (maybe you've hit some limits).

Thanks for the reply. Limits shouldn't be an issue as it is a fresh API. Also it doesn't explain why the errors disappear and the map is shown correctly after a refresh.
 
If you just copy and paste that link into a browser, it'll tell you:

The Google Maps Platform server rejected your request. This API project is not authorized to use this API.

... which usually means you haven't enabled the static maps API in your Google API conse.

Also, I suggest you edit that post and remove the API key from that link.

It may be working on a refresh because after the initial failure to get a new map, Fabrik serves up a cached copy.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top