[
https://issues.jenkins-ci.org/browse/JENKINS-13742?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=163531#comment-163531
]
Kohsuke Kawaguchi commented on JENKINS-13742:
---------------------------------------------
Thanks for doing the detective work and the patch, and my apologies for
introducing the problem in the first place.
See https://github.com/jenkinsci/jenkins/pull/487 for how we fixed this. More
specifically,
https://github.com/jenkinsci/jenkins/commit/99b11d0df29ba6428a64486a8335a8f55a2c3d27
contains the UI sample for how to use this.
In this case, parameters in CollabNetApp.fromStapler would each need
@RelativePath("connectionFactory")
> Field validation does not pass required query parameters when some fields are
> specified in a nested Describable
> ---------------------------------------------------------------------------------------------------------------
>
> Key: JENKINS-13742
> URL: https://issues.jenkins-ci.org/browse/JENKINS-13742
> Project: Jenkins
> Issue Type: Bug
> Components: collabnet, core, validating-string-parameter
> Affects Versions: current
> Environment: Problem is not environment dependent, but testing was on
> Ubuntu 10.04 using Firefox 11 as client.
> Reporter: John McNally
> Assignee: whsu
> Labels: jenkins
> Attachments: findNearBy.patch
>
>
> The collabnet plugin was updated/modernized a couple years ago to include
> code like the following:
> CNDocumentUploader.java DescriptorImpl
> {code:java}
> /**
> * Form validation for upload path.
> */
> public FormValidation doCheckUploadPath(CollabNetApp app, @QueryParameter
> String project, @QueryParameter String value)
> {code}
> CollabNetApp.java
> {code:java}
> public static CollabNetApp fromStapler(@QueryParameter boolean
> overrideAuth, @QueryParameter String url,
> @QueryParameter String username,
> @QueryParameter String password)
> {code}
> config.jelly
> {code:xml}
> <f:property field="connectionFactory" />
> ...
> <f:entry title="Upload Folder Path" field="uploadPath">
> <f:textbox />
> </f:entry>
> {code}
> ConnectionFactory has url, username, and password properties
> The generated field validation javascript then uses the 'nearBy' function
> when passing query parameters to the checkUploadPath backend in order to find
> values of url, username, and password. However uploadPath has a parent
> element with name 'publisher', while the direct parent of url, username, and
> password is a div has name 'connectionFactory'. 'publisher' is then a
> grandparent of url, username, and password and because of this, the needed
> query parameters are not included.
> One might argue that the collabnet plugin should avoid this design, since it
> does not work, but the changes came from Kohsuke, so attempting find a fix
> which preserves the current design.
> A patch to the findNearBy function in hudson-behavior.js is attached.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.jenkins-ci.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira