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

Active choice reactive reference parameter not working on checkbox reference

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: active-choices-plugin
    • Labels:
      None
    • Environment:
      Jenkins 2.6 (win), Active choices 1.4, Chrome 51
    • Similar Issues:

      Description

      When I create an active choices reactive reference like the wine example but using a checkbox parameter instead an single value selection it won't get updated on changing the checkboxes. If I modify the choice type of the reference parameter to single select it works.

        Attachments

        1. config[1].xml
          10 kB
        2. example.jpg
          example.jpg
          2 kB
        3. GIFrecord_2016-10-26_132739.gif
          GIFrecord_2016-10-26_132739.gif
          144 kB
        4. GIFrecord_2016-10-26_134846.gif
          GIFrecord_2016-10-26_134846.gif
          97 kB
        5. image-2017-03-30-12-27-15-823.png
          image-2017-03-30-12-27-15-823.png
          24 kB
        6. image-2017-03-30-12-27-53-554.png
          image-2017-03-30-12-27-53-554.png
          24 kB
        7. jenkins2016103101.png
          jenkins2016103101.png
          314 kB
        8. jquery.png
          jquery.png
          45 kB
        9. screenshot-1.png
          screenshot-1.png
          19 kB
        10. Screenshot from 2016-10-26 13-46-44.png
          Screenshot from 2016-10-26 13-46-44.png
          67 kB
        11. Screenshot from 2016-10-26 13-46-58.png
          Screenshot from 2016-10-26 13-46-58.png
          56 kB
        12. setup.jpg
          setup.jpg
          106 kB
        13. uno-choice-0.15-20161026.hpi
          1.73 MB
        14. uno-choice-20161029.hpi
          1.74 MB

          Issue Links

            Activity

            Hide
            mattsbg Matthias Zangl added a comment -

            Hi Bruno,

            ok, started from scratch. I installed the jenkins 2.19.1 using the suggest plugins during installation. After that I installed active choices plugin and built my demo project. As expected it worked. Then I only installed jQuery plugin + restarted jenkins service and the sample stopped working. Disabling the jQuery plugin and restart jenkins service it works again.

            At this point I started from scratch again. This time I didn't install any plugins during jenkins installation routine. After installation I just added active choices plugin (including the plugins it obviously depends on), restarted and my example project worked. Then I just installed jquery (and its depending plugins) , restarted and it didn't work anymore.

            The host in this sandbox environment was a windows 7 32 bit.

            Hope this helps you to reproduce it on your side.

            best regards,
            Matthias

            Show
            mattsbg Matthias Zangl added a comment - Hi Bruno, ok, started from scratch. I installed the jenkins 2.19.1 using the suggest plugins during installation. After that I installed active choices plugin and built my demo project. As expected it worked. Then I only installed jQuery plugin + restarted jenkins service and the sample stopped working. Disabling the jQuery plugin and restart jenkins service it works again. At this point I started from scratch again. This time I didn't install any plugins during jenkins installation routine. After installation I just added active choices plugin (including the plugins it obviously depends on), restarted and my example project worked. Then I just installed jquery (and its depending plugins) , restarted and it didn't work anymore. The host in this sandbox environment was a windows 7 32 bit. Hope this helps you to reproduce it on your side. best regards, Matthias
            Hide
            ioannis Ioannis Moutsatsos added a comment -

            Matthias Zangl thank you for your investigation. I finally can reproduce this bug and I can confirm that is related not only to the jQuery plugin, but also a particular version of the plugin. Active Choice Reactive references are working as expected with jQuery plugin 1.7.2-1 but not with the latest version 1.11.2-0.

            Hopefully Bruno P. Kinoshita will be able to focus on this particular finding to resolve the bug. Thank you both!!

             

            Bruno P. Kinoshita attached is an example to try.

            With multi-select you get this

             

            With Check Boxes you get

            Note that the checkbox values are not propagated to AC_REFPRAM_C but interestingly, they are propagated to the build!

            config[1].xml

            Show
            ioannis Ioannis Moutsatsos added a comment - Matthias Zangl thank you for your investigation. I finally can reproduce this bug and I can confirm that is related not only to the jQuery plugin, but also a particular version of the plugin. Active Choice Reactive references are working as expected with jQuery plugin 1.7.2-1 but not with the latest version 1.11.2-0. Hopefully Bruno P. Kinoshita will be able to focus on this particular finding to resolve the bug. Thank you both!!   Bruno P. Kinoshita attached is an example to try. With multi-select you get this   With Check Boxes you get Note that the checkbox values are not propagated to AC_REFPRAM_C but interestingly, they are propagated to the build! config[1].xml
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Bruno P. Kinoshita
            Path:
            pom.xml
            src/test/js/lib/jquery-1.11.2.min.js
            src/test/js/lib/jquery-1.7.2.min.js
            src/test/js/lib/qunit-1.14.0.css
            src/test/js/lib/qunit-1.14.0.js
            src/test/js/lib/tests.html
            http://jenkins-ci.org/commit/active-choices-plugin/8a97011b547cde9520929a1370e38c0b3a4972ef
            Log:
            JENKINS-36158: update JQuery to 1.11.2 to match stapler-jquery-adjunct's version

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Bruno P. Kinoshita Path: pom.xml src/test/js/lib/jquery-1.11.2.min.js src/test/js/lib/jquery-1.7.2.min.js src/test/js/lib/qunit-1.14.0.css src/test/js/lib/qunit-1.14.0.js src/test/js/lib/tests.html http://jenkins-ci.org/commit/active-choices-plugin/8a97011b547cde9520929a1370e38c0b3a4972ef Log: JENKINS-36158 : update JQuery to 1.11.2 to match stapler-jquery-adjunct's version
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Bruno P. Kinoshita
            Path:
            src/main/resources/org/biouno/unochoice/stapler/unochoice/unochoice.js
            http://jenkins-ci.org/commit/active-choices-plugin/a5f051216707b73f214748bf1717ec9e98acea55
            Log:
            [FIXED JENKINS-36158] use .prop instead of .attr, and treat it as bool

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Bruno P. Kinoshita Path: src/main/resources/org/biouno/unochoice/stapler/unochoice/unochoice.js http://jenkins-ci.org/commit/active-choices-plugin/a5f051216707b73f214748bf1717ec9e98acea55 Log: [FIXED JENKINS-36158] use .prop instead of .attr, and treat it as bool
            Hide
            kinow Bruno P. Kinoshita added a comment -

            Previous change was to upgrade JQuery. Then started debugging this issue after a message on the biouno-developers mailing list.

            Debugging, could find that a e.attr('checked') was returning undefined, though it was supposed to return something... searching I found some people with similar problem. Looks like e.attr() was replaced by e.prop(), and now it returns boolean.

            http://forum.jquery.com/topic/please-explain-attr-vs-prop-change-in-1-6
            https://stackoverflow.com/questions/5270689/attrchecked-checked-does-not-work/15385392

            Fixed, included in the next release. Thanks!
            Bruno

            Show
            kinow Bruno P. Kinoshita added a comment - Previous change was to upgrade JQuery. Then started debugging this issue after a message on the biouno-developers mailing list. Debugging, could find that a e.attr('checked') was returning undefined, though it was supposed to return something... searching I found some people with similar problem. Looks like e.attr() was replaced by e.prop(), and now it returns boolean. http://forum.jquery.com/topic/please-explain-attr-vs-prop-change-in-1-6 https://stackoverflow.com/questions/5270689/attrchecked-checked-does-not-work/15385392 Fixed, included in the next release. Thanks! Bruno

              People

              • Assignee:
                kinow Bruno P. Kinoshita
                Reporter:
                mattsbg Matthias Zangl
              • Votes:
                2 Vote for this issue
                Watchers:
                11 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: