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.53k stars 9.31k forks source link

Default created storeview sales sequences are missing a prefix #30863

Open hostep opened 3 years ago

hostep commented 3 years ago

Preconditions (*)

Magento 2.4-develop

Steps to reproduce (*)

  1. Setup a Magento 2 shop (doesn't matter which version, this has been bugged since forever)
  2. Look at the sales_sequence_profile table in the database.

Expected result (*)

  1. The profiles associated to storeview ID 1 should have as prefix 1

Actual result (*)

  1. The profiles associated to storeview ID 1 have as prefix NULL

DB prefix

Discussion

When creating a second storeview, it gets prefix 2, so one would expect that the default storeview which is created when setting up a shop gets prefix 1.

When this gets fixed, it should only be fixed for new Magento shops being setup, please don't add a db migration script to fix it for existing shops, that would be very unexpected for shop owners.

Workaround

The following SQL can be executed as a workaround if you want the prefix to be set correctly/consistently with other storeviews:

UPDATE `sales_sequence_profile`
SET `prefix` = 1
WHERE `profile_id` IN
    (SELECT `meta_id`
     FROM `sales_sequence_meta`
     WHERE `store_id` = 1);

Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

m2-assistant[bot] commented 3 years ago

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

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.4-develop instance - upcoming 2.4.x release

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

Please, add a comment to assign the issue: @magento I am working on this


: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, please join the Community Contributions Triage session to discuss the appropriate ticket.

:movie_camera: You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

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

m2-assistant[bot] commented 3 years ago

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

magento-engcom-team commented 3 years ago

:white_check_mark: Confirmed by @engcom-Alfa Thank you for verifying the issue. Based on the provided information internal tickets MC-39058 were created

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

vlmed commented 3 years ago

@magento I am working on this

hostep commented 3 years ago

@sivaschenko: I strongly believe this needs to be included in Magento core one day, so can the priorities be increased from P3 to P2 please? If this fix only comes included with quality-patches, I'm afraid that strange things could happen when this patch eventually is thrown out of quality-patches and never makes it into the core, since this has to do with database manipulation code.

sivaschenko commented 2 years ago

@hostep agree, priority increased to P2. However, it's still currently targeting 2.5 due to BIC nature of the fix

brohon commented 8 months ago

I just ran into this issue in 2024.

I created a new store, but the rows in sales_sequence_profile and sales_sequence_meta were not created.

On my development and staging environments, they were created, and I can see there are four extra rows on those tables in those enviroments.

hostep commented 8 months ago

@brohon: that's not the same issue as this bug report. I would suggest you search your log files for indications what failed when creating new stores, or if you can't find answers there, to ask your question on https://magento.stackexchange.com/ for example.