-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Segment membership as a new filter for dynamic web content #13526
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
MAUT 3809 - Use segment membership as a filter for dynamic content for web
MAUT-5498 EAB - Segment Membership Filter in Dynamic Content Breaks Landing Pages
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 5.x #13526 +/- ##
============================================
+ Coverage 61.39% 61.42% +0.03%
- Complexity 34035 34050 +15
============================================
Files 2240 2240
Lines 101719 101773 +54
============================================
+ Hits 62450 62518 +68
+ Misses 39269 39255 -14
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. It works well for existing DWC but when creating one from scratch I also see this issue. |
Wow, this was quite a long trip to fix it all. The select type fields were broken and not only in 1 place but 3. Each different type of select field on a different place. It originates from Mautic 3 refactoring where we had to swap all select keys with labels and this was broken ever since. It suggests something about the usage of these fields in DWC as no one noticed for years? Some field choices are generated via jS. so I fixed it there. Others are generated via HTML templates so I fixed it there. A special case is for States which use index instead of the normal key. The rest of the template fields are using keys. And then there are custom field selects, multiselects and booleans. Those were swapped twice on one place so I removed the additional swap. It seems that the code is used only for DWC, not for segments anymore so it shouldn't break anything else. Field types to test:
|
b7fbc0f
to
514b0ef
Compare
514b0ef
to
8686a76
Compare
I reported the locale bug when it happened as we have had this issue since then in our download form on mautic.org/download. See #12851 :) Hurrah for fixing it finally! |
@RCheesley I'm not sure it will fix #12851 but it would be a nice side effect. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks @escopecz
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description:
Add ability to use segment filters in dynamic content.
Steps to test this PR:
dcp bin/console mautic:assets:generate
if you don't want to use dev local env.Is campaign based?
= NOSegment membership
Components > Landing pages
Builder
Dynamic content
into page contenttest
as requested slot namehttps://yourmautic.coml/test
check landing pageComponents > Forms
https://mautic-cloud.local/form/[ID]
to add contact with criteria matching created segment in step 1Other areas of Mautic that may be affected by the change:
CustomObjectsBundle\EventListener\DynamicContentSubscriber::evaluateFilters()
is usingstopPropagation
method. This could eliminate further listeners from running if incorrect priority is set- https://github.com/mautic-inc/plugin-custom-objects/blob/b2ed6c064e3e256f2640fdb456bbf2cfb879300b/EventListener/DynamicContentSubscriber.php#L117TODO
PHP Notice - Array to string conversion``$choice
contains [] inWhen saving form kwith operator
empty
/not empty
. Selected value before is saved in the same way as in lead_list tableFunctional test for landing pageremoved here https://github.com/mautic-inc/mautic-cloud/pull/1037/commits/86ac47c73891ee6561caccf4589949920b4e514a. HTTP requests from local are blocked in staging.