-
Bug
-
Resolution: Not A Defect
-
Minor
-
None
-
* core version 2.481 (latest weekly)
* jquery3-api 3.7.1-2 (latest)
* chrome 130.0.6723.59 (also visible on firefox)
- clone https://github.com/PierreBtz/form-jquery-reproducer
- start the application: `mvn hpi:run`
- click on the reproducer root action (link `/reproducer`)
- click on Trigger me
- Observe the dialog doesn't open, observe the error in the console:
Uncaught TypeError: Cannot read properties of undefined (reading 'submit') at Object.form (index.js:256:44) at showForm (dialog.js:6:12) at HTMLButtonElement.onclick (reproducer/:12:90)
- Verify the code works without the jquery3 adjunct by commenting
<st:adjunct includes="io.jenkins.plugins.jquery3"/>
in `src/main/resources/io/jenkins/plugins/ReproducingAction/index.jelly` and reloading the page.
I think the problem is the location where the jquery adjunct is loaded. In your sample you put it before the "<l:layout". If you put it inside of it then everything works fine.
When you put the jquery before the l:layout then the "<head>" element has no attributes. Those attributes are required for the dialogs and probably also other functionality needs to make use of it
So probably not really a bug but improper placing of adjuncts