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

fix Google Maps script irrelevant load #1313

Closed
wants to merge 3 commits into from

Conversation

ddrmoscow
Copy link

Didn't open bug request, just code fix

Fixed issue # :
New feature # :
Changed feature # :
Dev:
Dev:

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 = '';
Copy link
Collaborator

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 ?

Copy link
Collaborator

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";
Copy link
Collaborator

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).

@Shnoulle
Copy link
Collaborator

Shnoulle commented Aug 1, 2019

Question : with a valid google map API : it used only with Map question type ? Right ? It was loaded for all surey ?
Must check before if it work …

@cdorin93
Copy link
Contributor

@Shnoulle do we have any bug report for this? I don't remember any gmaps-related issue 🤔

@Shnoulle
Copy link
Collaborator

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.

@cdorin93
Copy link
Contributor

Ah, I see, thanks @Shnoulle
@ddrmoscow , could you please rebase and solve the conflicts? Thanks for your contribution :)!

@cdorin93 cdorin93 added the Feedback Waiting for feedback from PR author label Oct 22, 2020
@c-schmitz
Copy link
Contributor

Fixed in 19dab67

@c-schmitz c-schmitz closed this Mar 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feedback Waiting for feedback from PR author
Projects
None yet
4 participants