Skip to content

Commit

Permalink
Merge branch 'MAUT-11460' into beta
Browse files Browse the repository at this point in the history
  • Loading branch information
Avikarsha Saha committed Jul 12, 2024
2 parents c499f38 + b4acce4 commit 2e098fd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
10 changes: 7 additions & 3 deletions EventListener/TokenSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -429,8 +429,11 @@ private function getCustomFieldDataForLead(array $filters, string $leadId): arra
*
* @return array<mixed>
*/
private function getCustomFieldValue(CustomObject $customObject, string $customFieldAlias, array $customItems): array
{
private function getCustomFieldValue(
CustomObject $customObject,
string $customFieldAlias,
array $customItems
): array {
$fieldValues = [];

foreach ($customItems as $customItemData) {
Expand Down Expand Up @@ -482,7 +485,8 @@ private function getCustomItems(CustomObject $customObject, string $leadId): arr
return $this->customItemModel->getArrayTableData($tableConfig);
}

// We have a similar function in MatchFilterForLeadTrait since we are unable to alter anything in Mautic 4.4, hence there is some duplication of code.
// We have a similar function in MatchFilterForLeadTrait since we are unable to alter anything in Mautic 4.4,
// hence there is some duplication of code.

/**
* @param array<mixed> $filter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ protected function setUp(): void
$this->customFieldValues['nexon-multiselect'] = $this->customItems['nexon']->findCustomFieldValueForFieldAlias('multiselect-test-field');
$this->customFieldValues['nexon-multiselect']->setValue('option_a');

$this->customFieldValues['nexon-number'] = $this->customItems['nexon']->findCustomFieldValueForFieldAlias('number-test-field');
$this->customFieldValues['nexon-number']->setValue(10);

$this->customItems['nexon'] = $this->customItemModel->save($this->customItems['nexon']);

$this->customItems['fortuner'] = new CustomItem($this->customObject);
Expand Down Expand Up @@ -102,14 +105,15 @@ public function testDynamicContentEmail(): void
'[email protected]',
$this->buildDynamicContentArray([
['nexon-datetime', null, '!empty', 'datetime'],
['nexon-number', 12, 'lt', 'number'],
]),
'Custom Object Dynamic Content',
], [
'[email protected]',
$this->buildDynamicContentArray([
['nexon-text', 'Tata', '='],
['nexon-datetime', '2024-07-01', 'gte'],
['nexon-multiselect', 'option_a', 'in'],
['nexon-datetime', '2024-07-01 00:00', 'gte', 'datetime'],
['nexon-multiselect', 'option_a', 'in', 'multiselect'],
]),
'Custom Object Dynamic Content',
], [
Expand Down

0 comments on commit 2e098fd

Please sign in to comment.