-
-
Notifications
You must be signed in to change notification settings - Fork 9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[JENKINS-70662] Disable browser form validation from submit button #7668
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not manually tested but that was the expected outcome of our discussion 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for investigating, and preparing a fix!
/label ready-for-merge This PR is now ready for merge. We will merge it after ~24 hours if there is no negative feedback. |
Co-authored-by: Daniel Beck <1831569+daniel-beck@users.noreply.github.com>
I updated the proposed changelog entry to remove the content that will be automatically inserted by the changelog generator (PR number, issue number, regression fix) and to simplify the phrasing. |
This PR is now ready for merge. We will merge it after approximately 24 hours if there is no negative feedback. /label ready-for-merge |
Were you able to figure out how to assert the bug case from #7666 using HtmlUnit? |
I didn't even try TBH, I just relied on some manual testing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Manually verified against #7666
…enkinsci#7668) * [JENKINS-70662] Disable browser form validation from submit button * Update core/src/main/resources/lib/form/submit.jelly Co-authored-by: Daniel Beck <1831569+daniel-beck@users.noreply.github.com> --------- Co-authored-by: Daniel Beck <1831569+daniel-beck@users.noreply.github.com> (cherry picked from commit 93c8e76)
See JENKINS-70662.
Hello 👋
As described in JENKINS-70662, and shared in the Jenkins 2.387.1 RC testing thread, a regression was introduced in Jenkins
2.376
: Built-in validations are broken when inside anoptionalBlock
.Prior to that version, validations were simply ignored when clicking on the
submit
button. The change introduced in #7203 though, transforminginput type="button"
in abutton
changed that behavior and led to that regression. The actual bug can be reproduced from #7666, leading to an error in the Javascript console when clicking thesave
button from the configuration:An invalid form control with name='_.someValue' is not focusable
.While there could be other solutions for this problem, the one proposed in that PR should be simple enough to cover most
cases. It seems that a similar approach was used in other places as well.
This PR should ideally be part of the
2.387
LTS, in order to avoid introducing a regression from the previous LTS.Please let me know if anything is missing from this PR or if I could help in some other way 😄
Testing done
I did some manual testing for this PR, following the approach described in #7666.
I also tested it on some of our internal plugins facing the issue to confirm it was working fine.
Proposed changelog entries
Proposed upgrade guidelines
N/A
Submitter checklist
@Restricted
or have@since TODO
Javadocs, as appropriate.@Deprecated(since = "TODO")
or@Deprecated(forRemoval = true, since = "TODO")
, if applicable.eval
to ease future introduction of Content Security Policy (CSP) directives (see documentation).Desired reviewers
@daniel-beck @jtnord @basil @jglick @Vlatombe
Maintainer checklist
Before the changes are marked as
ready-for-merge
:upgrade-guide-needed
label is set and there is a Proposed upgrade guidelines section in the pull request title (see example).lts-candidate
to be considered (see query).