Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-19826

Apply button does not work in IE Compat View

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: core
    • Environment:
      IE8..10 Compatibility View
      build-timeout-1.11
      Jenkins version: 1.480.3, 1.509.2, 1.509.3
    • Similar Issues:

      Description

      Issue causes error after clicking on "Apply button" in Job's configuration (in IE with CompatView). Browser opens an empty new page, previous page shows an empty error box. BTW, "save" button works well..

      Examples of erroneous requests:

      • "/job/MY_JOB/descriptorByName/hudson.plugins.build_timeout.BuildTimeoutWrapper/fillTimeoutPercentageItems"
      • "/job/MY_JOB_2/descriptorByName/com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper/fillUserItems"
      • ...

      Exception message: Invalid argument

        Attachments

          Issue Links

            Activity

            oleg_nenashev Oleg Nenashev created issue -
            oleg_nenashev Oleg Nenashev made changes -
            Field Original Value New Value
            Environment IE 8..10
            build-timeout-1.11
            IE 8..10
            build-timeout-1.11
            Jenkins version: 1.480.3, 1.509.2, 1.509.3
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Callstack:

            dispatchException (hudson-behavior.js:2195)
            respondToReadyState (prototype.js:1659) // readystate=4; response text is filled correctly, but response.headerJSON is null
            onStateChange (prototype.js:1600)
            Anonymous function (prototype.js:414)

            Show
            oleg_nenashev Oleg Nenashev added a comment - Callstack: dispatchException (hudson-behavior.js:2195) respondToReadyState (prototype.js:1659) // readystate=4; response text is filled correctly, but response.headerJSON is null onStateChange (prototype.js:1600) Anonymous function (prototype.js:414)
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Issue seems to be caused by errors handling in Compat View. Error in Chrome is not related.

            Workaround 1: Don't use Compat View

            Proposal: Add X-UA-Compatible stub to generated HTML pages:

            <meta http-equiv="X-UA-Compatible" content="IE=11; IE=10; IE=9; IE=8; IE=7; IE=EDGE" />
            

            Sources:
            [1]: http://msdn.microsoft.com/en-us/library/ms533876%28VS.85%29.aspx
            [2]: http://twigstechtips.blogspot.ru/2010/03/css-ie8-meta-tag-to-disable.html

            Show
            oleg_nenashev Oleg Nenashev added a comment - Issue seems to be caused by errors handling in Compat View. Error in Chrome is not related. Workaround 1: Don't use Compat View Proposal: Add X-UA-Compatible stub to generated HTML pages: <meta http-equiv= "X-UA-Compatible" content= "IE=11; IE=10; IE=9; IE=8; IE=7; IE=EDGE" /> Sources: [1] : http://msdn.microsoft.com/en-us/library/ms533876%28VS.85%29.aspx [2] : http://twigstechtips.blogspot.ru/2010/03/css-ie8-meta-tag-to-disable.html
            oleg_nenashev Oleg Nenashev made changes -
            Summary JavaScript error corrupts Apply button in IE (and Chrome?) JavaScript error corrupts Apply button in IE10 Compat View
            Environment IE 8..10
            build-timeout-1.11
            Jenkins version: 1.480.3, 1.509.2, 1.509.3
            IE8..10 Compatibility View
            build-timeout-1.11
            Jenkins version: 1.480.3, 1.509.2, 1.509.3
            Priority Blocker [ 1 ] Major [ 3 ]
            oleg_nenashev Oleg Nenashev made changes -
            Summary JavaScript error corrupts Apply button in IE10 Compat View JavaScript errors corrupt Apply button in IE10 Compat View
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Seems that issue is related to fillXXXItems() from f:select only

            Show
            oleg_nenashev Oleg Nenashev added a comment - Seems that issue is related to fillXXXItems() from f:select only
            oleg_nenashev Oleg Nenashev made changes -
            Labels error f:select javascript webpage
            Assignee Kohsuke Kawaguchi [ kohsuke ]
            Description Issue causes error after clicking on "Apply button" in Job's configuration (in IE and Chrome), so I've marked issue as a blocker.

            Request:
            "/job/MY_JOB/descriptorByName/hudson.plugins.build_timeout.BuildTimeoutWrapper/fillTimeoutPercentageItems"

            Exception message: Invalid argument




            Issue causes error after clicking on "Apply button" in Job's configuration (in IE and Chrome), so I've marked issue as a blocker.

            Examples of erroneous requests:
            * "/job/MY_JOB/descriptorByName/hudson.plugins.build_timeout.BuildTimeoutWrapper/fillTimeoutPercentageItems"
            * "/job/AMY_JOB_2/descriptorByName/com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper/fillUserItems"
            * ...

            Exception message: Invalid argument




            Component/s core [ 15593 ]
            oleg_nenashev Oleg Nenashev made changes -
            Description Issue causes error after clicking on "Apply button" in Job's configuration (in IE and Chrome), so I've marked issue as a blocker.

            Examples of erroneous requests:
            * "/job/MY_JOB/descriptorByName/hudson.plugins.build_timeout.BuildTimeoutWrapper/fillTimeoutPercentageItems"
            * "/job/AMY_JOB_2/descriptorByName/com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper/fillUserItems"
            * ...

            Exception message: Invalid argument




            Issue causes error after clicking on "Apply button" in Job's configuration (in IE with CompatView).

            Examples of erroneous requests:
            * "/job/MY_JOB/descriptorByName/hudson.plugins.build_timeout.BuildTimeoutWrapper/fillTimeoutPercentageItems"
            * "/job/AMY_JOB_2/descriptorByName/com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper/fillUserItems"
            * ...

            Exception message: Invalid argument




            Hide
            ndeloof Nicolas De Loof added a comment -

            can you give 1.12 a try ?
            I can't reproduce this error with 1.509/1.12 on Chrome (don't have IE to test)

            Show
            ndeloof Nicolas De Loof added a comment - can you give 1.12 a try ? I can't reproduce this error with 1.509/1.12 on Chrome (don't have IE to test)
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Hello Nicolas,

            I suppose that there's no bug in build-timeout. I've experienced such error in several other places, which use fillItems() for selects.

            https://github.com/jenkinsci/build-timeout-plugin/pull/16 resolves issue for build-timeout, but it does not help in general. I'll resubmit bug to the core.

            BR, Oleg

            Show
            oleg_nenashev Oleg Nenashev added a comment - Hello Nicolas, I suppose that there's no bug in build-timeout. I've experienced such error in several other places, which use fillItems() for selects. https://github.com/jenkinsci/build-timeout-plugin/pull/16 resolves issue for build-timeout, but it does not help in general. I'll resubmit bug to the core. BR, Oleg
            oleg_nenashev Oleg Nenashev made changes -
            Labels error f:select javascript webpage core error f:select javascript webpage
            jglick Jesse Glick made changes -
            Component/s build-timeout [ 15530 ]
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Updated description

            Show
            oleg_nenashev Oleg Nenashev added a comment - Updated description
            oleg_nenashev Oleg Nenashev made changes -
            Description Issue causes error after clicking on "Apply button" in Job's configuration (in IE with CompatView).

            Examples of erroneous requests:
            * "/job/MY_JOB/descriptorByName/hudson.plugins.build_timeout.BuildTimeoutWrapper/fillTimeoutPercentageItems"
            * "/job/AMY_JOB_2/descriptorByName/com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper/fillUserItems"
            * ...

            Exception message: Invalid argument




            Issue causes error after clicking on "Apply button" in Job's configuration (in IE with CompatView). Browser opens an empty new page, previous page shows an empty error box. BTW, "save" button works well..

            Examples of erroneous requests:
            * "/job/MY_JOB/descriptorByName/hudson.plugins.build_timeout.BuildTimeoutWrapper/fillTimeoutPercentageItems"
            * "/job/MY_JOB_2/descriptorByName/com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper/fillUserItems"
            * ...

            Exception message: Invalid argument


            Hide
            jglick Jesse Glick added a comment -

            While I can reproduce this error, I have made no headway in diagnosing it. Cannot even find how to convince IE to show the original callstack.

            Is the problem just that we have an obsolete version of Prototype that does not support all IE versions?

            Setting X-UA-Compatible seems like a workaround, not a fix.

            Show
            jglick Jesse Glick added a comment - While I can reproduce this error, I have made no headway in diagnosing it. Cannot even find how to convince IE to show the original callstack. Is the problem just that we have an obsolete version of Prototype that does not support all IE versions? Setting X-UA-Compatible seems like a workaround, not a fix.
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Probably yes, but the issue can be reproduced in 1.480.3/IE8 Compat View as well. Hence it should be a quite old regression issue.
            On the other hand many people have to use IE, so it is very strange that it has not been reproduced/submitted before.
            It is also strange that IE goes to Compat View by default.

            My JavaScript skills are close to zero, but I can perform addition testing if required.

            Show
            oleg_nenashev Oleg Nenashev added a comment - Probably yes, but the issue can be reproduced in 1.480.3/IE8 Compat View as well. Hence it should be a quite old regression issue. On the other hand many people have to use IE, so it is very strange that it has not been reproduced/submitted before. It is also strange that IE goes to Compat View by default. My JavaScript skills are close to zero, but I can perform addition testing if required.
            Hide
            jglick Jesse Glick added a comment -

            My JavaScript is also weak. I am hoping to find someone who would be able to investigate this properly, maybe also providing a proper fix of JENKINS-19171.

            Show
            jglick Jesse Glick added a comment - My JavaScript is also weak. I am hoping to find someone who would be able to investigate this properly, maybe also providing a proper fix of JENKINS-19171 .
            jglick Jesse Glick made changes -
            Link This issue is related to JENKINS-19171 [ JENKINS-19171 ]
            Hide
            jglick Jesse Glick added a comment -

            During page load I am getting SCRIPT87: Invalid argument. from hudson-behavior.js:397:

            return element.fireEvent('on'+event,evt)
            

            for an event of filled. Catching this error (and returning false) does not suffice to make the Apply button work, but I cannot find any new error printed at that time, so that may be a red herring. Possibly related to JENKINS-20772.

            Show
            jglick Jesse Glick added a comment - During page load I am getting SCRIPT87: Invalid argument. from hudson-behavior.js:397 : return element.fireEvent( 'on' +event,evt) for an event of filled . Catching this error (and returning false ) does not suffice to make the Apply button work, but I cannot find any new error printed at that time, so that may be a red herring. Possibly related to JENKINS-20772 .
            jglick Jesse Glick made changes -
            Link This issue is related to JENKINS-20772 [ JENKINS-20772 ]
            Hide
            jglick Jesse Glick added a comment -

            So the response body from configSubmit is correct (supposed to show Saved in the notification bar). But in apply.js, the iframe has no content. Unclear whether this is actually related to the JS errors thrown earlier.

            Show
            jglick Jesse Glick added a comment - So the response body from configSubmit is correct (supposed to show Saved in the notification bar). But in apply.js , the iframe has no content. Unclear whether this is actually related to the JS errors thrown earlier.
            Show
            jglick Jesse Glick added a comment - http://stackoverflow.com/questions/2181385/ie-issue-submitting-form-to-an-iframe-using-javascript seems to be the explanation.
            jglick Jesse Glick made changes -
            Assignee Jesse Glick [ jglick ]
            jglick Jesse Glick made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            jglick Jesse Glick made changes -
            Labels core error f:select javascript webpage javascript lts-candidate
            Hide
            jglick Jesse Glick added a comment -

            I see no evidence that the JS errors were in any way related to the problem with the Apply button. Maybe they should be fixed somehow, but I do not know what their cause is, or what the impact is.

            Testing on IE 9.

            Show
            jglick Jesse Glick added a comment - I see no evidence that the JS errors were in any way related to the problem with the Apply button. Maybe they should be fixed somehow, but I do not know what their cause is, or what the impact is. Testing on IE 9.
            jglick Jesse Glick made changes -
            Summary JavaScript errors corrupt Apply button in IE10 Compat View Apply button does not work in IE Compat View
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            changelog.html
            core/src/main/resources/lib/form/apply/apply.js
            http://jenkins-ci.org/commit/jenkins/dda099c19a7a015d9c2fc655754dbb07b1b39455
            Log:
            [FIXED JENKINS-19826] element.setAttribute('name', …) does not work in IE in compatibility mode, so use prototype’s Element(…) which does.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: changelog.html core/src/main/resources/lib/form/apply/apply.js http://jenkins-ci.org/commit/jenkins/dda099c19a7a015d9c2fc655754dbb07b1b39455 Log: [FIXED JENKINS-19826] element.setAttribute('name', …) does not work in IE in compatibility mode, so use prototype’s Element(…) which does.
            scm_issue_link SCM/JIRA link daemon made changes -
            Status In Progress [ 3 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Thanks a lot for the fix

            Show
            oleg_nenashev Oleg Nenashev added a comment - Thanks a lot for the fix
            Hide
            jglick Jesse Glick added a comment -

            @oleg_nenashev sure; please help verify in any way you can.

            Show
            jglick Jesse Glick added a comment - @oleg_nenashev sure; please help verify in any way you can.
            oleg_nenashev Oleg Nenashev made changes -
            Assignee Jesse Glick [ jglick ] Oleg Nenashev [ oleg_nenashev ]
            Hide
            dogfood dogfood added a comment -

            Integrated in jenkins_main_trunk #3153
            [FIXED JENKINS-19826] element.setAttribute('name', …) does not work in IE in compatibility mode, so use prototype’s Element(…) which does. (Revision dda099c19a7a015d9c2fc655754dbb07b1b39455)

            Result = SUCCESS
            Jesse Glick : dda099c19a7a015d9c2fc655754dbb07b1b39455
            Files :

            • core/src/main/resources/lib/form/apply/apply.js
            • changelog.html
            Show
            dogfood dogfood added a comment - Integrated in jenkins_main_trunk #3153 [FIXED JENKINS-19826] element.setAttribute('name', …) does not work in IE in compatibility mode, so use prototype’s Element(…) which does. (Revision dda099c19a7a015d9c2fc655754dbb07b1b39455) Result = SUCCESS Jesse Glick : dda099c19a7a015d9c2fc655754dbb07b1b39455 Files : core/src/main/resources/lib/form/apply/apply.js changelog.html
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            core/src/main/resources/lib/form/apply/apply.js
            http://jenkins-ci.org/commit/jenkins/eca76d7700231a83db3db98d43e570670f48fc23
            Log:
            [FIXED JENKINS-19826] element.setAttribute('name', …) does not work in IE in compatibility mode, so use prototype’s Element(…) which does.

            (cherry picked from commit dda099c19a7a015d9c2fc655754dbb07b1b39455)

            Conflicts:
            changelog.html

            Compare: https://github.com/jenkinsci/jenkins/compare/14214d9b2785...eca76d770023

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: core/src/main/resources/lib/form/apply/apply.js http://jenkins-ci.org/commit/jenkins/eca76d7700231a83db3db98d43e570670f48fc23 Log: [FIXED JENKINS-19826] element.setAttribute('name', …) does not work in IE in compatibility mode, so use prototype’s Element(…) which does. (cherry picked from commit dda099c19a7a015d9c2fc655754dbb07b1b39455) Conflicts: changelog.html Compare: https://github.com/jenkinsci/jenkins/compare/14214d9b2785...eca76d770023
            olivergondza Oliver Gondža made changes -
            Labels javascript lts-candidate 1.532.3-fixed javascript
            oleg_nenashev Oleg Nenashev made changes -
            Link This issue is blocking JENKINS-16415 [ JENKINS-16415 ]
            jglick Jesse Glick made changes -
            Labels 1.532.3-fixed javascript 1.532.3-fixed ie javascript
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 151347 ] JNJira + In-Review [ 193887 ]

              People

              • Assignee:
                oleg_nenashev Oleg Nenashev
                Reporter:
                oleg_nenashev Oleg Nenashev
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: