From d1e9be46ddae9f4fa069a78699b4258268324b8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Auswo=CC=88ger?= Date: Sun, 25 Jun 2023 20:56:48 +0200 Subject: [PATCH] Fix bug with renamed depending fields --- src/Resources/public/js/be_main.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Resources/public/js/be_main.js b/src/Resources/public/js/be_main.js index f4c7373..4a7e6b3 100644 --- a/src/Resources/public/js/be_main.js +++ b/src/Resources/public/js/be_main.js @@ -809,6 +809,9 @@ var updateDependingFields = function(formElement) { // Handle widgets replaced via AJAX (e.g. fileTree) if (inputs[0].form) { inputs[0].form.addEvent('change', function (event) { + if (inputs[0] && inputs[0].name !== dependsOnData.field) { + dependsOnData.field = inputs[0].name.replace(/\[]$/, ''); + } if ((event.target.name || '').substr(0, dependsOnData.field.length) === dependsOnData.field) { inputs = document.body.getElements('[name="'+dependsOnData.field+'"][type!=hidden],[name^="'+dependsOnData.field+'["][type!=hidden]'); if (!inputs.length) {