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

<st:bind> seems to include json2.js, but not everytime

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Won't Fix
    • Component/s: core
    • Labels:
      None
    • Environment:
      Jenkins 1.523
    • Similar Issues:

      Description

      When installing SCM-Sync-Configuration plugin v0.0.7.2 on 1.523, it seems like this line of code :

      var plugin = <st:bind value="${it}"/>;
      

      is sometimes (depending on Jenkins installations) generating a strange output in the HTML :

      var plugin = <script src='/jenkins/adjuncts/9f64aaa1/org/kohsuke/stapler/json2.js' type='text/javascript'></script>makeStaplerProxy('/jenkins/$stapler/bound/47f87312-880f-40fc-9a12-0a75149deedc','xxxxxxxxxxxxxxxxxx',['purgeScmSyncConfigLogs']);
      

      Whereas in 1.509.2, I have this generated output :

      var plugin = makeStaplerProxy('/$stapler/bound/<some-token>','<another token>',['purgeScmSyncConfigLogs']);
      

      I personnally don't reproduce it on a fresh 1.523 install, but Björn Pedersen is reproducing it on its instance.

      Is there something bad :

      • In my code (I shouldn't affect the call to <st:bind> to a js variable because it could potentially has to include necessary third party js files like json2.js)
        => if this is the case, is there a workaround to proxify my plugin instance on the JS clientside world ? (other than having to do stuff by hand by sending manual Ajax calls to the server side)
      • In Björn Pedersen's installation, or Jenkins core ?

      Side note : Seems like the source of the problem is located in this commit which loads json2.js if it isn't already loaded.

        Attachments

          Issue Links

            Activity

            Hide
            sogabe sogabe added a comment -

            If jQuery plugin installed, <st:bind> includes json2.js. see https://github.com/stapler/stapler/commit/48cdf0f3242c6a79bb398e9115c0db7526c42a50

            workaround:

            "<st:bind var="plugin" value="${it}" />" instead of "var plugin = <st:bind value="${it}"/>;"

            Show
            sogabe sogabe added a comment - If jQuery plugin installed, <st:bind> includes json2.js. see https://github.com/stapler/stapler/commit/48cdf0f3242c6a79bb398e9115c0db7526c42a50 workaround: "<st:bind var="plugin" value="${it}" />" instead of "var plugin = <st:bind value="${it}"/>;"
            Hide
            fcamblor Frédéric Camblor added a comment -

            Thx this is what I was expecting, closing the issue.

            Do you know where I could see the available (stapler) jelly tags documentations ? Because on http://stapler.kohsuke.org/jelly-taglib-ref.html there wasn't any reference for `bind` tag

            Show
            fcamblor Frédéric Camblor added a comment - Thx this is what I was expecting, closing the issue. Do you know where I could see the available (stapler) jelly tags documentations ? Because on http://stapler.kohsuke.org/jelly-taglib-ref.html there wasn't any reference for `bind` tag
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Nalin Makar
            Path:
            README
            src/main/resources/hudson/plugins/testng/results/PackageResult/reportDetail.groovy
            http://jenkins-ci.org/commit/testng-plugin-plugin/4767eb1660876a2d8498429e2e8220c3df87ff23
            Log:
            Fixed JENKINS-19157 - Make st:bind work when Jenkins has jQuery plugin installed

            See JENKINS-18867 and JENKINS-18875 for more context

            Testing: unit tests continue to pass. unable to reproduce this locally

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Nalin Makar Path: README src/main/resources/hudson/plugins/testng/results/PackageResult/reportDetail.groovy http://jenkins-ci.org/commit/testng-plugin-plugin/4767eb1660876a2d8498429e2e8220c3df87ff23 Log: Fixed JENKINS-19157 - Make st:bind work when Jenkins has jQuery plugin installed See JENKINS-18867 and JENKINS-18875 for more context Testing: unit tests continue to pass. unable to reproduce this locally

              People

              • Assignee:
                Unassigned
                Reporter:
                fcamblor Frédéric Camblor
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: