SugarCRM invalid request in google maps

91

Unfortunately, we didn't know what caused this problem but we settled on solving this issue by formatting the embedded URL explicitly.

Share:
91

Related videos on Youtube

Gunnar Gunnarsson
Author by

Gunnar Gunnarsson

Updated on December 02, 2022

Comments

  • Gunnar Gunnarsson
    Gunnar Gunnarsson over 1 year

    I am using SugarCRM with several registered accounts. Each of the accounts have registered billing addresses and related information that are thrown into an embedded google map as parameters and displayed under a tab called Location Map.

    The embedded URL looks like this: https://www.google.com/maps/embed/v1/place?key=AIzaSyC1AkgX6WPT3_arbJZTQtLYkT_bz0rz5oQ&q={billing_address_street}, {billing_address_city}, {billing_address_postalcode}, {billing_address_country}

    This works fine for some addresses but it returns an error (The Google Maps API server rejected your request. Invalid request. Missing the 'q' parameter.) when using others. Link to a comparison, the second URL is invalid

    The second link is invalid since it has amp; where it isn't supposed to be. Does somebody know why this happens and how I can prevent it?

    • chutz
      chutz over 11 years
      What is the question here? And what did you do to try and find the answer?
    • Gunnar Gunnarsson
      Gunnar Gunnarsson almost 7 years
      I found out that & is a way to encode an ampersand (&) and it appears that in the latter case, the ampersand is not being properly parsed
    • Reisclef
      Reisclef almost 7 years
      If you resolved your problem, you might consider adding an answer, and marking it as accepted, or deleting your original question.
  • Gunnar Gunnarsson
    Gunnar Gunnarsson almost 7 years
    Thanks @Reisclef, I added an answer :)