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

Incorrect behaviour of export/import logic for product with datetime attribute #25700

Open
staradzinau opened this issue Nov 22, 2019 · 13 comments
Labels
Component: ImportExport Event: mm20in Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Priority: P3 May be fixed according to the position in the backlog. Progress: dev in progress Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. Triage: Ready for Triage Issue is ready to me triaged with Product Manager

Comments

@staradzinau
Copy link

staradzinau commented Nov 22, 2019

Preconditions (*)

  1. Magento 2.3.3 or 2.3-develop
  2. Set Locale to "English (United Kingdom)"
  3. Default County: United States
  4. Product attribute with "Catalog Input Type for Store Owner" => 'Date' (for example - 'test_date_attribute')
  5. Add this attribute to default attribute set
  6. Simple product with date attribute 'test_date_attribute' is created. (SKU = 'test-product-sku')

Scenario 1
Steps to reproduce

  1. Set some date for the 'test_date_attribute' attribute for product 'test-product-sku'. (Day of the month should be greater than 12)
    Screenshot from 2019-11-25 14-49-45
  2. Go to System -> Export, perform products export operation to create a CSV, which contains product 'test-product-sku' with the value of 'test_date_attribute' attribute
    Screenshot from 2019-11-25 15-22-43

Expected result (*)

Value of 'test_date_attribute' attribute in the product creation page is formatted according to the current locale

Actual result (*)

The format of the attribute value 'test_date_attribute' on the product creation page does not match the current locale

Scenario 2
Steps to reproduce

  1. Go to System -> Import, choose 'Products' entity type, upload CSV form the previous scenario, and click on "Sheck Data" button

Expected result (*)

Exported data is validated correctly, the "Import" button is shown

Actual result (*)

Format of the value of 'test_date_attribute' attribute in the product creation page, do not correspond to the current locale. Exported data validation is failed
Screenshot from 2019-11-25 14-33-30

Additional information

After manual modifying of the date format to the US one inside CSV file, validation works correctly, import operation works fine

@m2-assistant
Copy link

m2-assistant bot commented Nov 22, 2019

Hi @avgust1111. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

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

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.3-develop instance - upcoming 2.3.x release

For more details, please, review the Magento Contributor Assistant documentation.

@avgust1111 do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • yes
  • no

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Nov 22, 2019
@staradzinau
Copy link
Author

@magento give me 2.3-develop instance

@magento-engcom-team
Copy link
Contributor

Hi @avgust1111. Thank you for your request. I'm working on Magento 2.3-develop instance for you

@magento-engcom-team
Copy link
Contributor

Hi @avgust1111, here is your Magento instance.
Admin access: https://i-25700-2-3-develop.instances.magento-community.engineering/admin
Login: admin Password: 123123q
Instance will be terminated in up to 3 hours.

@staradzinau
Copy link
Author

It's impossible to reproduce the issue within the provided Magento instance: running cron job is required for fetching export results (CSV file). Seems like specified M2 instance doesn't have running cron job

@engcom-Echo engcom-Echo self-assigned this Nov 22, 2019
@m2-assistant
Copy link

m2-assistant bot commented Nov 22, 2019

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

  • 2. 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.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Add label Issue: Confirmed once verification is complete.

  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@engcom-Echo
Copy link
Contributor

Hello @avgust1111

Thank you for your report and collaboration!
We are not able to reproduce this issue by provided steps.
Tested on 2.3-develop and 2.3.3

Testing scenario:

Preconditions:

  1. Default locale - United States
  2. Product attribute with "Catalog Input Type for Store Owner" => 'Date' (for example - 'test_date_attribute')
  3. Add this attribute to default attribute set
  4. Simple product with date attribute 'test_date_attribute' is created. (SKU = 'test-product-sku')

Scenario 1
Steps to reproduce

  1. Set some date for the 'test_date_attribute' attribute for product 'test-product-sku'. (Day of the month should be greater than 12)
  2. Go to System -> Export, perform products export operation to create a CSV, which contains product 'test-product-sku' with the value of 'test_date_attribute' attribute

