From b730da3ab75d618a6c13568b6deb63408dc6a190 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 2 Oct 2022 13:53:45 +0200 Subject: [PATCH] Product-only: - bypassDuplicateI18nKey can be NULL when not set in JSF tag --- .../generic_product/FinancialsGenericProductValidator.java | 6 ++++++ .../FinancialsProductCategoryValidator.java | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/java/org/mxchange/jfinancials/validator/generic_product/FinancialsGenericProductValidator.java b/src/java/org/mxchange/jfinancials/validator/generic_product/FinancialsGenericProductValidator.java index 4a18fb55..4fa2ba38 100644 --- a/src/java/org/mxchange/jfinancials/validator/generic_product/FinancialsGenericProductValidator.java +++ b/src/java/org/mxchange/jfinancials/validator/generic_product/FinancialsGenericProductValidator.java @@ -82,6 +82,12 @@ public class FinancialsGenericProductValidator extends BaseStringValidator { PRODUCT_LIST_CONTROLLER = CDI.current().select(FinancialsProductListWebViewBean.class).get(); } + // Is bypassDuplicateI18nKey set? + if (null == this.bypassDuplicateI18nKey) { + // By default is not bypass + this.setBypassDuplicateI18nKey(Boolean.FALSE); + } + // Check, if the name has already been used if (!this.bypassDuplicateI18nKey && PRODUCT_LIST_CONTROLLER.isProductI18nKeyAdded((String) productI18nKey)) { // Create message diff --git a/src/java/org/mxchange/jfinancials/validator/product_category/FinancialsProductCategoryValidator.java b/src/java/org/mxchange/jfinancials/validator/product_category/FinancialsProductCategoryValidator.java index 307fbadb..0283c04c 100644 --- a/src/java/org/mxchange/jfinancials/validator/product_category/FinancialsProductCategoryValidator.java +++ b/src/java/org/mxchange/jfinancials/validator/product_category/FinancialsProductCategoryValidator.java @@ -82,6 +82,12 @@ public class FinancialsProductCategoryValidator extends BaseStringValidator { CATEGORY_LIST_CONTROLLER = CDI.current().select(FinancialsCategoryListWebViewBean.class).get(); } + // Is bypassDuplicateI18nKey set? + if (null == this.bypassDuplicateI18nKey) { + // By default is not bypass + this.setBypassDuplicateI18nKey(Boolean.FALSE); + } + // Check, if the name has already been used if (!this.bypassDuplicateI18nKey && CATEGORY_LIST_CONTROLLER.isCategoryI18nKeyAdded((String) categoryI18nKey)) { // Create message -- 2.39.5