Skip to content
Permalink
Browse files

[FIXED JENKINS-17401] Behave gracefully if the user tries to rename a…

… job using the Apply button.
  • Loading branch information
jglick committed Dec 23, 2013
1 parent 9f23c0b commit 9e5817adbbf1b8c258c24281d0f61b40b7507cb3
@@ -54,6 +54,7 @@
import hudson.util.FormApply;
import hudson.util.Graph;
import hudson.util.ProcessTree;
import hudson.util.QuotedStringTokenizer;
import hudson.util.RunList;
import hudson.util.ShiftedCategoryAxis;
import hudson.util.StackedAreaRenderer2;
@@ -1144,7 +1145,11 @@ public synchronized void doConfigSubmit(StaplerRequest req,
// check this error early to avoid HTTP response splitting.
Jenkins.checkGoodName(newName);
namingStrategy.checkName(newName);
rsp.sendRedirect("rename?newName=" + URLEncoder.encode(newName, "UTF-8"));
if (FormApply.isApply(req)) {
FormApply.applyResponse("notificationBar.show(" + QuotedStringTokenizer.quote(Messages.Job_you_must_use_the_save_button_if_you_wish()) + ",notificationBar.WARNING)").generateResponse(req, rsp, null);
} else {
rsp.sendRedirect("rename?newName=" + URLEncoder.encode(newName, "UTF-8"));
}
} else {
if(namingStrategy.isForceExistingJobs()){
namingStrategy.checkName(name);
@@ -182,6 +182,7 @@ Job.NoRecentBuildFailed=No recent builds failed.
Job.Pronoun=Project
Job.minutes=mins

Job.you_must_use_the_save_button_if_you_wish=You must use the Save button if you wish to rename a job.
Label.GroupOf=group of {0}
Label.InvalidLabel=invalid label
Label.ProvisionedFrom=Provisioned from {0}

0 comments on commit 9e5817a

Please sign in to comment.
You can’t perform that action at this time.