Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[FIXED JENKINS-27233] Fixed exception in parameter pages or rebuild p…
…ages for non multi-configuration builds triggered with combinations parameters (in the case triggered with parameterized-trigger-plugin).
  • Loading branch information
ikedam committed Jul 11, 2015
1 parent 6dcc532 commit 5f1e026
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 9 deletions.
Expand Up @@ -13,13 +13,21 @@ f = namespace("lib/form")
nsProject = namespace("/hudson/plugins/matrix_configuration_parameter/taglib")


def paramDef = it;
String nameIt = it.getName();
MatrixProject project = request.findAncestorObject(MatrixProject.class);
if (project == null) //in case project is not a Matrix Project
if (project == null) {
//in case project is not a Matrix Project
f.entry(title: nameIt, description: it.getDescription()) {
div(name: "parameter") {
input(type: "hidden", name: "name", value: nameIt)
text(_("Not applicable. Applicable only to multi-configuration projects."))
}//div
}
return;
}

AxisList axes = project.getAxes();
def paramDef = it;
String nameIt = it.getName();
Layouter layouter = new Layouter<Combination>(axes) {
protected Combination getT(Combination c) {
return c;
Expand Down
Expand Up @@ -16,12 +16,21 @@ f = namespace("lib/form")
nsProject = namespace("/hudson/plugins/matrix_configuration_parameter/taglib")


def valueIt = it;

MatrixProject project = request.findAncestorObject(MatrixProject.class);
AxisList axes = project.getAxes();
MatrixBuild build = request.findAncestorObject(MatrixBuild.class);
if (build == null) //in case you are looking at a specific run, MatrixRun Ancestor will replace the MatrixBuild
if (project == null || build == null) {
//in case you are looking at a specific run, MatrixRun Ancestor will replace the MatrixBuild
f.entry(title: valueIt.getName(), description: it.getDescription()) {
// In the case the parameter is not defined in this project,
// sending parameters cause rebuild-plugin throws exception.
// Acts as if I'm not here.
text(_("Not applicable. Applicable only to multi-configuration projects."))
}
return;
def valueIt = it;
}
AxisList axes = project.getAxes();
Layouter layouter = new Layouter<Combination>(axes) {
protected Combination getT(Combination c) {
return c;
Expand Down
Expand Up @@ -15,12 +15,20 @@ st = namespace("jelly:stapler")
f = namespace("lib/form")
nsProject = namespace("/hudson/plugins/matrix_configuration_parameter/taglib")

MatrixCombinationsParameterValue valueIt = it;
MatrixProject project = request.findAncestorObject(MatrixProject.class);
AxisList axes = project.getAxes();
MatrixBuild build = request.findAncestorObject(MatrixBuild.class);
if (build == null) //in case you are looking at a specific run, MatrixRun Ancestor will replace the MatrixBuild
if (project == null || build == null) {
//in case you are looking at a specific run, MatrixRun Ancestor will replace the MatrixBuild
f.entry(title: valueIt.getName(), description: it.getDescription()) {
div(name: "parameter") {
input(type: "hidden", name: "name", value: valueIt.getName())
text(_("Not applicable. Applicable only to multi-configuration projects."))
}//div
}
return;
MatrixCombinationsParameterValue valueIt = it;
}
AxisList axes = project.getAxes();
Layouter layouter = new Layouter<Combination>(axes) {
protected Combination getT(Combination c) {
return c;
Expand Down

0 comments on commit 5f1e026

Please sign in to comment.