From 0da714e439c0f7cb95cd1d9ef07d18502e867f6a Mon Sep 17 00:00:00 2001 From: storbahn Date: Tue, 29 Nov 2022 16:54:46 +0100 Subject: [PATCH] [BUGFIX] Check of advancedManyToManyRelation and manyToManyRelation Upload Limit (validate maxItems) --- .../public/js/pimcore/object/tags/advancedManyToManyRelation.js | 2 +- .../public/js/pimcore/object/tags/manyToManyRelation.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bundles/AdminBundle/Resources/public/js/pimcore/object/tags/advancedManyToManyRelation.js b/bundles/AdminBundle/Resources/public/js/pimcore/object/tags/advancedManyToManyRelation.js index 85fbdf8e8ff..65680fab440 100644 --- a/bundles/AdminBundle/Resources/public/js/pimcore/object/tags/advancedManyToManyRelation.js +++ b/bundles/AdminBundle/Resources/public/js/pimcore/object/tags/advancedManyToManyRelation.js @@ -789,7 +789,7 @@ pimcore.object.tags.advancedManyToManyRelation = Class.create(pimcore.object.tag uploadDialog: function () { if (!this.fieldConfig.allowMultipleAssignments || (this.fieldConfig["maxItems"] && this.fieldConfig["maxItems"] >= 1)) { - if ((this.store.getData().getSource() || this.store.getData()).count() >= this.fieldConfig.maxItems) { + if (this.fieldConfig.maxItems && (this.store.getData().getSource() || this.store.getData()).count() >= this.fieldConfig.maxItems) { Ext.Msg.alert(t("error"), t("limit_reached")); return true; } diff --git a/bundles/AdminBundle/Resources/public/js/pimcore/object/tags/manyToManyRelation.js b/bundles/AdminBundle/Resources/public/js/pimcore/object/tags/manyToManyRelation.js index 161a7ca6218..4605bce981b 100644 --- a/bundles/AdminBundle/Resources/public/js/pimcore/object/tags/manyToManyRelation.js +++ b/bundles/AdminBundle/Resources/public/js/pimcore/object/tags/manyToManyRelation.js @@ -452,7 +452,7 @@ pimcore.object.tags.manyToManyRelation = Class.create(pimcore.object.tags.abstra uploadDialog: function () { if (!this.fieldConfig.allowMultipleAssignments || (this.fieldConfig["maxItems"] && this.fieldConfig["maxItems"] >= 1)) { - if ((this.store.getData().getSource() || this.store.getData()).count() >= this.fieldConfig.maxItems) { + if (this.fieldConfig.maxItems && (this.store.getData().getSource() || this.store.getData()).count() >= this.fieldConfig.maxItems) { Ext.Msg.alert(t("error"), t("limit_reached")); return true; }