Result
Value of 'test_date_attribute' attribute in the CSV is formatted according to the current locale
Screenshot from 2019-11-22 16-24-45
Screenshot from 2019-11-22 17-25-51

Scenario 2

Steps to reproduce

  1. Go to System -> Import, choose 'Products' entity type, upload CSV form the previous scenario, and click on "Sheck Data" button

Result
Exported data is validated correctly, the "Import" button is shown
Screenshot from 2019-11-22 17-32-47
Thank you!

@staradzinau
Copy link
Author

Hello, @engcom-Echo !
Thank you for the quick feedback

Please, check, which county is used in the "Country options" section in the "General" tab?
Had your CSV export file been generated by cron, after some delay?

I've reproduced the same issue on the 2.3.3 installation with native sample data, all the dates in the CSV export file have the incorrect format, please, look:
aw_651
aw_652
Month and day aren't compatible with US date format

@engcom-Echo
Copy link
Contributor

Hello @avgust1111

Here is my Settings (M 2.3.3)
Screenshot from 2019-11-25 13-12-22
Screenshot from 2019-11-25 13-12-37

All my CSV export files has been generated by cron after some delay.
All files have the correct date format.

Screenshot from 2019-11-25 13-30-30

Could you provide more details for reproduce this issue?
Please add screenshots of the attribute settings.

Thank you!

@staradzinau
Copy link
Author

staradzinau commented Nov 25, 2019

Hello, @engcom-Echo !

Thank you for the update.
I've checked settings again and found the option, which triggers misbehavior for import/export. In my test environment with native M2 sample data installed, 'Locale" has been set to "English (United Kingdom)". So, if you set in "Stores" -> "Configuration" -> "General" -> "General" -> Country Options -> Default County: United States, and in "Stores" -> "Configuration" -> "General" -> "General" -> Locale Options -> Locale: "English (United Kingdom)", your exported CSV file will contain dates in the wrong format
Sorry for incomplete steps to reproduce
Please, check this case

Thank you!

@engcom-Echo engcom-Echo added Component: ImportExport Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed and removed Progress: needs update labels Nov 25, 2019
@ghost ghost unassigned engcom-Echo Nov 25, 2019
@magento-engcom-team
Copy link
Contributor

✅ Confirmed by @engcom-Echo
Thank you for verifying the issue. Based on the provided information internal tickets MC-29131 were created

Issue Available: @engcom-Echo, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

@magento-engcom-team magento-engcom-team added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Nov 25, 2019
@sanjay-wagento sanjay-wagento self-assigned this Feb 2, 2020
@m2-assistant
Copy link

m2-assistant bot commented Feb 2, 2020

Hi @sanjay-wagento. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:

  • 1. Add/Edit Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 2. 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!

  • 3. If the issue is not relevant or is not reproducible any more, feel free to close it.


@sanjay-wagento
Copy link
Contributor

#MM20IN

@magento-engcom-team magento-engcom-team added this to Dev in Progress in Community Backlog Mar 24, 2020
@sdzhepa sdzhepa added the Triage: Ready for Triage Issue is ready to me triaged with Product Manager label Jul 30, 2020
@sdzhepa sdzhepa added Priority: P3 May be fixed according to the position in the backlog. Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. labels Jul 30, 2020
@ghost ghost moved this from Dev in Progress to Ready for Dev in Community Backlog Sep 1, 2020
@ghost ghost moved this from Ready for Dev to Dev in Progress in Community Backlog Sep 1, 2020
@sidolov sidolov added this to Ready for Development in Low Priority Backlog Sep 24, 2020
@m2-community-project m2-community-project bot moved this from Ready for Development to Dev In Progress in Low Priority Backlog Sep 24, 2020
@ghost ghost unassigned sanjay-wagento Oct 8, 2020
@m2-community-project m2-community-project bot moved this from Dev In Progress to Ready for Development in Low Priority Backlog Oct 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: ImportExport Event: mm20in Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Priority: P3 May be fixed according to the position in the backlog. Progress: dev in progress Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. Triage: Ready for Triage Issue is ready to me triaged with Product Manager
Projects
Low Priority Backlog
  
Ready for Development
Community Backlog
  
Dev in Progress
Development

No branches or pull requests

7 participants