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

Cannot edit / create ListViews if an item with name 'elements' exist

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • core
    • None
    • core:2.403
      core:2.361.3
    • 2.406

      When an item with the name "elements" exists where a view is being edited/created, trying to save the view results in a popup error: TypeError: Cannot set properties of null (setting 'value') (for not submitted)

      It could be any kind of item - a freestyle job, a pipeline, a maven job, a folder, ... - the name elements is that is listed within the "Job filters" is what causes the problem:

        1. dom-with-item-elements.png
          dom-with-item-elements.png
          386 kB
        2. dom-without-item-elements.png
          dom-without-item-elements.png
          276 kB
        3. error.png
          error.png
          69 kB
        4. job-filters-section.png
          job-filters-section.png
          47 kB

          [JENKINS-71200] Cannot edit / create ListViews if an item with name 'elements' exist

          Allan BURDAJEWICZ added a comment - - edited

          That is where it fails

          And basically that's because form.elements is not an array but the input with name elements:

          This input is generated by the ListView configure-entries.jelly:

          It produces the following input:

          <input name="elements" json="true" type="checkbox" title="elements" class="  ">
          <label title="elements" class="attach-previous ">elements</label>
          

          Might have to do with the fact that elements can be accessed by name / id ? So the input named elements overload the elements property ?

          Allan BURDAJEWICZ added a comment - - edited That is where it fails * https://github.com/jenkinsci/jenkins/blob/jenkins-2.403/war/src/main/webapp/scripts/hudson-behavior.js#L2448 And basically that's because form.elements is not an array but the input with name elements : https://github.com/jenkinsci/jenkins/blob/jenkins-2.403/war/src/main/webapp/scripts/hudson-behavior.js#L2349 This input is generated by the ListView configure-entries.jelly : https://github.com/jenkinsci/jenkins/blob/jenkins-2.403/core/src/main/resources/hudson/model/ListView/configure-entries.jelly#L47 It produces the following input: <input name= "elements" json= " true " type= "checkbox" title= "elements" class= " " > <label title= "elements" class= "attach-previous " >elements</label> Might have to do with the fact that elements can be accessed by name / id ? So the input named elements overload the elements property ?

          Basil Crow added a comment -

          Caused JENKINS-71403.

          Basil Crow added a comment - Caused JENKINS-71403 .

          Basil Crow added a comment -

          Caused JENKINS-71663.

          Basil Crow added a comment - Caused JENKINS-71663 .

            allan_burdajewicz Allan BURDAJEWICZ
            allan_burdajewicz Allan BURDAJEWICZ
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: