Skip to content

Conversation

@dhirendramishra10
Copy link

@dhirendramishra10 dhirendramishra10 commented Nov 18, 2025

Assuming that:

a = current major release
b = current minor release
c = future major release

  • a.x for any features and enhancements (e.g. 4.x)
  • a.b for any bug fixes (e.g. 4.0, 4.1, 4.2)
  • c.x for any features, enhancements or bug fixes with backward compatibility breaking changes (e.g. 5.x) -->
Q A
Bug fix? (use the a.b branch) [ YES]
New feature/enhancement? (use the a.x branch) [ ]
Deprecations? [ ]
BC breaks? (use the c.x branch) [ ]
Automated tests included? [ ]
Related user documentation PR URL mautic/mautic-documentation#...
Related developer documentation PR URL mautic/developer-documentation#...
Issue(s) addressed Fixes https://acquia.atlassian.net/browse/MAUT-12891

Description:

  • Custom Object Country list filter is not working for Dynamic Web Content

Steps to Reproduce:

  • Create a custom object with country list field
  • Create custom items with different countries and link it with contacts
  • Create DWC with custom object country list filter
  • Use the DWC in email/landing page
  • Verify DWC shows default content for all values irrespective of filter, which is a issue

Steps to test this PR:

  • Create a custom object with country list field
  • Create custom items with different countries and link it with contacts
  • Create DWC with custom object country list filter lets say equal to "Albania" and add some Slot
  • Use the DWC in email/landing page and Under builder select DWC and add some default messages for Same Slot selected in DWC above.
  • Use landing page preview page and input username and see for users having attached city Equal to 'Albania' are show with DWC message content and not Default content
  • Users with Not attached to items having 'Albania' should show Default content message.

Uploading Screenshot 2025-11-18 at 7.14.18 PM.png…

@dhirendramishra10 dhirendramishra10 marked this pull request as draft November 18, 2025 13:44
@dhirendramishra10 dhirendramishra10 marked this pull request as ready for review November 19, 2025 05:52
@dhirendramishra10 dhirendramishra10 requested review from a team, aarohiprasad and avikarshasaha and removed request for a team November 19, 2025 07:13

public function evaluateFilters(ContactFiltersEvaluateEvent $event): void
{
// 2. Normalize only Custom Object filters
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this comment

}

// Case B: Reverse format (value => label)
$reversed = array_flip($options);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$value = array_search($label, $options, true);
if ($value !== false) {
$filter['filter_value'] = $value;
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

array_flip is expensive operation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants