grealish / pwm

Automatically exported from code.google.com/p/pwm
0 stars 0 forks source link

Captcha page is broken with IE <= 9 when switching locale #383

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Go to Forgotten Password on the PWM demo server 
(http://pwmdemo.weisberg.net/pwm/public/ForgottenPassword) with Internet 
Explorer <= 9
2. Switch the locale while on the Captcha page

What is the expected output? What do you see instead?
I would expect a successful page load. Instead you get a script error and the 
locale selection an inactivity timer is broken.

What version of PWM are you using?
latest build

Solution
PWM uses defer to load Javascript. This leads to problems with IE <= 9 because 
it does not work correctly in those versions. There is a lot if info on the web 
about this issue, see: https://github.com/h5bp/lazyweb-requests/issues/42

Basically the recommendation is: don't use defer for external scripts that can 
depend on each other if you need IE <= 9 support

I tested it myself by removing the defer attributes in the header.jsp:

Index: pwm/servlet/web/WEB-INF/jsp/fragment/header.jsp
===================================================================
--- pwm/servlet/web/WEB-INF/jsp/fragment/header.jsp     (revision 551)
+++ pwm/servlet/web/WEB-INF/jsp/fragment/header.jsp     (working copy)
@@ -53,7 +53,7 @@
     <% } %>
     <link href="<%=request.getContextPath()%><pwm:url url='/public/resources/dojo/dijit/themes/nihilo/nihilo.css'/>" rel="stylesheet" type="text/css"/>
     <script type="text/javascript">var PWM_GLOBAL = PWM_GLOBAL || {};var PWM_STRINGS = PWM_STRINGS || {};PWM_GLOBAL['startupFunctions'] = new Array();</script>
-    <script defer data-dojo-config="async: true" type="text/javascript" 
src="<%=request.getContextPath()%><pwm:url 
url='/public/resources/dojo/dojo/dojo.js'/>"></script>
-    <script defer type="text/javascript" 
src="<%=request.getContextPath()%><pwm:url 
url='/public/resources/js/main.js'/>"></script>
+    <script data-dojo-config="async: true" type="text/javascript" 
src="<%=request.getContextPath()%><pwm:url 
url='/public/resources/dojo/dojo/dojo.js'/>"></script>
+    <script type="text/javascript" src="<%=request.getContextPath()%><pwm:url 
url='/public/resources/js/main.js'/>"></script>
     <script defer type="text/javascript" src="<%=request.getContextPath()%><pwm:url url='/public/jsClientValues.jsp'/>?nonce=<%=Helper.makePwmVariableJsNonce(pwmApplicationHeader, pwmSessionHeader)%>"></script>
 </head>

After removing the defer attributes, locale switching is working again on the 
Captcha page with IE <= 9.

IE10 has fixed this issue, but the majority of IE users is still on version 8/9.

Note that there are more PWM JSP's that use the defer attribute. However I 
experience the problem only on the Captcha JSP. This is probably because the 
page-load is different due to the external Captcha call.

Original issue reported on code.google.com by sebastia...@gmail.com on 4 May 2013 at 7:29

GoogleCodeExporter commented 9 years ago

Original comment by menno.pi...@gmail.com on 24 May 2013 at 9:15

GoogleCodeExporter commented 9 years ago
Added to r563.

Original comment by menno.pi...@gmail.com on 28 May 2013 at 8:03

GoogleCodeExporter commented 9 years ago
Sorry, reverted patch. We need to think of a different solution.

Original comment by menno.pi...@gmail.com on 28 May 2013 at 8:36

GoogleCodeExporter commented 9 years ago
I have not been able to reproduce this issue on XP/IE8 or Win7-64/IE9.

Original comment by jrivard on 30 May 2013 at 7:33

GoogleCodeExporter commented 9 years ago
Interesting, I have initially reported this bug with a combo of XP/IE7. I'll 
retest this with IE8, once my XP VM is done with rebooting...ehhmm....I mean 
updating ;)

Original comment by sebastia...@gmail.com on 30 May 2013 at 6:19

GoogleCodeExporter commented 9 years ago
Ok retested this on XP with IE 8.0.6001.18702 and can reproduce it at 
pwmdemo.weisberg.net via Forgotten Password -> Captcha -> Switch Locale from EN 
to NL:

Line: 30
Error: Object expected

I know that I'm not compatible with Windows, so maybe that's it ;)

Original comment by sebastia...@gmail.com on 30 May 2013 at 6:39

GoogleCodeExporter commented 9 years ago
I could intermittendly reproduce on pwmdemo.weisberg.net, but not on my local 
machine on IE8.  I replaced the inline recapthca javascript with the Ajax 
version in revision 568, and I can no longer reproduce the issue with IE8.  
Please re-open if you are able to reproduce.

Original comment by jrivard on 31 May 2013 at 5:13

GoogleCodeExporter commented 9 years ago
Thanks for fixing, With the new Ajax version everything seems to be working 
correctly.

Original comment by sebastia...@gmail.com on 31 May 2013 at 6:06