File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed
src/Umbraco.Forms.Integrations.Crm.ActiveCampaign Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change 1- using Microsoft . Extensions . Logging ;
1+ using Lucene . Net . Index ;
2+ using Microsoft . Extensions . Logging ;
23using Microsoft . Extensions . Options ;
4+ using System ;
35using System . Text . Json ;
46using Umbraco . Forms . Core ;
57using Umbraco . Forms . Core . Enums ;
@@ -124,15 +126,19 @@ public override List<Exception> ValidateSettings()
124126 var list = new List < Exception > ( ) ;
125127
126128 if ( string . IsNullOrEmpty ( ContactMappings ) )
129+ {
127130 list . Add ( new Exception ( "Contact mappings are required." ) ) ;
128-
129- var mappings = JsonSerializer . Deserialize < List < ContactMappingDto > > ( ContactMappings ) ;
130- foreach ( var contactField in _settings . ContactFields . Where ( p => p . Required ) )
131+ }
132+ else
131133 {
132- if ( ! mappings . Any ( p => p . ContactField == contactField . Name ) )
134+ var mappings = JsonSerializer . Deserialize < List < ContactMappingDto > > ( ContactMappings ) ;
135+ foreach ( var contactField in _settings . ContactFields . Where ( p => p . Required ) )
133136 {
134- list . Add ( new Exception ( "Invalid contact mappings. Please make sure the mandatory fields are mapped." ) ) ;
135- break ;
137+ if ( ! mappings . Any ( p => p . ContactField == contactField . Name ) )
138+ {
139+ list . Add ( new Exception ( "Invalid contact mappings. Please make sure the mandatory fields are mapped." ) ) ;
140+ break ;
141+ }
136142 }
137143 }
138144
You can’t perform that action at this time.
0 commit comments