Skip to content

Commit 939e672

Browse files
Arbuzovmymarche
authored andcommitted
Rename index.js adjunct to avoid view-name collision
The new external CSP-compliant script was named `index.js` and pulled in with `<st:adjunct includes="...RestListParameterDefinition.index"/>`. Stapler resolves that include against the same `RestListParameterDefinition` class and treats `.index` as a view, recursively rendering `index.jelly` with the Adjunct object as `it`. The build form ends up with two `<select name="value">` (the second one with an empty `id="-select"`), which the browser submits as two `value` fields and produces a 500 on the server. Renaming the file to `selectInit.js` and updating the adjunct include removes the collision with the existing view name; only one parameter widget is rendered and submit works again. Verified on jenkins.sandbox.asatnet.net: single dropdown with the empty "—" entry, empty value submits as an empty string, the build succeeds.
1 parent 9805447 commit 939e672

2 files changed

Lines changed: 1 addition & 1 deletion

File tree

src/main/resources/io/jenkins/plugins/restlistparam/RestListParameterDefinition/index.jelly

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<st:adjunct includes="io.jenkins.plugins.jquery3"/>
88
<st:adjunct includes="io.jenkins.plugins.select2"/>
9-
<st:adjunct includes="io.jenkins.plugins.restlistparam.RestListParameterDefinition.index"/>
9+
<st:adjunct includes="io.jenkins.plugins.restlistparam.RestListParameterDefinition.selectInit"/>
1010
<j:set var="id" value="${h.generateId()}"/>
1111

1212
<link rel="stylesheet" type="text/css" href="${resURL}/plugin/rest-list-parameter/css/select2-bootstrap4.min.css"/>

src/main/resources/io/jenkins/plugins/restlistparam/RestListParameterDefinition/index.js renamed to src/main/resources/io/jenkins/plugins/restlistparam/RestListParameterDefinition/selectInit.js

File renamed without changes.

0 commit comments

Comments
 (0)