-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Fix issue #14457: Contact names with ampersands not showing in search #14818
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
Fix issue #14457: Contact names with ampersands not showing in search #14818
Conversation
fixes searches for fields with characters otherwise encoded like ampersand adds test to check ampersand shows in search, on created contact
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.
Copilot wasn't able to review any files in this pull request.
Files not reviewed (20)
- app/bundles/ApiBundle/EventListener/SearchSubscriber.php: Language not supported
- app/bundles/AssetBundle/EventListener/SearchSubscriber.php: Language not supported
- app/bundles/CampaignBundle/EventListener/SearchSubscriber.php: Language not supported
- app/bundles/ChannelBundle/EventListener/SearchSubscriber.php: Language not supported
- app/bundles/DynamicContentBundle/EventListener/SearchSubscriber.php: Language not supported
- app/bundles/EmailBundle/EventListener/SearchSubscriber.php: Language not supported
- app/bundles/FormBundle/EventListener/SearchSubscriber.php: Language not supported
- app/bundles/LeadBundle/EventListener/SearchSubscriber.php: Language not supported
- app/bundles/LeadBundle/Tests/Functional/SearchTestHelper.php: Language not supported
- app/bundles/LeadBundle/Tests/Functional/SearchWithCustomFieldDataFunctionalTest.php: Language not supported
- app/bundles/LeadBundle/Tests/Functional/SearchWithSpecialCharactersInFieldTest.php: Language not supported
- app/bundles/NotificationBundle/EventListener/SearchSubscriber.php: Language not supported
- app/bundles/PageBundle/EventListener/SearchSubscriber.php: Language not supported
- app/bundles/PointBundle/EventListener/SearchSubscriber.php: Language not supported
- app/bundles/ReportBundle/EventListener/SearchSubscriber.php: Language not supported
- app/bundles/SmsBundle/EventListener/SearchSubscriber.php: Language not supported
- app/bundles/StageBundle/EventListener/SearchSubscriber.php: Language not supported
- app/bundles/UserBundle/EventListener/SearchSubscriber.php: Language not supported
- plugins/MauticFocusBundle/EventListener/SearchSubscriber.php: Language not supported
- plugins/MauticTagManagerBundle/EventListener/SearchSubscriber.php: Language not supported
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.
I suggest removing the InputHelper::clean
in the controller instead of decoding the query in every subscriber.
reverts previous individual search subscriber modification, removes clean method from global search action in ajax controller
@patrykgruszka Indeed much more sensical, my bad. Please tell me if it needs anything else, or if you'd like me to squash or something. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## 6.0 #14818 +/- ##
=========================================
Coverage 64.75% 64.75%
Complexity 34728 34728
=========================================
Files 2275 2275
Lines 103739 103739
=========================================
+ Hits 67171 67172 +1
+ Misses 36568 36567 -1
🚀 New features to boost your workflow:
|
renames SearchTestHelper and moves auxiliary functions from the subclass to the parent
9bb65e4
to
bae0473
Compare
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.
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.
I also believe that removing InputHelper::clean
in this case is the right way to solve this 👍
@all-contributors please add @goma101 for code test |
I've put up a pull request to add @goma101! 🎉 |
Description
This PR fixes an issue where a global search would not return contacts (or other entities) with ampersands in one of their fields such as their names, if searched with the ampersand. This bug occurred because the
InputHelper::clean
method encodes characters such as ampersand into html encoding, thus causing a mismatch when executing a global search.This fix decodes search strings before global search execution, thereby eliminating this mismatch and yielding correct results. The PR also includes a phpunit test, for the search example provided in the issue (Global search for Contact with name "R&D"), asserting the search is successful.
📋 Steps to test this PR: