{"issue":{"state":"open","created_at":"2011-12-12T22:35:47Z","updated_at":"2011-12-12T22:40:14Z","comments":1,"user":{"gravatar_id":"d9bebc8f32aaad1275a931e2045196e0","id":718899,"url":"https://api.github.com/users/Trott","avatar_url":"https://secure.gravatar.com/avatar/d9bebc8f32aaad1275a931e2045196e0?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"Trott"},"body":"Yup, that's it.  passthru.php outputs an HTML document with no doc type, throwing IE into quirks mode.\r\n\r\nIf you're target doc also puts IE into quirks mode, you're good.\r\n\r\nIf you use <!DOCTYPE html> then it's standards mode and you enter redirect loop nightmare.\r\n\r\nIf you put that doctype into passthru.php, you get the opposite behavior:  Quirks mode pages go into infinite redirect loops and standards mode pages work.\r\n\r\nEric, I don't know enough about why there's that extra classification check in the DTS that's giving us heartburn here--I'm sure there's a good reason for it, but I don't know what that reason is--do I'm kicking this over to you at this point.  (Yay, no more emails from me today!)\r\n\r\nI'll open an issue in GitHub.\r\n\r\n--Rich\r\n\r\n________________________________________\r\nFrom: Trott, Richard\r\nSent: Monday, December 12, 2011 2:17 PM\r\nTo: Bollens, Eric; Vega; Jim Kreuziger\r\nCc: Christopher Davis; Sakabu, Edward\r\nSubject: RE: UCI Libraries mobile url for MWF test site\r\n\r\nAs Mark/Vega/help-me-out-what-do-I-call-you pointed out, it's flapping between standards mode on the content page and quirks mode in passthru.php.  So that's probably what's causing the classification to change and thus the infinite redirect loop.\r\n\r\nWhy do we do the check for change in classification?  Without knowing that, I can't be sure that anything I suggest is going to be a good suggestion, but that won't stop me:\r\n\r\nIt may be tempting to try to do something to force it into one mode or another, but I suspect we should just accept that we can't actually force the browser to reveal the same things all the time.  I think we should just believe what it's telling us on the page that we're on, overwrite the cookie there, and reload.  (Yeah, it's an extra HTTP request.  Oh well.  Another argument for appcaching.)  The only way that could cause an infinite redirect loop is if the browser reports different things on every request to the same page.\r\n\r\n--Rich\r\n\r\n________________________________________\r\nFrom: Trott, Richard\r\nSent: Monday, December 12, 2011 2:07 PM\r\nTo: Bollens, Eric; Vega; Jim Kreuziger\r\nCc: Christopher Davis; Sakabu, Edward\r\nSubject: RE: UCI Libraries mobile url for MWF test site\r\n\r\nI wonder if this has to do with the browser toggling between standards mode and quirks mode perhaps due to the HTML5 doctype.\r\n________________________________________\r\nFrom: Trott, Richard\r\nSent: Monday, December 12, 2011 2:05 PM\r\nTo: Bollens, Eric; Vega; Jim Kreuziger\r\nCc: Christopher Davis; Sakabu, Edward\r\nSubject: RE: UCI Libraries mobile url for MWF test site\r\n\r\nYes, and that's precisely the issue.  I was mistaken when I said it wasn't being set.  The value is indeed changing.\r\n\r\nstandard is false in site.cookie.classification but true in classificationCookie when you hit this line in server.src.js:\r\n\r\n      if(!site.cookie.exists(classification.cookieName) || site.cookie.classification != classificationCookie)\r\n\r\nIf you want to take this to IRC, we can probably get some stuff done faster.  (And if you just want to take over at this point and fix it, even better.  :-)  )\r\n________________________________________\r\nFrom: Bollens, Eric \r\nSent: Monday, December 12, 2011 2:01 PM\r\nTo: Trott, Richard; Vega; Jim Kreuziger\r\nCc: Christopher Davis; Sakabu, Edward\r\nSubject: Re: UCI Libraries mobile url for MWF test site\r\n\r\nHmmm, that's interesting... Let me know what you find with classification.\r\nThat's the only one that does more than a cookie existence check - it also\r\nchecks to make sure that the classification has not changed in the cookie.\r\n\r\n~ Eric\r\n\r\nOn 12/12/11 1:56 PM, \"Trott, Richard\"  wrote:\r\n\r\n>I don't think it's #2.  I'm stepping through in a debugger and that\r\n>should give it plenty of time for the browser to take the cookie.  I'm\r\n>not ruling it out, but I don't think so if I have to guess.\r\n>\r\n>I do notice that it seems to always be the classification cookie that\r\n>fails, and not the other two.\r\n>________________________________________\r\n>From: Bollens, Eric \r\n>Sent: Monday, December 12, 2011 1:51 PM\r\n>To: Trott, Richard; Vega; Jim Kreuziger\r\n>Cc: Christopher Davis; Sakabu, Edward\r\n>Subject: Re: UCI Libraries mobile url for MWF test site\r\n>\r\n>Rich,\r\n>\r\n>The starting point here is mwf.server.mustReload. It is false by default,\r\n>but set true whenever mwf.server.setCookie() is called. This implies that\r\n>one or more of the mwf.site.cookie.exists() calls in mwf.server.init() is\r\n>failing (or that the classification has changed) again and again.\r\n>\r\n>I thus arrive at mwf.site.cookie.exists() as the likely culprit. This is\r\n>written out in vars.php based on logic whereby the page checks for the\r\n>user_agent, screen and override cookies, and writes them out if they\r\n>exist. The exists() function then checks to see if the one provided in a\r\n>parameter has been defined on the server.\r\n>\r\n>If mwf.site.cookie.exists() is returning false, that means that the cookie\r\n>hasn't stuck to the server yet. This would mean that passthru.php is\r\n>proving ineffective in setting the cookie.\r\n>\r\n>Two reasons that passthru.php might fail:\r\n>\r\n>(1) The browser does not accept cookies but the mwf.capability.cookie()\r\n>check believes it does.\r\n>\r\n>(2) Javascript on the page is redirecting the user before the browser\r\n>processes the cookie write.\r\n>\r\n>I doubt that the issue is (1) given that IE 9 is almost certainly\r\n>accepting cookies. However, (2) might be more likely. Imagine, for\r\n>instance, if IE 9 doesn't process cookies until a certain elapsed time,\r\n>say at onLoad, as opposed to immediately when document.cookie is called. I\r\n>think the test, therefore, would be to modify passthru.php to not redirect\r\n>until onLoad or onDOMContentLoaded. This will induce a slight delay in the\r\n>redirect, but might solve the problem.\r\n>\r\n>Thoughts?\r\n>\r\n>~ Eric\r\n>\r\n>On 12/12/11 1:39 PM, \"Trott, Richard\" wrote:\r\n>\r\n>>D'oh!  Port 80 blocked at the campus perimeter.\r\n>>\r\n>>I can put it on another port, but really, all you have to do is copy and\r\n>>paste the source from the UCI lib page, uncomment the script and change\r\n>>the redir target to your script location.\r\n>>\r\n>>Looks to me like this bit of code is always firing on every page visit:\r\n>>\r\n>>        else{\r\n>>            if(this.mustRedirect&&!mwf.override.isRedirecting){\r\n>>\r\n>>window.location=b.asset.root+\"/passthru.php?return=\"+encodeURIComponent(w\r\n>>i\r\n>>ndow.location)\r\n>>            }\r\n>>\r\n>>Obviously, it should fire (at most) just the first time.....\r\n>>\r\n>>--Rich\r\n>>\r\n>>________________________________________\r\n>>From: Bollens, Eric \r\n>>Sent: Monday, December 12, 2011 1:37 PM\r\n>>To: Trott, Richard; Vega; Jim Kreuziger\r\n>>Cc: Christopher Davis\r\n>>Subject: Re: UCI Libraries mobile url for MWF test site\r\n>>\r\n>>Can't seem to access that address Rich...\r\n>>\r\n>>Any idea what's causing it?\r\n>>\r\n>>~ Eric\r\n>>\r\n>>On 12/12/11 1:36 PM, \"Trott, Richard\" wrote:\r\n>>\r\n>>>Although no rush, since I now have the bug running on my own local\r\n>>>machine.\r\n>>>\r\n>>>Eric, if you need an installation that shows the bug, point your IE\r\n>>>browser at http://128.218.15.246/test.php\r\n>>>\r\n>>>--Rich\r\n>>>\r\n>>>________________________________________\r\n>>>From: Bollens, Eric \r\n>>>Sent: Monday, December 12, 2011 1:33 PM\r\n>>>To: Trott, Richard; Vega; Jim Kreuziger\r\n>>>Cc: Christopher Davis\r\n>>>Subject: Re: UCI Libraries mobile url for MWF test site\r\n>>>\r\n>>>Rich is correct. Without that line, the MWF cannot determine what your\r\n>>>device is capable of. All phones will instead get the basic-grade CSS\r\n>>>and\r\n>>>no JS support.\r\n>>>\r\n>>>~ Eric\r\n>>>\r\n>>>On 12/12/11 1:30 PM, \"Trott, Richard\"  wrote:\r\n>>>\r\n>>>>You really need to put that line back.  Removing it is not the\r\n>>>>solution.\r\n>>>>There's a bug in there that needs fixing, but you need the JS code that\r\n>>>>script tag provides.\r\n>>>>________________________________________\r\n>>>>From: Vega \r\n>>>>Sent: Monday, December 12, 2011 12:46 PM\r\n>>>>To: Kreuziger, Jim\r\n>>>>Cc: Trott, Richard; Bollens, Eric; Christopher Davis\r\n>>>>Subject: Re: UCI Libraries mobile url for MWF test site\r\n>>>>\r\n>>>>The endless redirect seems to stop when I remove the following from the\r\n>>>>head section:\r\n>>>>\r\n>>>><script type=\"text/javascript\"\r\n>>>>src=\"http://m.uci.edu/mwf/current/root/assets/js.php?full_libs=transiti\r\n>>>>o\r\n>>>>n\r\n>>>>s\r\n>>>>+touch_transitions\"></script>\r\n>>>>\r\n>>>>Once removed, the page loads but with incorrect styling.  In\r\n>>>>particular,\r\n>>>>IE seems to be ignoring 'text-align: center;', 'display:\r\n>>>>inline-block;',\r\n>>>>and all three types of gradients (moz-, webkit-, and o-).\r\n>>>>\r\n>>>>\r\n>>>>Jim:  I did test on your wife's Windows phone on Friday as well which\r\n>>>>is\r\n>>>>what alerted me to the problem.  The page loaded (no redirect loop),\r\n>>>>but\r\n>>>>did not display with correct styling.\r\n>>>>\r\n>>>>\r\n>>>>\r\n>>>>\r\n>>>>--\r\n>>>>Vega\r\n>>>>\r\n>>>>\r\n>>>>\r\n>>>>On 12/12/2011 12:33 PM, Kreuziger, Jim wrote:\r\n>>>>> Nothing has changed on the site.  I've looked at the site on Windows\r\n>>>>> mobile (my wife's phone) and it looked pretty messed up (that's the\r\n>>>>> technical term ;)).  Since I only have access to the phone when I'm\r\n>>>>>not\r\n>>>>>at\r\n>>>>> work, I'm going to fire up my windows VM to see if I can reproduce\r\n>>>>>any\r\n>>>>>of\r\n>>>>> this.\r\n>>>>>\r\n>>>>> I'll remove the trailing slash on site_url...  Ok, that's done.  Let\r\n>>>>>me\r\n>>>>> know if that makes a difference.\r\n>>>>>\r\n>>>>> Jim Kreuziger\r\n>>>>> Director, Web Communications\r\n>>>>> University Communications\r\n>>>>> University of California, Irvine\r\n>>>>> www.uci.edu\r\n>>>>>\r\n>>>>>\r\n>>>>>\r\n>>>>>\r\n>>>>> On 12/12/11 11:03 AM, \"Trott, Richard\"\r\n>>>>>wrote:\r\n>>>>>\r\n>>>>>> Jim, I was able to reproduce this problem on Friday using Internet\r\n>>>>>> Explorer, but today I am unable to do so.  Any idea if anything\r\n>>>>>>changed?\r\n>>>>>> I'm hoping the answer is \"yes\" but I'm guessing the answer is \"no\".\r\n>>>>>>\r\n>>>>>> Anyway:\r\n>>>>>>\r\n>>>>>> site_url has a trailing slash.  The trailing slash should be\r\n>>>>>>removed,\r\n>>>>>> although I don't know that it would be causing the behavior we're\r\n>>>>>>seeing.\r\n>>>>>> (Seems unlikely, but Eric would know a lot more.)\r\n>>>>>>\r\n>>>>>> --Rich\r\n>>>>>>\r\n>>>>>> ________________________________\r\n>>>>>> From: Kreuziger, Jim \r\n>>>>>> Sent: Monday, December 12, 2011 10:51 AM\r\n>>>>>> To: Trott, Richard; Bollens, Eric\r\n>>>>>> Cc: Vega\r\n>>>>>> Subject: Re: UCI Libraries mobile url for MWF test site\r\n>>>>>>\r\n>>>>>> Rich, Eric,\r\n>>>>>>\r\n>>>>>> I'm currently running 1.2.07.  I have 1.2.08 in the queue, should be\r\n>>>>>>able\r\n>>>>>> to update sometime today.  I'm going to attach a copy of my\r\n>>>>>>global.php\r\n>>>>>> config file, in case this is something you can use.\r\n>>>>>>\r\n>>>>>> Right now, Vega is the only one outside the actual framework that\r\n>>>>>>has\r\n>>>>>> tried to create a site.  Our UCI mobile site is being developed on\r\n>>>>>>the\r\n>>>>>> domain (m.uci.edu) that the framework resides.\r\n>>>>>>\r\n>>>>>> Let me know if there is anything that I can do to help.\r\n>>>>>>\r\n>>>>>> Jim Kreuziger\r\n>>>>>> Director, Web Communications\r\n>>>>>> University Communications\r\n>>>>>> University of California, Irvine\r\n>>>>>> www.uci.edu\r\n>>>>>>\r\n>>>>>> From: Vega\r\n>>>>>> Date: Mon, 12 Dec 2011 07:02:36 -0800\r\n>>>>>> To: Jim Kreuziger\r\n>>>>>> Subject: Fwd: RE: UCI Libraries mobile url for MWF test site\r\n>>>>>>\r\n>>>>>> Jim,\r\n>>>>>> I'm having some problems with my new MWF-based mobile site\r\n>>>>>> (http://www.lib.uci.edu/mwf-test/) in Internet Explorer (desktop and\r\n>>>>>> Windows phone) and reported such at Friday's MWF Developers meeting.\r\n>>>>>> Eric Bollens and Rich Trott asked me to send them the url and you\r\n>>>>>>can\r\n>>>>>>see\r\n>>>>>> Rich's troubleshooting notes in the email below.  I'm not sure,\r\n>>>>>>though,\r\n>>>>>> why the trouble only presents in IE...\r\n>>>>>>\r\n>>>>>> --\r\n>>>>>> Vega\r\n>>>>>> --\r\n>>>>>>\r\n>>>>>> -------- Original Message --------\r\n>>>>>> Subject:        RE: UCI Libraries mobile url for MWF test site\r\n>>>>>> Date:   Fri, 9 Dec 2011 23:56:04 +0000\r\n>>>>>> From:   Trott, Richard\r\n>>>>>> To:     Vega, Eric Bollens\r\n>>>>>>\r\n>>>>>>\r\n>>>>>>\r\n>>>>>> More notes for Eric:\r\n>>>>>>\r\n>>>>>> * You can see the problem in IE, so you don't need to get a Windows\r\n>>>>>>phone\r\n>>>>>> or anything.\r\n>>>>>>\r\n>>>>>> * Their MWF code appears to have all the important relevant bugfixes\r\n>>>>>>that\r\n>>>>>> have been committed to master (unless their doing something weird\r\n>>>>>>like\r\n>>>>>> protocol-less URLs, but who does that besides idiots like me?).  You\r\n>>>>>>can\r\n>>>>>> see, for example, their JS source at\r\n>>>>>> http://m.uci.edu/mwf/current/root/assets/js/\r\n>>>>>>\r\n>>>>>> * Might want to mail Jim K. or whoever and get their config settings\r\n>>>>>>to\r\n>>>>>> see if you can replicate this.\r\n>>>>>>\r\n>>>>>> * IE is working fine on m.uci.edu, so it's probably something to do\r\n>>>>>>with\r\n>>>>>> this being a client on its own server and not an SP.\r\n>>>>>>\r\n>>>>>> * Ready to switch to OpenDDR?  :-P\r\n>>>>>>\r\n>>>>>> --Rich\r\n>>>>>>\r\n>>>>>> ________________________________________\r\n>>>>>> From: Trott, Richard\r\n>>>>>> Sent: Friday, December 09, 2011 3:40 PM\r\n>>>>>> To: Vega; Eric Bollens\r\n>>>>>> Subject: RE: UCI Libraries mobile url for MWF test site\r\n>>>>>>\r\n>>>>>> Eric, this looks like DTS loop trouble.  I hope they're running an\r\n>>>>>>MWF\r\n>>>>>> that is a couple versions back and that they just need to update.\r\n>>>>>> ________________________________________\r\n>>>>>> From: Vega [\r\n>>>>>> Sent: Friday, December 09, 2011 3:27 PM\r\n>>>>>> To: Eric Bollens; Trott,\r\n>>>>>>Richard\r\n>>>>>> Subject: UCI Libraries mobile url for MWF test site\r\n>>>>>>\r\n>>>>>> Rich, Eric;\r\n>>>>>> Here is url to my test instance of mobile site using MWF:\r\n>>>>>>\r\n>>>>>> http://www.lib.uci.edu/mwf-test/\r\n>>>>>>\r\n>>>>>> Looks great on iPhone, Android but breaks on Windows phone and in\r\n>>>>>> desktop version of IE9.\r\n>>>>>>\r\n>>>>>> --\r\n>>>>>> --\r\n>>>>>> Mark Vega\r\n>>>>>> Programmer/Analyst\r\n>>>>>> UCI Libraries - Web Services\r\n>>>>>> The University of California, Irvine\r\n>>>>>> P.O. Box 19557\r\n>>>>>> Irvine, CA 92623-9557\r\n>>>>>>\r\n>>>>>>\r\n>>>>>>\r\n>>>>>>\r\n>>>>>>\r\n>>>>>>\r\n>>>>>\r\n>>>>\r\n>>>\r\n>>>\r\n>>\r\n>>\r\n>\r\n>\r\n","assignee":{"gravatar_id":"3bb00bb9eda3eca8b98a01756a392346","id":761092,"url":"https://api.github.com/users/ebollens","avatar_url":"https://secure.gravatar.com/avatar/3bb00bb9eda3eca8b98a01756a392346?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"ebollens"},"labels":[],"id":2529659,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"number":40,"title":"IE Quirks Mode / Standards Mode Mismatch b/t target page and passthru.php results in infinite redirect loop","html_url":"https://github.com/ucla/mwf/issues/40","closed_at":null,"url":"https://api.github.com/repos/ucla/mwf/issues/40","milestone":{"state":"open","created_at":"2011-12-12T19:34:45Z","closed_issues":0,"due_on":null,"creator":{"gravatar_id":"3bb00bb9eda3eca8b98a01756a392346","id":761092,"url":"https://api.github.com/users/ebollens","avatar_url":"https://secure.gravatar.com/avatar/3bb00bb9eda3eca8b98a01756a392346?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"ebollens"},"number":4,"title":"1.2.09","description":"","url":"https://api.github.com/repos/ucla/mwf/milestones/4","open_issues":2}},"action":"created","comment":{"created_at":"2011-12-12T22:40:14Z","updated_at":"2011-12-12T22:40:14Z","user":{"gravatar_id":"3bb00bb9eda3eca8b98a01756a392346","id":761092,"url":"https://api.github.com/users/ebollens","avatar_url":"https://secure.gravatar.com/avatar/3bb00bb9eda3eca8b98a01756a392346?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"ebollens"},"body":"That check is in there for two reasons:\r\n\r\n1. In case the capabilities on the browser change (like disabling/enabling Javascript)\r\n2. Old support to handle redirecting on override (shouldn't be necessary anymore)\r\n\r\nGiven that these are both edge cases, I'd be willing to drop the added check after some testing.","id":3114292,"url":"https://api.github.com/repos/ucla/mwf/issues/comments/3114292"}}