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

Filter on labelled checkbox choices throws a Javascript exception

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • active-choices-plugin
    • None
    • Jenkins 2.277.4
      uno-choice 2.5.6

      A Javascript error is thrown (in browser console) when filtering an Active Choice Parameter with labelled checkbox choices.

      The error :

      unochoice.js:802 Uncaught TypeError: Cannot read properties of undefined (reading 'tagName')
          at HTMLInputElement.<anonymous> (unochoice.js:802)
          at HTMLInputElement.dispatch (jquery.full.js:5226)
          at HTMLInputElement.elemData.handle (jquery.full.js:4878)
      

      The config.xml :

      <?xml version='1.1' encoding='UTF-8'?>
      <flow-definition plugin="workflow-job@2.40">
        <properties>
          <hudson.model.ParametersDefinitionProperty>
            <parameterDefinitions>
              <org.biouno.unochoice.ChoiceParameter plugin="uno-choice@2.5.6">
                <name>foo</name>
                <description></description>
                <randomName>choice-parameter-15212631359824743</randomName>
                <visibleItemCount>1</visibleItemCount>
                <script class="org.biouno.unochoice.model.GroovyScript">
                  <secureScript plugin="script-security@1.77">
                    <script>[&apos;foo&apos;: &apos;This is foo&apos;, &apos;bar&apos;: &apos;This is bar&apos;, &apos;baz&apos;: &apos;This is baz&apos;]
      </script>
                    <sandbox>true</sandbox>
                  </secureScript>
                  <secureFallbackScript plugin="script-security@1.77">
                    <script>[&apos;fallback&apos;]</script>
                    <sandbox>true</sandbox>
                  </secureFallbackScript>
                </script>
                <projectName>test-eci-activechoice</projectName>
                <projectFullName>test-eci-activechoice</projectFullName>
                <choiceType>PT_CHECKBOX</choiceType>
                <filterable>true</filterable>
                <filterLength>1</filterLength>
              </org.biouno.unochoice.ChoiceParameter>
            </parameterDefinitions>
          </hudson.model.ParametersDefinitionProperty>
        </properties>
        <definition class="org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition" plugin="workflow-cps@2.92">
          <script>pipeline {
          agent any
      
          stages {
              stage(&apos;Hello&apos;) {
                  steps {
                      echo &apos;Hello World&apos;
                  }
              }
          }
      }
      </script>
          <sandbox>true</sandbox>
        </definition>
        <disabled>false</disabled>
      </flow-definition>
      

          [JENKINS-66703] Filter on labelled checkbox choices throws a Javascript exception

          Eric Citaire created issue -
          Eric Citaire made changes -
          Description Original: A Javascript error is thrown (in browser console) when filtering an Active Choice Parameter with labelled checkbox choices.

          The error :
          {code:java}
          unochoice.js:802 Uncaught TypeError: Cannot read properties of undefined (reading 'tagName')
              at HTMLInputElement.<anonymous> (unochoice.js:802)
              at HTMLInputElement.dispatch (jquery.full.js:5226)
              at HTMLInputElement.elemData.handle (jquery.full.js:4878)
          {code}
          The config.xml :
          {code:xml}
          <?xml version='1.1' encoding='UTF-8'?>
          <flow-definition plugin="workflow-job@2.40">
            <actions/>
            <description></description>
            <keepDependencies>false</keepDependencies>
            <properties>
              <hudson.model.ParametersDefinitionProperty>
                <parameterDefinitions>
                  <org.biouno.unochoice.ChoiceParameter plugin="uno-choice@2.5.6">
                    <name>foo</name>
                    <description></description>
                    <randomName>choice-parameter-15212631359824743</randomName>
                    <visibleItemCount>1</visibleItemCount>
                    <script class="org.biouno.unochoice.model.GroovyScript">
                      <secureScript plugin="script-security@1.77">
                        <script>[&apos;foo&apos;: &apos;This is foo&apos;, &apos;bar&apos;: &apos;This is bar&apos;, &apos;baz&apos;: &apos;This is baz&apos;]
          </script>
                        <sandbox>true</sandbox>
                      </secureScript>
                      <secureFallbackScript plugin="script-security@1.77">
                        <script>[&apos;fallback&apos;]</script>
                        <sandbox>true</sandbox>
                      </secureFallbackScript>
                    </script>
                    <projectName>test-eci-activechoice</projectName>
                    <projectFullName>test-eci-activechoice</projectFullName>
                    <choiceType>PT_CHECKBOX</choiceType>
                    <filterable>true</filterable>
                    <filterLength>1</filterLength>
                  </org.biouno.unochoice.ChoiceParameter>
                </parameterDefinitions>
              </hudson.model.ParametersDefinitionProperty>
            </properties>
            <definition class="org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition" plugin="workflow-cps@2.92">
              <script>pipeline {
              agent any

              stages {
                  stage(&apos;Hello&apos;) {
                      steps {
                          echo &apos;Hello World&apos;
                      }
                  }
              }
          }
          </script>
              <sandbox>true</sandbox>
            </definition>
            <triggers/>
            <disabled>false</disabled>
          </flow-definition>
          {code}
          New: A Javascript error is thrown (in browser console) when filtering an Active Choice Parameter with labelled checkbox choices.

          The error :
          {code:java}
          unochoice.js:802 Uncaught TypeError: Cannot read properties of undefined (reading 'tagName')
              at HTMLInputElement.<anonymous> (unochoice.js:802)
              at HTMLInputElement.dispatch (jquery.full.js:5226)
              at HTMLInputElement.elemData.handle (jquery.full.js:4878)
          {code}
          The config.xml :
          {code:xml}
          <?xml version='1.1' encoding='UTF-8'?>
          <flow-definition plugin="workflow-job@2.40">
            <properties>
              <hudson.model.ParametersDefinitionProperty>
                <parameterDefinitions>
                  <org.biouno.unochoice.ChoiceParameter plugin="uno-choice@2.5.6">
                    <name>foo</name>
                    <description></description>
                    <randomName>choice-parameter-15212631359824743</randomName>
                    <visibleItemCount>1</visibleItemCount>
                    <script class="org.biouno.unochoice.model.GroovyScript">
                      <secureScript plugin="script-security@1.77">
                        <script>[&apos;foo&apos;: &apos;This is foo&apos;, &apos;bar&apos;: &apos;This is bar&apos;, &apos;baz&apos;: &apos;This is baz&apos;]
          </script>
                        <sandbox>true</sandbox>
                      </secureScript>
                      <secureFallbackScript plugin="script-security@1.77">
                        <script>[&apos;fallback&apos;]</script>
                        <sandbox>true</sandbox>
                      </secureFallbackScript>
                    </script>
                    <projectName>test-eci-activechoice</projectName>
                    <projectFullName>test-eci-activechoice</projectFullName>
                    <choiceType>PT_CHECKBOX</choiceType>
                    <filterable>true</filterable>
                    <filterLength>1</filterLength>
                  </org.biouno.unochoice.ChoiceParameter>
                </parameterDefinitions>
              </hudson.model.ParametersDefinitionProperty>
            </properties>
            <definition class="org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition" plugin="workflow-cps@2.92">
              <script>pipeline {
              agent any

              stages {
                  stage(&apos;Hello&apos;) {
                      steps {
                          echo &apos;Hello World&apos;
                      }
                  }
              }
          }
          </script>
              <sandbox>true</sandbox>
            </definition>
            <disabled>false</disabled>
          </flow-definition>
          {code}
          Bruno P. Kinoshita made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Bruno P. Kinoshita made changes -
          Attachment New: GIFrecord_2021-10-27_090355.gif [ 56665 ]
          Ioannis Moutsatsos made changes -
          Link New: This issue duplicates JENKINS-67982 [ JENKINS-67982 ]
          Ioannis Moutsatsos made changes -
          Assignee Original: Bruno P. Kinoshita [ kinow ] New: Ioannis Moutsatsos [ ioannis ]
          Resolution New: Fixed [ 1 ]
          Status Original: In Progress [ 3 ] New: Resolved [ 5 ]
          Ioannis Moutsatsos made changes -
          Status Original: Resolved [ 5 ] New: Closed [ 6 ]

            ioannis Ioannis Moutsatsos
            ericcitaire Eric Citaire
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: