I have a site that's using SecurePages module. I noticed on IE that I kept getting an error about not all elements on the page being secure and wanted to know if I wanted to view only the secure elements or not. I finally got tired enough of those messages that I investigated. It appears like it is coming from this line in Omega's html.tpl.php:

  <!--[if lt IE 9]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->

In my particular case on my current project, all pages are secure, so I simply created an html.tpl.php file in my subtheme and changed 'http:...' in the line above to 'https:...' and no more messages! However, I know that having all pages secure is generally not the case, users are bounced back and forth between secure and non-secure pages.

I may be missing something here, but shouldn't Omega be checking if the page is secure and then, if so, change the protocol to use?

CommentFileSizeAuthor
#15 relative-src-15.patch698 byteslex0r
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bocaj’s picture

Version: 7.x-3.0-rc5 » 7.x-3.0

Sorry, marked the wrong version!

design4effect’s picture

An easy way to do it is to just eliminate 'http' or 'https' and write the url starting '//htmlshiv...'.
Your browser will use whatever you used to connect to that page.

<!--[if lt IE 9]><script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->

Slick eh?

- Kent

fubhy’s picture

Assigned: Unassigned » himerus

The problem with this is that we add it to the .tpl directly. I feel like we should add it via drupal_add_js instead so the path can be adjusted on the fly. I talked to himerus about that before. Let's see how he feels about it now.

bocaj’s picture

Yeah, I was looking in every place I possibly could for a drupal_add_js function that set this. Only after an hour or so of searching did I think to look in the .tpl files. It makes sense to me to have it called via drupal_add_js. Then the issue, as fubhy already pointed out, would be taken care of and "adjusted on the fly".

tanitani’s picture

Yes, but how do you do that, as drupal_add_js does not have conditional option like drupal_add_css has, AFAIK.

himerus’s picture

Status: Active » Postponed (maintainer needs more info)

Anyone have a solution/patch for this one?

If anyone can post a viable solution here, I'll gladly add it. Mark back to active when ready for testing.

ardih’s picture

subscribe to this. solution #2 worked for me, copied the .tpl file to my own template dir, so as not to change it directly in the omega module. should get fixed in future versions.

Cellar Door’s picture

Version: 7.x-3.0 » 7.x-3.1
Status: Postponed (maintainer needs more info) » Closed (fixed)

Looking in 3.1 it seems to be that this is already incorporated into the html.tpl.php Closing for now and will re-open if it comes up again.

mrfelton’s picture

Version: 7.x-3.1 » 7.x-3.x-dev
Status: Closed (fixed) » Active

@Cellar Dorr: Is it? http://drupalcode.org/project/omega.git/blob/refs/heads/7.x-3.x:/omega/t.... Looks like the same old code to me.

star-szr’s picture

I don't see any issue with what is proposed in #2 - using a protocol-relative URL is what html5shiv recommends. The reference link is broken, but here's a blog post.

bocaj’s picture

Yeah, looks like #2 would solve the issue to me as well and is the recommended approach!

himerus’s picture

Status: Active » Fixed

Okay, so this has been committed.

However, for ANY theme that has customized html.tpl.php, this will need to be manually modified in order to properly work.

<!--[if lt IE 9]><script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
himerus’s picture

Assigned: himerus » Unassigned

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

lex0r’s picture

FileSize
698 bytes

For those of you who didn't manage to upgrade to the latest omega and regression test it on live clients.
here is the patch for 3.1.

star-szr’s picture

See also #1595062: Don't serve html5shiv from Google code repository which solves the issue in a different way, although the actual html5shiv.js in the patch is probably a bit out of date by now.

kopeboy’s picture

Issue summary: View changes

Guys, I put the html.tpl.php file in my subtheme after having upgraded to Omega 7.4.2 and now my site shows a blank page.

After I deleted the added file the site still stays blank!

Can anybody help on this? I don't know what to do since I can't see admin pages or anything..

Seems like having put the file has generated something else that I still need to cancel to return to how the site was working before.

Thanks in advance

kopeboy’s picture

Status: Closed (fixed) » Needs review

Status: Needs review » Needs work

The last submitted patch, 15: relative-src-15.patch, failed testing.

fubhy’s picture

Status: Needs work » Closed (fixed)

Please don't re-open closed issues. Always open a new issue for a new problem. Please also review the issue queue handbook for setting the issue metadata: https://drupal.org/node/317 - "Needs Review" means that there is a patch that requires reviewing. This is not the case here.

Regarding your blank page:
Why did you copy the html.tpl.php from Omega 3 into an Omega 4 theme? They are not compatible. It makes even less sense because this was only a problem in Omega 3. We now don't even serve html5shiv from Google anymore and instead serve it as a library (e.g. from sites/all/libraries).

In order to get your site back you will have to clear your cache (drush cc all)