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

codemirror-mode on f:textarea broken (was: Execute shell build step text not saved properly)

      When I create a simple project and add Execute shell task,
      after save, the task contents are empty.
      config.xml on the server is empty too:

      <hudson.tasks.Shell><command/></hudson.tasks.Shell>
      

      When editing the config a second time, the contents are saved properly.
      Each consecutive add of shell task requires a second edit.

      When using inheritance plugin, there is no way to workaround the bug, since each edit creates new revision, and all shell tasks are empty.

      I tested it on 1.563 and 1.564

          [JENKINS-23151] codemirror-mode on f:textarea broken (was: Execute shell build step text not saved properly)

          Code changed in jenkins
          User: Jesse Glick
          Path:
          changelog.html
          core/src/main/resources/hudson/tasks/Shell/config.groovy
          http://jenkins-ci.org/commit/jenkins/7f7eb60bdd4aa55f0d56c21ef04c12d4922399e4
          Log:
          JENKINS-23151 Need to revert part of 5789f0c since codemirror-mode on f:textarea apparently does not work for lazy-load fragments.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: changelog.html core/src/main/resources/hudson/tasks/Shell/config.groovy http://jenkins-ci.org/commit/jenkins/7f7eb60bdd4aa55f0d56c21ef04c12d4922399e4 Log: JENKINS-23151 Need to revert part of 5789f0c since codemirror-mode on f:textarea apparently does not work for lazy-load fragments.

          Daniel Beck added a comment -

          Assuming relation to JENKINS-23148 given the version range reported. Unclear whether it's codemirror or this change.

          Daniel Beck added a comment - Assuming relation to JENKINS-23148 given the version range reported. Unclear whether it's codemirror or this change.

          dogfood added a comment -

          Integrated in jenkins_main_trunk #3407
          JENKINS-23151 Need to revert part of 5789f0c since codemirror-mode on f:textarea apparently does not work for lazy-load fragments. (Revision 7f7eb60bdd4aa55f0d56c21ef04c12d4922399e4)

          Result = SUCCESS
          Jesse Glick : 7f7eb60bdd4aa55f0d56c21ef04c12d4922399e4
          Files :

          • core/src/main/resources/hudson/tasks/Shell/config.groovy
          • changelog.html

          dogfood added a comment - Integrated in jenkins_main_trunk #3407 JENKINS-23151 Need to revert part of 5789f0c since codemirror-mode on f:textarea apparently does not work for lazy-load fragments. (Revision 7f7eb60bdd4aa55f0d56c21ef04c12d4922399e4) Result = SUCCESS Jesse Glick : 7f7eb60bdd4aa55f0d56c21ef04c12d4922399e4 Files : core/src/main/resources/hudson/tasks/Shell/config.groovy changelog.html

          Jesse Glick added a comment -

          Probable workaround:

          <f:entry title="…" field="…">
              <j:choose>
                  <j:when test="${instance != null}">
                      <st:adjunct includes="org.kohsuke.stapler.codemirror.mode.groovy.groovy"/>
                      <f:textarea codemirror-mode="…"/>
                  </j:when>
                  <j:otherwise>
                      <f:textarea/>
                  </j:otherwise>
              </j:choose>
          </f:entry>
          

          This does not address JENKINS-15604 or JENKINS-23148, however.

          Jesse Glick added a comment - Probable workaround: <f:entry title= "…" field= "…" > <j:choose> <j:when test= "${instance != null}" > <st:adjunct includes= "org.kohsuke.stapler.codemirror.mode.groovy.groovy" /> <f:textarea codemirror-mode= "…" /> </j:when> <j:otherwise> <f:textarea/> </j:otherwise> </j:choose> </f:entry> This does not address JENKINS-15604 or JENKINS-23148 , however.

          Daniel Beck added a comment -

          Oliver doesn't consider unresolved issues for LTS inclusion even when they have related commits, so I created JENKINS-23632 to make the workaround eligible.

          Daniel Beck added a comment - Oliver doesn't consider unresolved issues for LTS inclusion even when they have related commits, so I created JENKINS-23632 to make the workaround eligible.

          Jesse Glick added a comment -

          Thanks, I was too lazy to do that myself!

          Jesse Glick added a comment - Thanks, I was too lazy to do that myself!

          Code changed in jenkins
          User: Jesse Glick
          Path:
          core/src/main/resources/hudson/tasks/Shell/config.groovy
          http://jenkins-ci.org/commit/jenkins/f3848d2d4865bb5eab1ff0ae0bfdf90aab76b138
          Log:
          JENKINS-23151 Need to revert part of 5789f0c since codemirror-mode on f:textarea apparently does not work for lazy-load fragments.

          (cherry picked from commit 7f7eb60bdd4aa55f0d56c21ef04c12d4922399e4)

          Conflicts:
          changelog.html

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: core/src/main/resources/hudson/tasks/Shell/config.groovy http://jenkins-ci.org/commit/jenkins/f3848d2d4865bb5eab1ff0ae0bfdf90aab76b138 Log: JENKINS-23151 Need to revert part of 5789f0c since codemirror-mode on f:textarea apparently does not work for lazy-load fragments. (cherry picked from commit 7f7eb60bdd4aa55f0d56c21ef04c12d4922399e4) Conflicts: changelog.html

          Code changed in jenkins
          User: Vojtech Juranek
          Path:
          core/src/main/resources/hudson/tasks/Shell/config.groovy
          core/src/main/resources/lib/form/textarea/textarea.js
          http://jenkins-ci.org/commit/jenkins/4e48eaa05ca3a76fcb0e1eee307fd20f222079bc
          Log:
          [FIXED JENKINS-23151, JENKINS-23026] Save CodeMirror editor when it loses focus

          • Save CM editor when it loses focus to ensure that test is saved back to textarea
          • Turn on again CM editor for shell scripts

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Vojtech Juranek Path: core/src/main/resources/hudson/tasks/Shell/config.groovy core/src/main/resources/lib/form/textarea/textarea.js http://jenkins-ci.org/commit/jenkins/4e48eaa05ca3a76fcb0e1eee307fd20f222079bc Log: [FIXED JENKINS-23151, JENKINS-23026] Save CodeMirror editor when it loses focus Save CM editor when it loses focus to ensure that test is saved back to textarea Turn on again CM editor for shell scripts

          Daniel Beck added a comment -

          vjuranek This should be resolved, right?

          Daniel Beck added a comment - vjuranek This should be resolved, right?

          Daniel Beck added a comment -

          Should be fixed since Jan 2015.

          Daniel Beck added a comment - Should be fixed since Jan 2015.

            Unassigned Unassigned
            sobczyk Szymon S
            Votes:
            5 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: