Usage
The Quality Patches Tool delivers individual patches developed by Adobe and the Magento Open Source community. It allows you to apply, revert, and view general information about all individual patches that are available for the installed version of Adobe Commerce or Magento Open Source. You can apply patches to Adobe Commerce and Magento Open Source projects regardless of who developed the patch. For example, you can apply a patch developed by the community to Adobe Commerce projects.
Watch this technical video and learn how to use the Quality Patches Tool for Adobe Commerce and Magento Open Source.
Install
composer require magento/quality-patches
View individual patches
To view the list of individual patches available for your version of Adobe Commerce or Magento Open Source:
./vendor/bin/magento-patches status
You will see output similar to the following:
- magento/module-page-cache
- magento/framework
Affected components: - magento/framework
- amzn/amazon-pay-module
- magento/module-cms
- magento/module-cms
- MC-2
Affected components:
- magento/module-cms
- magento/module-cms
Adobe Commerce 2.3.5.
The status table includes:
-
Type:
Optional
— All patches from the Quality Patches Tool and the Commerce on Cloud Infrastructure Guide > Apply patches package are optional for Adobe Commerce and Magento Open Source installations.Deprecated
— Adobe has deprecated the individual patch. If you have applied the patch, we recommend that you revert it. The revert operation also removes the patch from the status table.
-
Status:
Applied
— The patch has been applied.Not applied
— The patch has not been applied.N/A
— The status of the patch cannot be defined due to conflicts.
-
Details:
Affected components
— The list of affected modules.Required patches
— The list of patches that must be applied for an indicated patch to work properly (dependencies).Recommended replacement
— The patch that is a recommended replacement for a deprecated patch.
Apply individual patches apply-individual-patches
To apply a single patch, run the following command where MAGETWO-XXXX
is the patch ID specified in the status table:
./vendor/bin/magento-patches apply MAGETWO-XXXX
You can also apply several patches at the same time by separating each additional patch ID with a space:
./vendor/bin/magento-patches apply MAGETWO-XXXX MAGETWO-YYYY
You must clean the cache after applying patches to see changes in the Adobe Commerce application:
./bin/magento cache:clean
Revert individual patches
To revert a single patch, run the following command where MAGETWO-XXXX
is the patch ID specified in the status table:
./vendor/bin/magento-patches revert MAGETWO-XXXX
Also, you can revert several patches at the same time by separating each additional patch ID with a space:
./vendor/bin/magento-patches revert MAGETWO-XXXX MAGETWO-YYYY
To revert all applied patches:
./vendor/bin/magento-patches revert --all
You must clean the cache after reverting patches to see changes in the Adobe Commerce application:
./bin/magento cache:clean
Get updates
Adobe Commerce periodically releases new individual patches. You must update the Quality Patches Tool to get new individual patches:
composer update magento/quality-patches
View the added patches:
./vendor/bin/magento-patches status
Re-apply patches after an upgrade re-apply-patches-after-an-upgrade
When you upgrade to a new version of Adobe Commerce or Magento Open Source, you must re-apply patches if the patches are not included in the new version.
To re-apply patches:
-
Update the Quality Patches Tool:
code language-bash composer update magento/quality-patches.
-
Open the list of previously applied patches, which was recommended in Apply individual patches.
-
Apply the patches:
code language-bash ./vendor/bin/magento-patches apply MAGETWO-XXXX
The best practice is to apply patches one at a time.
-
Clean the cache:
code language-bash ./bin/magento cache:clean
note info INFO When you run the status
command, the patches that were included in the new version are no longer displayed in the table of available patches.
Logging
The Quality Patches Tool logs all operations in the <Magento_root>/var/log/patch.log
file.