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.55k stars 9.32k forks source link

sampledata:reset has no effect since Magento 2.3.0 #37651

Open schmengler opened 1 year ago

schmengler commented 1 year ago

Preconditions and environment

With Magento 2.3.0, the sample data modules were changed to work with data patches instead of legacy data upgrade scripts. But the reset command still assumes a data_version of the module which is not used anymore:

            foreach (array_keys($sampleDataPackages) as $name) {
                $moduleName = $this->packageInfo->getModuleName($name);
                if ($moduleName !== null) {
                    $this->moduleResource->setDataVersion($moduleName, '');
                }
            }

Steps to reproduce

Expected result

patches from sample data modules are removed from patch_list database table

Actual result

no change

Additional information

No response

Release note

No response

Triage and priority

m2-assistant[bot] commented 1 year ago

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

m2-assistant[bot] commented 1 year ago

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:

engcom-Bravo commented 1 year ago

Hi @schmengler,

Thank you for reporting and collaboration.

As per Magento devdocs https://experienceleague.adobe.com/docs/commerce-operations/installation-guide/next-steps/sample-data/remove-or-update.html?lang=en#prepare-to-update-sample-data the bin/magento sampledata:reset command enables you to update sample data.

Screenshot 2023-08-01 at 5 48 41 PM Screenshot 2023-08-01 at 5 39 30 PM

Could you please refer the document and please let us know if we are missing anything.

Thanks.

schmengler commented 1 year ago

@engcom-Bravo I see no issue with that documentation. I assume it is still correct that this command should be used before updating. However, this is not the only purpose. If we look at the output of bin/magento help sampledata:reset, it says "Reset all sample data modules for re-installation"

Description:
  Reset all sample data modules for re-installation

Usage:
  sampledata:reset

Options:
  -h, --help            Display this help message
  -q, --quiet           Do not output any message
  -V, --version         Display this application version
      --ansi            Force ANSI output
      --no-ansi         Disable ANSI output
  -n, --no-interaction  Do not ask any interactive question
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

For proper reinstallation, the DB entries for data patches must be removed so that they will be re-applied again to create products etc.

To clarify again: Currently, the command does nothing

engcom-Bravo commented 1 year ago

Hi @schmengler,

Thanks for your update.

We are considering this as a feature request to proceed further as this as a existing behaviour of Magento.

Thanks.

schmengler commented 1 year ago

@engcom-Bravo in this case, I would request to delete the paragraph of the documentation, because - I repeat - the command currently does nothing.