[JENKINS-64429] Fix registerValidator breaking error messages (#5195)

This commit is contained in:
Félix Queiruga authored and GitHub committed 2021-01-24 09:06:22 +00:00
1 parent da3433b5dc
commit d40e470dcc
1 file changed
+6 -3
@@ -500,13 +500,16 @@ var tooltip;
//========================================================
// using tag names in CSS selector makes the processing faster
function registerValidator(e) {
var settingMain = e.closest('.setting-main')
if (!settingMain) {
// Retrieve the validation error area
var tr = findFollowingTR(e, "validation-error-area");
if (!tr) {
console.warn("Couldn't find the expected parent element (.setting-main) for element", e)
return;
}
// find the validation-error-area
e.targetElement = settingMain.nextElementSibling;
e.targetElement = tr.firstChild.nextSibling;
e.targetUrl = function() {
var url = this.getAttribute("checkUrl");
var depends = this.getAttribute("checkDependsOn");