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
fix Google Maps script irrelevant load #1313
Conversation
Fixed loading googlemaps script without GoogleMapsAPIKey
Fixed loading googlemaps script without GoogleMapsAPIKey
fix Google Maps script irrelevant load in admin
$sGoogleMapsAPIKey = trim(Yii::app()->getConfig("googleMapsAPIKey")); | ||
if ($sGoogleMapsAPIKey != '') { | ||
$sGoogleMapsAPIKey = '&key='.$sGoogleMapsAPIKey; | ||
} | ||
$sSSL = ''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we move this part to the test ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not checking ssl at all seem better.
$sGoogleMapsAPIKey = trim(Yii::app()->getConfig("googleMapsAPIKey")); | ||
if ($sGoogleMapsAPIKey != '') { | ||
$sGoogleMapsAPIKey = '&key='.$sGoogleMapsAPIKey; | ||
$sOutputHTML .= "<script type=\"text/javascript\" src=\"http{$sSSL}://maps.googleapis.com/maps/api/js?sensor=false$sGoogleMapsAPIKey\"></script>\n"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rc=\"//maps.googleapis.com/maps/api/js?sensor=false$sGoogleMapsAPIKey\">
must be OK, no need checking ssl or not (browser take current scheme).
Question : with a valid google map API : it used only with Map question type ? Right ? It was loaded for all surey ? |
@Shnoulle do we have any bug report for this? I don't remember any gmaps-related issue 🤔 |
It's not an broke issue : script is loaded in statistics, even without MAP question type (or need google map). And hhere : it just remove the map call if there are no google map API. |
Ah, I see, thanks @Shnoulle |
Fixed in 19dab67 |
Didn't open bug request, just code fix
Fixed issue # :
New feature # :
Changed feature # :
Dev:
Dev: