From 3580a754cfe2ab71fea34b46a67972601720f31a Mon Sep 17 00:00:00 2001 From: Zbynek Konecny Date: Sun, 29 Oct 2023 00:12:35 +0200 Subject: [PATCH] Replace deprecated functions with standard JS (#194) --- .../checkPasswordRequested.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/resources/org/jenkinsci/plugins/authorizeproject/strategy/SpecificUsersAuthorizationStrategy/checkPasswordRequested.js b/src/main/resources/org/jenkinsci/plugins/authorizeproject/strategy/SpecificUsersAuthorizationStrategy/checkPasswordRequested.js index 64a8b78..48240a8 100644 --- a/src/main/resources/org/jenkinsci/plugins/authorizeproject/strategy/SpecificUsersAuthorizationStrategy/checkPasswordRequested.js +++ b/src/main/resources/org/jenkinsci/plugins/authorizeproject/strategy/SpecificUsersAuthorizationStrategy/checkPasswordRequested.js @@ -45,16 +45,16 @@ Behaviour.specify(".specific-user-authorization", "checkPasswordRequired", 0, fu var useridField = findFormItem(e, "userid", findChild(e)); var passwordField = findFormItem(e, "password", findChild(e)); - var passwordFieldBlock = findAncestor(passwordField, "TR"); + var passwordFieldBlock = passwordField.closest("TR"); /* [JENKINS-64341] - In Jenkins version greater than 2.263.4 the table tags for fields (in forms) were replaced by div tags. - Since the changes were applied the 'findAncestor(passwordField, "TR")' + Since the changes were applied the 'passwordField.closest("TR")' method returns null. It is necessary to use the method - 'findAncestorClass(passwordField, "tr")' instead of. + 'passwordField.closest(".tr")' instead. */ if (passwordFieldBlock == null) { - passwordFieldBlock = findAncestorClass(passwordField, "tr"); + passwordFieldBlock = passwordField.closest(".tr"); } var passwordCheckBlock = findFollowingTR(passwordField, "validation-error-area");