GTranslate will cause HTTPS pages to throw 'some content is unsecure' errors. I am using it on a website with SecurePages. Here is a quick patch to work around that issue.

I think a more ideal solution is to have the Google Service URL set as a variable (translate.google.com) then set the http prefix by looking for $_SERVER['HTTPS_ON'] and/or other HTTPS flags (443, etc), but this will stop the immediate error.

Comments

BarisW’s picture

Version: 6.x-1.7 » 7.x-1.7
Status: Active » Needs review
StatusFileSize
new1.13 KB

Here's a D7 version.

ericrdb’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new193.95 KB

Patch in #1 worked for me. Thanks

BarisW’s picture

StatusFileSize
new1.5 KB

Slightly improved version by making it protocol independent.

I had some issues with the block being cached in http and then shown in https, introducing insecure content warnings in browsers. By making it protocol independent, this is not an issue anymore.

Like this:
<script type="text/javascript" src="//translate.google.com/translate_a/element.js" />

BarisW’s picture

Version: 7.x-1.7 » 7.x-1.9

The patch is against 7.x-1.x-dev by the way.

pcorbett’s picture

Tested this in 7.x-1.9 and works well for the on-the-fly method. Might make sense to apply the "//" technique to the rest of the hard-coded urls?

gscerb’s picture

Issue summary: View changes

I'm using 7.x-1.10 and Drupal 7.32
On my local developmental site "On the Fly" works well.
On my production HTTPS site. Nothing happens in "On the Fly". But "Redirect" will work.
It seems that the secure HTTPS site causes problems.

joshuautley’s picture

Running https which is being forced in settings.php file with no module for secure pages, etc.

Patch #3 with on the fly works for us.

Thank you.

alexgreyhead’s picture

+1 for the patch in 3 - works perfectly :) Thanks :)

larowlan’s picture

+1 RTBC

seworthi’s picture

+1 RTBC, works great.

cammchugh’s picture

Status: Reviewed & tested by the community » Closed (fixed)

The protocol relative approach was included in the 7.11 release. Closing this issue as fixed.