From 388624a9dd68ab9838c97a0887ed0575ad8fdd92 Mon Sep 17 00:00:00 2001 From: Sebastian Blank Date: Sun, 30 Jan 2022 11:43:02 +0100 Subject: [PATCH] Fix: "Predefined Document Type"-Select not working --- .../public/js/pimcore/document/settings_abstract.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bundles/AdminBundle/Resources/public/js/pimcore/document/settings_abstract.js b/bundles/AdminBundle/Resources/public/js/pimcore/document/settings_abstract.js index aadb8840817..71270ef934c 100644 --- a/bundles/AdminBundle/Resources/public/js/pimcore/document/settings_abstract.js +++ b/bundles/AdminBundle/Resources/public/js/pimcore/document/settings_abstract.js @@ -19,6 +19,9 @@ pimcore.document.settings_abstract = Class.create({ }, setDocumentType: function (field, newValue, oldValue) { + if (!newValue.data.id) { + return; + } var allowedFields = ["controller", "template"]; var form = this.getLayout().getForm(); var element = null; @@ -26,9 +29,7 @@ pimcore.document.settings_abstract = Class.create({ for (var i = 0; i < allowedFields.length; i++) { element = form.findField(allowedFields[i]); if (element) { - if (newValue.data.id > 0) { - element.setValue(newValue.data[allowedFields[i]]); - } + element.setValue(newValue.data[allowedFields[i]]); } } },