Open m2-assistant[bot] opened 4 months ago
Hi @engcom-November. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
Area: XXXXX
label to the ticket, indicating the functional areas it may be related to.2.4-develop
branch@magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure. 2.4-develop
branch, please, add the label Reproduced on 2.4.x
.Issue: Confirmed
once verification is complete. Hello @dvrgoc,
Thank you for the report and collaboration!
We are able to get the actual result, that is ipv4
value is string in jquery.validate.js
.
Please refer the screenshot:
But can you mention the issue you are facing due to change in datatype.
HI @engcom-November
that is correct, this is datatype issue.
While I was working with other methods of implementing the validation rules, all other rules return Boolean, not String.
Please read my article which covers the topic - Deep Dive into Validation Rules
If you have any questions, let me know.
Hello @dvrgoc,
Thanks for the update.
I agree with this, inconsistent return type compared to rest of the methods is not a good practice and might cause error further down the line. Hence confirming this.
:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-12079 is successfully created for this GitHub issue.
:white_check_mark: Confirmed by @engcom-November. Thank you for verifying the issue.
Issue Available: @engcom-November, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.
:x: You don't have permission to export this issue.
This issue is automatically created based on existing pull request: magento/magento2#38773: Fix type when validating field using attribute rules
Description (*)
If attribute based rules are used to specify validation of a field in HTML, incorrect type is used when validating. For example, validation rule is
ipv4
and has assigned a value of true and is processed as String, but should be Boolean instead.<input name="field" ipv4="true" ... />
Related Pull Requests
N/A
Fixed Issues (if relevant)
N/A
Manual testing scenarios (*)
custom-form.phtml
)rules
method:// debug the value if (!!$.validator.attributeRules(element) && Object.keys($.validator.attributeRules(element)).length > 0) { console.log($.validator.attributeRules(element)); } ...