Skip to content
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-72759] fix handling of readonly for select without parent div #8984

Merged
merged 1 commit into from
Mar 1, 2024

Conversation

mawinter69
Copy link
Contributor

@mawinter69 mawinter69 commented Feb 23, 2024

when no parent div is present that has .jenkins-select we get a null element and the script runs into an error.
This affects all plugins that use <st:adjunct includes="lib.form.select.select"/> but do not have surrounded the select with <div class="jenkins-select">

See JENKINS-72759.

Testing done

interactive testing

Proposed changelog entries

  • Restore functionality of some dropdown list form fields outside configuration forms (regression in 2.446).

Proposed upgrade guidelines

N/A

Submitter checklist

Desired reviewers

@mention

Before the changes are marked as ready-for-merge:

Maintainer checklist

when no parent div is present that has .jenkins-select we get a null
element and the script runs into an error.
@NotMyFault NotMyFault added the regression-fix Pull request that fixes a regression in one of the previous Jenkins releases label Feb 27, 2024
Copy link
Member

@NotMyFault NotMyFault left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@NotMyFault NotMyFault requested a review from a team February 27, 2024 15:06
@@ -150,6 +150,7 @@ Behaviour.specify("SELECT.select", "select", 1000, function (e) {
// handle readonly mode, the actually selected option is only filled asynchronously so we have
// to wait until the data is filled by registering to the filled event.
if (
parentDiv != null &&
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason to not do this?

Suggested change
parentDiv != null &&
parentDiv !== null &&

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also it is technically not possible, if parentDiv would be undefined the !== would evaluate to true and the following access to dataset would fail

@NotMyFault NotMyFault requested a review from timja February 29, 2024 15:00
Copy link
Member

@timja timja left a 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!

@comment-ops-bot comment-ops-bot bot added the ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback label Feb 29, 2024
@NotMyFault NotMyFault merged commit a174f98 into jenkinsci:master Mar 1, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback regression-fix Pull request that fixes a regression in one of the previous Jenkins releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants