提交 9e5817ad 编写于 作者: J Jesse Glick

[FIXED JENKINS-17401] Behave gracefully if the user tries to rename a job using the Apply button.

上级 9f23c0bd
......@@ -54,6 +54,7 @@ import hudson.util.DescribableList;
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 abstract class Job<JobT extends Job<JobT, RunT>, RunT extends Run<JobT, R
// 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}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册