Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adminhtml - Product with custom option date [required] when creating an order via admin #36423

Open
1 of 5 tasks
kestraly opened this issue Nov 5, 2022 · 27 comments · May be fixed by #38401
Open
1 of 5 tasks

Adminhtml - Product with custom option date [required] when creating an order via admin #36423

kestraly opened this issue Nov 5, 2022 · 27 comments · May be fixed by #38401
Assignees
Labels
Area: Admin UI Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P3 May be fixed according to the position in the backlog. Progress: PR in progress Reported on 2.4.x Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch

Comments

@kestraly
Copy link

kestraly commented Nov 5, 2022

Preconditions and environment

  • Magento version 2.4.4-p2
  • PHP 7.4

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 error

The 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

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
@m2-assistant
Copy link

m2-assistant bot commented Nov 5, 2022

Hi @kestraly. Thank you for your report.
To speed up processing of this issue, make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

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.


⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

📞 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.

✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

@kestraly
Copy link
Author

kestraly commented Nov 5, 2022

@magento give me 2.4-develop instance

@magento-deployment-service
Copy link

Hi @kestraly. Thank you for your request. I'm working on Magento instance for you.

@magento-deployment-service
Copy link

@kestraly
Copy link
Author

kestraly commented Nov 5, 2022

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

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.');                //]]>

            });

@engcom-Dash engcom-Dash self-assigned this Nov 7, 2022
@m2-assistant
Copy link

m2-assistant bot commented Nov 7, 2022

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: 👇

    1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
      DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.
    1. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.
    1. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.
    1. Verify that the issue is reproducible on 2.4-develop branch
      Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
      - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
      - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

@engcom-Dash
Copy link

@magento give me 2.4-develop instance

@magento-deployment-service
Copy link

Hi @engcom-Dash. Thank you for your request. I'm working on Magento instance for you.

@magento-deployment-service
Copy link

@engcom-Dash
Copy link

@magento give me 2.4-develop instance

@magento-deployment-service
Copy link

Hi @engcom-Dash. Thank you for your request. I'm working on Magento instance for you.

@magento-deployment-service
Copy link

@engcom-Dash
Copy link

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
2. Sales > Order
Create a new order, with new customer
Select Add Products
Select the product with the required custom option date

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 engcom-Dash added the Issue: needs update Additional information is require, waiting for response label Nov 7, 2022
@kestraly
Copy link
Author

kestraly commented Nov 7, 2022

@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

@kestraly
Copy link
Author

kestraly commented Nov 7, 2022

Image of the error that appears in console.
plJ8Q4.md.jpg

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) {

@engcom-Dash
Copy link

@magento give me 2.4-develop instance

@magento-deployment-service
Copy link

Hi @engcom-Dash. Thank you for your request. I'm working on Magento instance for you.

@magento-deployment-service
Copy link

@engcom-Dash
Copy link

engcom-Dash commented Nov 9, 2022

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:

Screenshot 2022-11-09 at 2 39 54 PM

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!!!

@engcom-Dash engcom-Dash added Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Reported on 2.4.x Indicates original Magento version for the Issue report. and removed Issue: needs update Additional information is require, waiting for response labels Nov 9, 2022
@github-jira-sync-bot
Copy link

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.

@github-jira-sync-bot github-jira-sync-bot removed the Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed label Nov 9, 2022
@github-jira-sync-bot
Copy link

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.

@engcom-Dash engcom-Dash added the Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed label Nov 9, 2022
@github-jira-sync-bot
Copy link

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

@m2-assistant
Copy link

m2-assistant bot commented Nov 9, 2022

✅ 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.

@engcom-Hotel engcom-Hotel added the Priority: P3 May be fixed according to the position in the backlog. label Nov 15, 2022
@JeromeBeckett
Copy link

We just encountered this. Still an issue in 2.4.6-p3 and 2.4.7-beta2.

@RetroProgrammist
Copy link

@andrewbess
Copy link

andrewbess commented Jan 31, 2024

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

@andrewbess
Copy link

@magento I am working on it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Admin UI Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P3 May be fixed according to the position in the backlog. Progress: PR in progress Reported on 2.4.x Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch
Projects
Status: Pull Request In Progress
Development

Successfully merging a pull request may close this issue.

7 participants