Open kestraly opened 2 years ago
Hi @kestraly. Thank you for your report. To speed up processing of this issue, make sure that you provided the following information:
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:
@magento give me 2.4-develop instance
- upcoming 2.4.x release
For more details, review the Magento Contributor Assistant documentation.
Add a comment to assign the issue: @magento I am working on this
To learn more about issue processing workflow, refer to the Code Contributions.
Join Magento Community Engineering Slack and ask your questions in #github channel.
:warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
:clock10: You can find the schedule on the Magento Community Calendar page.
:telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.
:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel
@magento give me 2.4-develop instance
Hi @kestraly. Thank you for your request. I'm working on Magento instance for you.
Hi @kestraly, here is your Magento Instance: https://c5930c694d6c0d2be495a0fbda0bc0ab.instances.magento-community.engineering Admin access: https://c5930c694d6c0d2be495a0fbda0bc0ab.instances.magento-community.engineering/admin_76d7 Login: 7c82a08d Password: d9eec1f3fcc6
Error is reproduced, but allowed to add to cart with single option
Uncaught SyntaxError: Unexpected token '}'
at legacy-build.min.js:1:9878
at Array.map (
require([
"jquery",
"mage/backend/validation"
], function(jQuery){
//<![CDATA[ jQuery.validator.addMethod('validate-datetime-1', function(v) {
var dateTimeParts = jQuery('.datetime-picker[id^="options_1"]');
for (var i=0; i < dateTimeParts.length; i++) {
if (dateTimeParts[i].value == "") return false;
}
return true;
}, 'This\u0020is\u0020a\u0020required\u0020option.'); //]]>
});
Hi @engcom-Dash. 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:
Issue: Format is valid
will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid
appears.Issue: Clear Description
label to the issue by yourself.Component: XXXXX
label(s) to the ticket, indicating the components 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
.@magento give me 2.4-develop instance
Hi @engcom-Dash. Thank you for your request. I'm working on Magento instance for you.
Hi @engcom-Dash, here is your Magento Instance: https://c5930c694d6c0d2be495a0fbda0bc0ab.instances.magento-community.engineering Admin access: https://c5930c694d6c0d2be495a0fbda0bc0ab.instances.magento-community.engineering/admin_ab2f Login: 7439b8d7 Password: f88d2d8fc1c7
@magento give me 2.4-develop instance
Hi @engcom-Dash. Thank you for your request. I'm working on Magento instance for you.
Hi @engcom-Dash, here is your Magento Instance: https://c5930c694d6c0d2be495a0fbda0bc0ab.instances.magento-community.engineering Admin access: https://c5930c694d6c0d2be495a0fbda0bc0ab.instances.magento-community.engineering/admin_5dc3 Login: 5da09c54 Password: ba7e07e13eb1
Hi @kestraly ,
We are trying to reproduce the issue in 2.4-develop branch...we are not able to reproduce the issue.we are getting expected results. Steps: 1.Stores > Configuration > Catalog > [Date & Time Custom Options] Date Fields Order - Day / Month / Year
Magento version 2.4-develop PHP 7.4
We are able place the order successfully
Let us know if we missing anything!!! Thanks!!!
@engcom-Dash Whilst selecting date, if you check your console in the browser, you’ll see the JS error. It basically stops the validation process, which in turn breaks adding further custom options.
The bigger issue is how pre_processed files is handled.
I can add imagery if required
Image of the error that appears in console.
It definitely breaks custom options. Please review your console @engcom-Dash whilst adding the custom option to basket. Then review the line to see that addMethod is becoming ommited //<![CDATA[ jQuery.validator.addMethod('validate-datetime-1', function(v) {
@magento give me 2.4-develop instance
Hi @engcom-Dash. Thank you for your request. I'm working on Magento instance for you.
Hi @engcom-Dash, here is your Magento Instance: https://c5930c694d6c0d2be495a0fbda0bc0ab.instances.magento-community.engineering Admin access: https://c5930c694d6c0d2be495a0fbda0bc0ab.instances.magento-community.engineering/admin_ff47 Login: 052a2869 Password: 418e75ac7e9e
Hi @kestraly , Thanks For your Information!!! We are Worked as per your last comment...We are also getting same JS error in console.So we are confirming the issue.
Precondition: Magento Version 2.4-develop PHP 8.1 Magento installed with custom date module. Steps To reproduce: 1.Set Date as drop down in Stores > Configuration > Catalog > [Date & Time Custom Options] 2.set the Date Fields Order - Day / Month / Year 3.save and clear cache 4.go to Catalog > Products > Select or add a new product 5.Add a date custom option to a product with date.phtml as required 6.go to Sales > Order 7.Create a new order, with new customer 8.Select add products 9.Select the product with the required custom option date we are gettingJjs error in console as per-actual result. Screenshots:
Error is reproduced, but allowed to add to cart with single option
Uncaught SyntaxError: Unexpected token '}' at legacy-build.min.js:1:9878 at Array.map () at Array.collect (legacy-build.min.js:1:19426) at String.evalScripts (legacy-build.min.js:1:9845) at legacy-build.min.js:1:6086
Let us know if we missing anything !!!
Thanks!!!
Unfortunately, not enough information was provided to create a Jira ticket. Please make sure you added the following label(s): Reproduced on 2.4.x
, ^Area:.*
Once all required labels are present, please add Issue: Confirmed
label again.
Unfortunately, not enough information was provided to create a Jira ticket. Please make sure you added the following label(s): Reproduced on 2.4.x
, ^Area:.*
Once all required labels are present, please add Issue: Confirmed
label again.
:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-6995 is successfully created for this GitHub issue.
:white_check_mark: Confirmed by @engcom-Dash. Thank you for verifying the issue.
Issue Available: @engcom-Dash, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.
We just encountered this. Still an issue in 2.4.6-p3 and 2.4.7-beta2.
patch.zip Patch for Unexpected token '}' error How use it https://experienceleague.adobe.com/docs/commerce-operations/upgrade-guide/patches/apply.html?lang=en#composer
Hello @RetroProgrammist
I think it would be better to wrap CDATA
component using other commenting style
For example:
/*<![CDATA[*/
I am going to prepare the PR to resolve this problem
@magento I am working on it
Preconditions and environment
Steps to reproduce
- Set Date as drop down in Stores > Configuration > Catalog > [Date & Time Custom Options] Date Fields Order - Day / Month / Year Save
- Catalog > Products > Select or add a new product Add a date custom option to a product with date.phtml as required
- Sales > Order Create a new order, with new customer Select Add Products Select the product with the required custom option date
Expected result
Be able to select date and press continue and process the order.
Actual result
Console logs javascript syntax error closing of }
./vendor/magento/module-catalog/view/adminhtml/templates/catalog/product/composite/fieldset/options/type/date.phtml
Checking in ./var/view_preprocessed/pub/static/vendor/magento/module-catalog/view/adminhtml/templates/catalog/product/composite/fieldset/options/type/date.phtml- line 63 is escaped with //
jQuery.validator.addMethod('validate-datetime-
Becomes
// jQuery.validator.addMethod('validate-datetime-
Removing line 59
//<![CDATA[
and line 91//]]>
in date.phtml fixes the syntax errorThe product cannot be added to the order and a work around must be employed
Additional information
No response
Release note
No response
Triage and priority