Closed
Description
When using a UI Component based form and adding a custom regular expression pattern validation to an input field, the supplied pattern is not properly converted from a string to a javascript RegEx object.
Preconditions
- Magento EE 2.1.7, Magento CE 2.1.7
- PHP 7.0.17
- MySQL 5.7.18
Steps to reproduce
-
Create a custom UI Component form
-
Add a
validation
item to an input field -
Specify a
pattern
validation rule with a custom regular expression pattern. E.g.<item name="validation" xsi:type="array"> <item name="required-entry" xsi:type="boolean">true</item> <item name="no-whitespace" xsi:type="boolean">true</item> <item name="pattern" xsi:type="string">^[a-zA-Z][a-zA-Z0-9_.-]{3,}$</item> </item>
Expected result
- The
pattern
value should be interpreted as a RegEx object OR sent throughnew RegEx
within the javascript.
Actual result
Metadata
Metadata
Assignees
Labels
The issue has been fixed in 2.1 release lineThe issue has been fixed in 2.3 release lineGate 2 Passed. Manual verification of the issue description passedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 1 Passed. Automatic verification of issue format passedGate 4. Acknowledged. Issue is added to backlog and ready for developmentThe issue has been reproduced on latest 2.1 releaseThe issue has been reproduced on latest 2.2 releaseThe issue has been reproduced on latest 2.3 release