diff --git a/backend/core/src/main/java/org/opencdmp/model/persist/planblueprintdefinition/SectionPersist.java b/backend/core/src/main/java/org/opencdmp/model/persist/planblueprintdefinition/SectionPersist.java index 950713343..b8ecb89d9 100644 --- a/backend/core/src/main/java/org/opencdmp/model/persist/planblueprintdefinition/SectionPersist.java +++ b/backend/core/src/main/java/org/opencdmp/model/persist/planblueprintdefinition/SectionPersist.java @@ -180,6 +180,7 @@ public class SectionPersist { .must(() -> item.getDescriptionTemplates().stream().map(DescriptionTemplatePersist::getDescriptionTemplateGroupId).distinct().collect(Collectors.toList()).size() == item.getDescriptionTemplates().size()) .failOn(SectionPersist._descriptionTemplates).failWith(this.messageSource.getMessage("Validation_Unique", new Object[]{SectionPersist._descriptionTemplates}, LocaleContextHolder.getLocale())), this.spec() + .iff(() -> !this.isListNullOrEmpty(item.getDescriptionTemplates())) .must(() -> !this.isNull(item.getPrefillingSourcesEnabled())) .failOn(SectionPersist._prefillingSourcesEnabled).failWith(this.messageSource.getMessage("Validation_Required", new Object[]{SectionPersist._prefillingSourcesEnabled}, LocaleContextHolder.getLocale())) diff --git a/frontend/src/app/ui/admin/plan-blueprint/editor/plan-blueprint-editor.model.ts b/frontend/src/app/ui/admin/plan-blueprint/editor/plan-blueprint-editor.model.ts index e109ddbd6..73059b3f3 100644 --- a/frontend/src/app/ui/admin/plan-blueprint/editor/plan-blueprint-editor.model.ts +++ b/frontend/src/app/ui/admin/plan-blueprint/editor/plan-blueprint-editor.model.ts @@ -183,9 +183,9 @@ export class PlanBlueprintDefinitionSectionEditorModel implements PlanBlueprintD description: string; ordinal: number; fields: FieldInSectionEditorModel[] = []; - hasTemplates: boolean; + hasTemplates: boolean = false; descriptionTemplates?: DescriptionTemplatesInSectionEditorModel[] = []; - prefillingSourcesEnabled: boolean; + prefillingSourcesEnabled: boolean = false; prefillingSourcesIds: Guid[]= []; protected formBuilder: UntypedFormBuilder = new UntypedFormBuilder();