Closed devchris79 closed 2 days ago
Hi @devchris79. 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:
@magento give me 2.4-develop instance
- upcoming 2.4.x release@magento I am working on this
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.
Hi @engcom-Bravo. 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:
Area: XXXXX
label to the ticket, indicating the functional areas 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
.Issue: Confirmed
once verification is complete. @magento give me 2.4-develop instance
Hi @devchris79. Thank you for your request. I'm working on Magento instance for you.
Hi @devchris79, here is your Magento Instance: https://425b33c70d326c1b721c9944d897ac48.instances-prod.magento-community.engineering Admin access: https://425b33c70d326c1b721c9944d897ac48.instances-prod.magento-community.engineering/admin_70cf Login: 60720acc Password: 7c09f3d9d112
The development instance doesn't show the issue, India has the regions in the shipping options. I wonder if its an issue when updating an instance of Magento.
Hi @devchris79,
Thanks for your reporting and collaboration.
We have verified the issue in Latest 2.4-develop instance and the issue is not reproducible.Multiple regions displayed
Could you please let us know from which version you have upgraded the instance and facing this issue.
Thanks.
Magento was updated from version 2.4.6 to 2.4.7, although the issue could have been present prior to that. I have manually injected regions into the database to correct for now.
@glo17720 (file author) Why is there two very similar files for adding regions to India, AddRegionsForIndia.php looks wrong with only Ladakh in the array as seen in our 2.4.7 site, where as AddDataForIndia.php looks correct.
Hi @devchris79,
Thanks for your update.
We are moving this issue On hold
as we are discussing this issue with the Internal Team.
Thanks
Hi @devchris79,
We got reply from the internal team as follows :
In Magento 2, data patches are applied during bin/magento setup:upgrade. When a new data patch is added, Magento checks the patch_list table to see if it’s already applied. If not, it applies the patch.
If you modify an existing patch, it won’t reapply automatically. To reapply, you must delete the patch’s entry in patch_list
or create a new patch file for additional changes.
The file AddDataForIndia.php is a data patch file that is applied once during installation.
To reapply the data patch with the newly added Ladakh region in the AddDataForIndia.php file, follow these steps:
Remove the entry for the AddDataForIndia
patch from the patch_list
table.
SET SQL_SAFE_UPDATES = 0;
DELETE FROM <root-directory-name>.patch_list WHERE patch_name = 'Magento\\Directory\\Setup\\Patch\\Data\\AddDataForIndia';
Delete the corresponding regions associated with India (to avoid duplicate regions when the patch is reapplied) from the directory_country_region
table.
DELETE FROM <root-directory-name>.directory_country_region WHERE country_id = 'IN';
SET SQL_SAFE_UPDATES = 1;
Note: Being in production, deleting directly from SQL is not recommended.
This will force Magento to reapply the patch.
To avoid these steps, a new data patch, AddRegionsForIndia
, has been added with the new region, Ladakh. This patch will be applied without affecting existing data.
Below are screen recordings of regions in versions 2.4.6 and 2.4.7, showing that regions are unaffected after upgrading from 2.4.6 to 2.4.7.
https://github.com/user-attachments/assets/9bd5abf5-0979-4dda-98d4-76499122fc00
https://github.com/user-attachments/assets/25c2ddc2-b442-49df-91ae-c0d3bce3cab8
verified it by upgrading from 2.4.6 to 2.4.7. Issue is not reproducible.Hence we are closing this issue.
Thank
Preconditions and environment
Steps to reproduce
Select India, only 1 region appears - Ladakh
Expected result
Multiple regions displayed
Actual result
1 region appears - Ladakh
Additional information
It appears that a selection of India is using
app/code/Magento/Directory/Setup/Patch/Data/AddRegionsForIndia.php
I assume it should be usingapp/code/Magento/Directory/Setup/Patch/Data/AddDataForIndia.php
(file also exists in same directory) as every other country appears to use this format. India appears to be some odd exception...Release note
No response
Triage and priority