Skip to content

Commit 32c7621

Browse files
MC-17947: Search by email is working incorrect in Sales > Orders grid
1 parent adc8e0f commit 32c7621

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

app/code/Magento/Customer/Test/Mftf/Test/SearchByEmailInCustomerGridTest.xml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<test name="SearchByEmailInCustomerGridTest">
1111
<annotations>
1212
<features value="Customer"/>
13-
<stories value="Customer Search email searching"/>
13+
<stories value="Customer grid search"/>
1414
<title value="Admin customer grid email searching"/>
1515
<description value="Admin customer grid searching by email in keyword"/>
1616
<severity value="MAJOR"/>
@@ -19,12 +19,8 @@
1919
<group value="customer"/>
2020
</annotations>
2121
<before>
22-
<createData entity="Simple_US_Customer" stepKey="createFirstCustomer">
23-
<field key="email">[email protected]</field>
24-
</createData>
25-
<createData entity="Simple_US_Customer" stepKey="createSecondCustomer">
26-
<field key="email">[email protected]</field>
27-
</createData>
22+
<createData entity="Simple_US_Customer" stepKey="createFirstCustomer"/>
23+
<createData entity="Simple_US_Customer" stepKey="createSecondCustomer"/>
2824
<actionGroup ref="LoginAsAdmin" stepKey="login"/>
2925
</before>
3026
<after>

lib/internal/Magento/Framework/View/Element/UiComponent/DataProvider/FulltextFilter.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
*/
1616
class FulltextFilter implements FilterApplierInterface
1717
{
18+
/**
19+
* Patterns using in preg_replace for emails
20+
*/
21+
private const EMAIL_REPLACE_PATTERNS = ['/@/', '/\./'];
22+
1823
/**
1924
* Returns list of columns from fulltext index (doesn't support more then one FTI per table)
2025
*
@@ -71,7 +76,7 @@ function ($column) use ($alias) {
7176
private function escapeAgainstValue(string $value): string
7277
{
7378
$value = preg_replace('/([+\-><\(\)~*]+)/', ' ', $value);
74-
return preg_replace('/(@)/', '\_', $value);
79+
return preg_replace(self::EMAIL_REPLACE_PATTERNS, '\_', $value);
7580
}
7681

7782
/**

0 commit comments

Comments
 (0)