-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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-71200] Fix elements property overload in ListView #7942
Conversation
First commit is a test that reproduces the problem and show the failure. |
@NotMyFault / @Dohbedoh was this introduced in 2.403? |
@timja I don't think so. I find this out on an instance running 2.361.3. And I could reproduce this although in the latest weekly 2.403. This has probably been around for a while. |
Unlikely, I just labeled it as regression because I recall it working at some point. |
I doubt this ever worked |
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.
/label ready-for-merge
This PR is now ready for merge, after ~24 hours, we will merge it if there's no negative feedback.
Thanks!
FTR this hasn't worked in many years, if ever (at least for some attribute names), see #6959 / JENKINS-10693. |
@@ -452,7 +452,7 @@ protected void submit(StaplerRequest req) throws ServletException, FormException | |||
} | |||
for (TopLevelItem item : items) { | |||
String relativeNameFrom = item.getRelativeNameFrom(getOwner().getItemGroup()); | |||
if (req.getParameter(relativeNameFrom) != null) { | |||
if (req.getParameter("item_" + relativeNameFrom) != null) { |
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.
Caused JENKINS-71403. |
Filed JENKINS-71663 to track this regression. |
Added
https://plugins.jenkins.io/radiatorviewplugin/ is also impacted, but likely too old to be relevant. Should likely be deprecated. |
See JENKINS-71200.
ListView
produces<input ..>
elements for each items within the ItemGroup that are named directly after the item name itself. If an item name iselements
, this kind of overloads theform.elements
attribute which causes a bad form submission.The propose fix is to prefix the input names with
item_
to avoid the overload.Testing done
elements
Proposed changelog entries
elements
.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
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).