magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.48k stars 9.29k forks source link

product view validation.js undefined this.radioCheckboxClosest #37713

Open sheepfy opened 1 year ago

sheepfy commented 1 year ago

https://github.com/magento/magento2/blame/2abc466714ec397efbe865ac1f10b7141aa586f3/app/code/Magento/Catalog/view/frontend/web/product/view/validation.js#L45

This line will be always undefined since the jquery.validate.js got updated to the latest version.

jquery.validate.js is now doing: this.settings.errorPlacement.call( this, place, $( element ) ); instead of: this.settings.errorPlacement( place, $( element ) );

Therefor in product/view/validation.js "this" variable is changed and this.radioCheckboxClosest is not defined. It needs to be updated to "this.settings.radioCheckboxClosest"

m2-assistant[bot] commented 1 year ago

Hi @sheepfy. Thank you for your report. To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:

sheepfy commented 1 year ago

cc @magento-engcom-team

sheepfy commented 1 year ago

Also after fixing this issue, when clicking "add to cart" button first time, highlight errors will appear, which is good. But if you click second time the "add to cart" button, the error option will get removed.

sheepfy commented 1 year ago

Added test in vanila magento, configurable product with extra custom options of type checkbox (replicable also for radios)

image

sheepfy commented 1 year ago

If using the correct selector in there:

First click: image Second click: image

m2-assistant[bot] commented 1 year ago

Hi @engcom-Hotel. 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:

engcom-Hotel commented 1 year ago

Hello @sheepfy,

Thanks for the report and collaboration!

We have tried to reproduce the issue in the 2.4-develop branch and it seems the issue is reproducible as mentioned in the description.

Please have a look at the below screenshot for reference:

image

Hence confirming the issue.

Thanks

github-jira-sync-bot commented 1 year ago

:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-9121 is successfully created for this GitHub issue.

m2-assistant[bot] commented 1 year ago

:white_check_mark: Confirmed by @engcom-Hotel. Thank you for verifying the issue.
Issue Available: @engcom-Hotel, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.