mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-11 19:16:42 +00:00
Fix bug in TextparameterDefinition (#5704)
TextParameterDefinition did not override getDefaultParameterValue() method and instead relied on the implementation in StringParameterDefinition. In most cases this wasn't a problem, but in some cases, for example when triggering build through buildWithParameters API without specifying the parameter, then the parameter object would be of the wrong type (StringParameterValue as opposed to TextParameterValue). This causes problems with visualization in parameters view as well as incorrect values when rebuild plugin is used. Change-Id: If4e11bdafcd94c9c83462983f384fa80ae2c4d9c
This commit is contained in:
1 file changed
+5
@@ -58,6 +58,11 @@ public class TextParameterDefinition extends StringParameterDefinition {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public StringParameterValue getDefaultParameterValue() {
|
||||
return new TextParameterValue(getName(), getDefaultValue(), getDescription());
|
||||
}
|
||||
|
||||
@Override
|
||||
public ParameterValue createValue(StaplerRequest req, JSONObject jo) {
|
||||
TextParameterValue value = req.bindJSON(TextParameterValue.class, jo);
|
||||
|
||||
Reference in new issue
Block a user