Skip to content

Commit e99d844

Browse files
committed
Update ActiveCampaignContactsWorkflow.cs
- Update ValidateSettings() logic, which resolve the issue 46501.
1 parent 2d847a8 commit e99d844

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

src/Umbraco.Forms.Integrations.Crm.ActiveCampaign/ActiveCampaignContactsWorkflow.cs

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
using Microsoft.Extensions.Logging;
1+
using Lucene.Net.Index;
2+
using Microsoft.Extensions.Logging;
23
using Microsoft.Extensions.Options;
4+
using System;
35
using System.Text.Json;
46
using Umbraco.Forms.Core;
57
using 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

0 commit comments

Comments
 (0)