From 9a2e929b976dd52955bc90228508b113e54f085e Mon Sep 17 00:00:00 2001 From: David Manners Date: Wed, 23 May 2018 15:25:45 +0200 Subject: [PATCH 01/10] HowDoI: Create a tutorial for patching a composer project from github - show the tool for patching into composer, - show how to create a patch file from a github url, --- guides/v2.2/howdoi/patch_from_github.md | 43 +++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 guides/v2.2/howdoi/patch_from_github.md diff --git a/guides/v2.2/howdoi/patch_from_github.md b/guides/v2.2/howdoi/patch_from_github.md new file mode 100644 index 00000000000..65971bc3b07 --- /dev/null +++ b/guides/v2.2/howdoi/patch_from_github.md @@ -0,0 +1,43 @@ +--- +group: howdoi +subgroup: Applying patches to Magento 2 from github +title: Applying patches to Magento 2 from github +menu_title: Applying patches to Magento 2 from github +menu_node: parent +menu_order: 1 +version: 2.1 +github_link: howdoi/patch_from_github.md +--- + +## Applying patches to Magento 2 from github +There are occasions when a core bug has been fixed in GitHub but it has not yet been released via a composer release. +It is possible with the help of a composer plugin to include any patch from GitHub into composer project. +Please note that care must be taken when adding an unreleased patch and detailed testing should be completed before deployment. + +### Generating a patch from GitHub + +To create a patch file from a Github commit or PR, append `.patch` to the url, [for example](https://github.com/magento/magento2/commit/2d31571f1bacd11aa2ec795180abf682e0e9aede.patch). +Note that you will need to change the paths in the patch file to correspond to the `vendor/***` directories. + +### Apply a patch using the composer-patches plugin + +1. Create a `patches/composer` directory. This will house patches that are to be applied by composer. +2. Prepare your patch file so that the paths are relative to the `vendor//` directory (e.g, vendor/magento/module-payment). +3. Name the patch file appropriately and move it into the `patches/composer` directory. +4. Run this command in the root of your local project: `composer require cweagans/composer-patches` +5. Edit the composer.json file in the root of your Magento installation and add the following section, specifying the Composer package to apply the patch to, as well as a description of the patch and a reference to the file location: + + ``` + "extra": { + "magento-force": "override", + "composer-exit-on-patch-failure": true, + "patches": { + "magento/module-payment": { + "MAGETWO-56934: Checkout page freezes when ordering with Authorize.net with invalid credit card": "patches/composer/github-issue-6474.patch" + } + } + } + ``` + +6. Run `composer install` to apply the patch. +7. Run `composer update ` (e.g. `composer update magento/module-payment`) to update the composer lock file. The lock file tracks which patches have been applied to each composer package in an extra > patches_applied object. From 54c4a037f1657e85feb244d5f89e13b057cebb6e Mon Sep 17 00:00:00 2001 From: Jeff Matthews Date: Wed, 23 May 2018 13:01:09 -0500 Subject: [PATCH 02/10] Editorial revisions from tech writer --- guides/v2.2/howdoi/patch_from_github.md | 73 ++++++++++++++++--------- 1 file changed, 46 insertions(+), 27 deletions(-) diff --git a/guides/v2.2/howdoi/patch_from_github.md b/guides/v2.2/howdoi/patch_from_github.md index 65971bc3b07..d5bbcaf7b4c 100644 --- a/guides/v2.2/howdoi/patch_from_github.md +++ b/guides/v2.2/howdoi/patch_from_github.md @@ -1,34 +1,44 @@ --- +layout: default group: howdoi -subgroup: Applying patches to Magento 2 from github -title: Applying patches to Magento 2 from github -menu_title: Applying patches to Magento 2 from github -menu_node: parent -menu_order: 1 -version: 2.1 +title: Create a GitHub patch for a Composer installation +version: 2.2 github_link: howdoi/patch_from_github.md +functional_areas: + - Install + - System + - Setup --- -## Applying patches to Magento 2 from github -There are occasions when a core bug has been fixed in GitHub but it has not yet been released via a composer release. -It is possible with the help of a composer plugin to include any patch from GitHub into composer project. -Please note that care must be taken when adding an unreleased patch and detailed testing should be completed before deployment. +Sometimes it takes a while for us to include a bug fix made on GitHub in a Magento 2 Composer release. In the meantime, you can create a patch from GitHub and use the `composer-patches` plugin to apply it to your Composer-based Magento 2 installation. -### Generating a patch from GitHub +
+Be careful applying an unreleased patch. Do comprehensive testing before deploying it. +
-To create a patch file from a Github commit or PR, append `.patch` to the url, [for example](https://github.com/magento/magento2/commit/2d31571f1bacd11aa2ec795180abf682e0e9aede.patch). -Note that you will need to change the paths in the patch file to correspond to the `vendor/***` directories. +## Create a patch -### Apply a patch using the composer-patches plugin +To create a patch file from a GitHub commit or pull request, append `.patch` to the url, [https://github.com/magento/magento2/commit/2d31571f1bacd11aa2ec795180abf682e0e9aede.patch](https://github.com/magento/magento2/commit/2d31571f1bacd11aa2ec795180abf682e0e9aede.patch). -1. Create a `patches/composer` directory. This will house patches that are to be applied by composer. -2. Prepare your patch file so that the paths are relative to the `vendor//` directory (e.g, vendor/magento/module-payment). -3. Name the patch file appropriately and move it into the `patches/composer` directory. -4. Run this command in the root of your local project: `composer require cweagans/composer-patches` -5. Edit the composer.json file in the root of your Magento installation and add the following section, specifying the Composer package to apply the patch to, as well as a description of the patch and a reference to the file location: - - ``` - "extra": { +
+You must change the paths in the patch file to correspond to the `vendor/***` directories. +
+ +## Apply a patch + +1. Create a `patches/composer` directory. +1. Prepare your patch file so that the paths are relative to the `vendor//` directory. For example `vendor/magento/module-payment`. +1. Name the patch file appropriately and move it to the `patches/composer` directory. +2. Add the `composer-patches` plugin to the `composer.json` file. + + ```bash + composer require cweagans/composer-patches + ``` + +1. Edit the `composer.json` file and add the following section, specifying the Composer package to apply the patch to, as well as a description of the patch and a reference to the file location: + + ```json + "extra": { "magento-force": "override", "composer-exit-on-patch-failure": true, "patches": { @@ -36,8 +46,17 @@ Note that you will need to change the paths in the patch file to correspond to t "MAGETWO-56934: Checkout page freezes when ordering with Authorize.net with invalid credit card": "patches/composer/github-issue-6474.patch" } } - } - ``` - -6. Run `composer install` to apply the patch. -7. Run `composer update ` (e.g. `composer update magento/module-payment`) to update the composer lock file. The lock file tracks which patches have been applied to each composer package in an extra > patches_applied object. + } + ``` + +2. Apply the patch. + + ```bash + composer install + ``` + +1. Update the `composer.lock` file. The lock file tracks which patches have been applied to each Composer package in an `extra > patches_applied` object. + + ```bash + composer update + ``` \ No newline at end of file From ed1f664ba8ea9d4b07a9e951ab2a7472a1ee3b1f Mon Sep 17 00:00:00 2001 From: Jeff Matthews Date: Wed, 23 May 2018 13:05:24 -0500 Subject: [PATCH 03/10] Move to 2.1 and symlink to 2.2 and 2.3 --- guides/v2.2/howdoi/patch_from_github.md | 63 +------------------------ 1 file changed, 1 insertion(+), 62 deletions(-) mode change 100644 => 120000 guides/v2.2/howdoi/patch_from_github.md diff --git a/guides/v2.2/howdoi/patch_from_github.md b/guides/v2.2/howdoi/patch_from_github.md deleted file mode 100644 index d5bbcaf7b4c..00000000000 --- a/guides/v2.2/howdoi/patch_from_github.md +++ /dev/null @@ -1,62 +0,0 @@ ---- -layout: default -group: howdoi -title: Create a GitHub patch for a Composer installation -version: 2.2 -github_link: howdoi/patch_from_github.md -functional_areas: - - Install - - System - - Setup ---- - -Sometimes it takes a while for us to include a bug fix made on GitHub in a Magento 2 Composer release. In the meantime, you can create a patch from GitHub and use the `composer-patches` plugin to apply it to your Composer-based Magento 2 installation. - -
-Be careful applying an unreleased patch. Do comprehensive testing before deploying it. -
- -## Create a patch - -To create a patch file from a GitHub commit or pull request, append `.patch` to the url, [https://github.com/magento/magento2/commit/2d31571f1bacd11aa2ec795180abf682e0e9aede.patch](https://github.com/magento/magento2/commit/2d31571f1bacd11aa2ec795180abf682e0e9aede.patch). - -
-You must change the paths in the patch file to correspond to the `vendor/***` directories. -
- -## Apply a patch - -1. Create a `patches/composer` directory. -1. Prepare your patch file so that the paths are relative to the `vendor//` directory. For example `vendor/magento/module-payment`. -1. Name the patch file appropriately and move it to the `patches/composer` directory. -2. Add the `composer-patches` plugin to the `composer.json` file. - - ```bash - composer require cweagans/composer-patches - ``` - -1. Edit the `composer.json` file and add the following section, specifying the Composer package to apply the patch to, as well as a description of the patch and a reference to the file location: - - ```json - "extra": { - "magento-force": "override", - "composer-exit-on-patch-failure": true, - "patches": { - "magento/module-payment": { - "MAGETWO-56934: Checkout page freezes when ordering with Authorize.net with invalid credit card": "patches/composer/github-issue-6474.patch" - } - } - } - ``` - -2. Apply the patch. - - ```bash - composer install - ``` - -1. Update the `composer.lock` file. The lock file tracks which patches have been applied to each Composer package in an `extra > patches_applied` object. - - ```bash - composer update - ``` \ No newline at end of file diff --git a/guides/v2.2/howdoi/patch_from_github.md b/guides/v2.2/howdoi/patch_from_github.md new file mode 120000 index 00000000000..26bdfa848c2 --- /dev/null +++ b/guides/v2.2/howdoi/patch_from_github.md @@ -0,0 +1 @@ +../../v2.1/howdoi/patch_from_github.md \ No newline at end of file From b10c25383826553686afe389aca9b7cfe1c25c9a Mon Sep 17 00:00:00 2001 From: Jeff Matthews Date: Wed, 23 May 2018 13:05:51 -0500 Subject: [PATCH 04/10] Move to 2.1 and symlink to 2.2 and 2.3 --- guides/v2.1/howdoi/patch_from_github.md | 62 +++++++++++++++++++++++++ guides/v2.3/howdoi/patch_from_github.md | 1 + 2 files changed, 63 insertions(+) create mode 100644 guides/v2.1/howdoi/patch_from_github.md create mode 120000 guides/v2.3/howdoi/patch_from_github.md diff --git a/guides/v2.1/howdoi/patch_from_github.md b/guides/v2.1/howdoi/patch_from_github.md new file mode 100644 index 00000000000..d5bbcaf7b4c --- /dev/null +++ b/guides/v2.1/howdoi/patch_from_github.md @@ -0,0 +1,62 @@ +--- +layout: default +group: howdoi +title: Create a GitHub patch for a Composer installation +version: 2.2 +github_link: howdoi/patch_from_github.md +functional_areas: + - Install + - System + - Setup +--- + +Sometimes it takes a while for us to include a bug fix made on GitHub in a Magento 2 Composer release. In the meantime, you can create a patch from GitHub and use the `composer-patches` plugin to apply it to your Composer-based Magento 2 installation. + +
+Be careful applying an unreleased patch. Do comprehensive testing before deploying it. +
+ +## Create a patch + +To create a patch file from a GitHub commit or pull request, append `.patch` to the url, [https://github.com/magento/magento2/commit/2d31571f1bacd11aa2ec795180abf682e0e9aede.patch](https://github.com/magento/magento2/commit/2d31571f1bacd11aa2ec795180abf682e0e9aede.patch). + +
+You must change the paths in the patch file to correspond to the `vendor/***` directories. +
+ +## Apply a patch + +1. Create a `patches/composer` directory. +1. Prepare your patch file so that the paths are relative to the `vendor//` directory. For example `vendor/magento/module-payment`. +1. Name the patch file appropriately and move it to the `patches/composer` directory. +2. Add the `composer-patches` plugin to the `composer.json` file. + + ```bash + composer require cweagans/composer-patches + ``` + +1. Edit the `composer.json` file and add the following section, specifying the Composer package to apply the patch to, as well as a description of the patch and a reference to the file location: + + ```json + "extra": { + "magento-force": "override", + "composer-exit-on-patch-failure": true, + "patches": { + "magento/module-payment": { + "MAGETWO-56934: Checkout page freezes when ordering with Authorize.net with invalid credit card": "patches/composer/github-issue-6474.patch" + } + } + } + ``` + +2. Apply the patch. + + ```bash + composer install + ``` + +1. Update the `composer.lock` file. The lock file tracks which patches have been applied to each Composer package in an `extra > patches_applied` object. + + ```bash + composer update + ``` \ No newline at end of file diff --git a/guides/v2.3/howdoi/patch_from_github.md b/guides/v2.3/howdoi/patch_from_github.md new file mode 120000 index 00000000000..4c3cd36c636 --- /dev/null +++ b/guides/v2.3/howdoi/patch_from_github.md @@ -0,0 +1 @@ +../../v2.2/howdoi/patch_from_github.md \ No newline at end of file From e358e87be9f30b135d1ddcbadda9c6e6115a97c8 Mon Sep 17 00:00:00 2001 From: Jeff Matthews Date: Wed, 23 May 2018 13:40:01 -0500 Subject: [PATCH 05/10] Add topic to the left navigation --- _data/toc/how-do-i.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/_data/toc/how-do-i.yml b/_data/toc/how-do-i.yml index 25f02ed26a4..bdd6e790660 100644 --- a/_data/toc/how-do-i.yml +++ b/_data/toc/how-do-i.yml @@ -6,6 +6,10 @@ pages: - label: Contributor sign-up sheet url: howdoi/howdoi_contribute.html + - label: Create a GitHub patch for a Composer installation + versions: ["2.1","2.2", "2.3"] + url: howdoi/patch_from_github.html + - label: Configure Magento url: howdoi/config/configure.html From 47bd87870a8b104b7228be7bc6527df989ae1d7b Mon Sep 17 00:00:00 2001 From: Jeff Matthews Date: Wed, 23 May 2018 13:46:01 -0500 Subject: [PATCH 06/10] Prepend nav link with forward slash so it doesn't break when we merge with upstream --- _data/toc/how-do-i.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_data/toc/how-do-i.yml b/_data/toc/how-do-i.yml index bdd6e790660..66da7a4d15f 100644 --- a/_data/toc/how-do-i.yml +++ b/_data/toc/how-do-i.yml @@ -8,7 +8,7 @@ pages: - label: Create a GitHub patch for a Composer installation versions: ["2.1","2.2", "2.3"] - url: howdoi/patch_from_github.html + url: /howdoi/patch_from_github.html - label: Configure Magento url: howdoi/config/configure.html From 43fcab63a60349c5cb6d2d2dea183509c1e3eecb Mon Sep 17 00:00:00 2001 From: Jeff Matthews Date: Wed, 23 May 2018 15:18:31 -0500 Subject: [PATCH 07/10] Revised per peer review --- guides/v2.1/howdoi/patch_from_github.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/guides/v2.1/howdoi/patch_from_github.md b/guides/v2.1/howdoi/patch_from_github.md index d5bbcaf7b4c..dffc718eef8 100644 --- a/guides/v2.1/howdoi/patch_from_github.md +++ b/guides/v2.1/howdoi/patch_from_github.md @@ -1,5 +1,4 @@ --- -layout: default group: howdoi title: Create a GitHub patch for a Composer installation version: 2.2 @@ -13,7 +12,7 @@ functional_areas: Sometimes it takes a while for us to include a bug fix made on GitHub in a Magento 2 Composer release. In the meantime, you can create a patch from GitHub and use the `composer-patches` plugin to apply it to your Composer-based Magento 2 installation.
-Be careful applying an unreleased patch. Do comprehensive testing before deploying it. +Always perform comprehensive testing before deploying any unreleased patch.
## Create a patch @@ -29,7 +28,7 @@ You must change the paths in the patch file to correspond to the `vendor/***` di 1. Create a `patches/composer` directory. 1. Prepare your patch file so that the paths are relative to the `vendor//` directory. For example `vendor/magento/module-payment`. 1. Name the patch file appropriately and move it to the `patches/composer` directory. -2. Add the `composer-patches` plugin to the `composer.json` file. +2. Add the `cweagans/composer-patches` plugin to the `composer.json` file. ```bash composer require cweagans/composer-patches From f353f5268969eb85929f43cce023a8c859029ab9 Mon Sep 17 00:00:00 2001 From: Jeff Matthews Date: Thu, 31 May 2018 10:51:48 -0500 Subject: [PATCH 08/10] Revisions based on initial review feedback --- guides/v2.1/howdoi/patch_from_github.md | 63 +++++++++++++++++-------- 1 file changed, 44 insertions(+), 19 deletions(-) diff --git a/guides/v2.1/howdoi/patch_from_github.md b/guides/v2.1/howdoi/patch_from_github.md index dffc718eef8..1eea95dca41 100644 --- a/guides/v2.1/howdoi/patch_from_github.md +++ b/guides/v2.1/howdoi/patch_from_github.md @@ -1,4 +1,5 @@ --- +layout: default group: howdoi title: Create a GitHub patch for a Composer installation version: 2.2 @@ -9,7 +10,7 @@ functional_areas: - Setup --- -Sometimes it takes a while for us to include a bug fix made on GitHub in a Magento 2 Composer release. In the meantime, you can create a patch from GitHub and use the `composer-patches` plugin to apply it to your Composer-based Magento 2 installation. +Sometimes it takes a while for us to include a bug fix made on GitHub in a Magento 2 Composer release. In the meantime, you can create a patch from GitHub and use the [`cweagans/composer-patches`](https://github.com/cweagans/composer-patches/){:target="\_blank"} plugin to apply it to your Composer-based Magento 2 installation.
Always perform comprehensive testing before deploying any unreleased patch. @@ -17,45 +18,69 @@ Always perform comprehensive testing before deploying any unreleased patch. ## Create a patch -To create a patch file from a GitHub commit or pull request, append `.patch` to the url, [https://github.com/magento/magento2/commit/2d31571f1bacd11aa2ec795180abf682e0e9aede.patch](https://github.com/magento/magento2/commit/2d31571f1bacd11aa2ec795180abf682e0e9aede.patch). +To create a patch file: -
-You must change the paths in the patch file to correspond to the `vendor/***` directories. -
+1. Create a `patches/composer` directory in your local project. + +1. Identify the GitHub commit or pull request to use for the patch. For example: + + [`2d31571f1bacd11aa2ec795180abf682e0e9aede`](https://github.com/magento/magento2/commit/2d31571f1bacd11aa2ec795180abf682e0e9aede){:target="\_blank"} + +1. Append `.patch` or `.diff` to the commit URL. Use `.diff` for a smaller file size. For example: + + [https://github.com/magento/magento2/commit/2d31571f1bacd11aa2ec795180abf682e0e9aede.patch](https://github.com/magento/magento2/commit/2d31571f1bacd11aa2ec795180abf682e0e9aede.patch){:target="\_blank"} + +1. Save the page as a file in the `patches/composer` directory. + +1. Edit the file and change all paths so that they are relative to the `vendor//` directory. For example, replace all instances of `app/code/Magento/Payment/` with `vendor/magento/module-payment/`. + +
+ Text editors that automatically remove trailing whitespace or add new lines can break the patch. Use a simple text editor to make these changes. +
## Apply a patch -1. Create a `patches/composer` directory. -1. Prepare your patch file so that the paths are relative to the `vendor//` directory. For example `vendor/magento/module-payment`. -1. Name the patch file appropriately and move it to the `patches/composer` directory. -2. Add the `cweagans/composer-patches` plugin to the `composer.json` file. +To apply a patch: + +1. Open a terminal and navigate to your project directory. + +1. Add the `cweagans/composer-patches` plugin to the `composer.json` file. ```bash composer require cweagans/composer-patches ``` -1. Edit the `composer.json` file and add the following section, specifying the Composer package to apply the patch to, as well as a description of the patch and a reference to the file location: +1. Edit the `composer.json` file and add the following section to specify: + + - **Module**: _"magento/module-payment"_ + - **Title**: _"MAGETWO-56934: Checkout page freezes when ordering with Authorize.net with invalid credit card"_ + - **Path to patch**: _"patches/composer/github-issue-6474.patch"_ + + For example: - ```json - "extra": { - "magento-force": "override", + ```json + "extra": { "composer-exit-on-patch-failure": true, "patches": { "magento/module-payment": { "MAGETWO-56934: Checkout page freezes when ordering with Authorize.net with invalid credit card": "patches/composer/github-issue-6474.patch" } } - } - ``` + } + ``` + +
+ If a patch affects multiple modules, you must create multiple patch files targeting multiple modules. +
-2. Apply the patch. +1. Apply the patch. Use the `-v` option to show debugging information. ```bash - composer install + composer -v install ``` 1. Update the `composer.lock` file. The lock file tracks which patches have been applied to each Composer package in an `extra > patches_applied` object. ```bash - composer update - ``` \ No newline at end of file + composer update --lock + ``` From c52502bdc3e1a1ce499ae9d97a9371f4fe5d2c05 Mon Sep 17 00:00:00 2001 From: Jeff Matthews Date: Mon, 4 Jun 2018 12:36:20 -0500 Subject: [PATCH 09/10] Correct relative path info --- guides/v2.1/howdoi/patch_from_github.md | 40 +++++++++++++++++++++---- 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/guides/v2.1/howdoi/patch_from_github.md b/guides/v2.1/howdoi/patch_from_github.md index 1eea95dca41..22f7e6aaa1f 100644 --- a/guides/v2.1/howdoi/patch_from_github.md +++ b/guides/v2.1/howdoi/patch_from_github.md @@ -18,21 +18,49 @@ Always perform comprehensive testing before deploying any unreleased patch. ## Create a patch +There are many ways to create patch files. This example focuses on creating a patch from a known commit. + To create a patch file: 1. Create a `patches/composer` directory in your local project. -1. Identify the GitHub commit or pull request to use for the patch. For example: - - [`2d31571f1bacd11aa2ec795180abf682e0e9aede`](https://github.com/magento/magento2/commit/2d31571f1bacd11aa2ec795180abf682e0e9aede){:target="\_blank"} +1. Identify the GitHub commit or pull request to use for the patch. This example uses the [`2d31571`](https://github.com/magento/magento2/commit/2d31571f1bacd11aa2ec795180abf682e0e9aede){:target="\_blank"} commit linked to Magento 2 GitHub issue [#6474](https://github.com/magento/magento2/issues/6474){:target="\_blank"}. 1. Append `.patch` or `.diff` to the commit URL. Use `.diff` for a smaller file size. For example: [https://github.com/magento/magento2/commit/2d31571f1bacd11aa2ec795180abf682e0e9aede.patch](https://github.com/magento/magento2/commit/2d31571f1bacd11aa2ec795180abf682e0e9aede.patch){:target="\_blank"} -1. Save the page as a file in the `patches/composer` directory. +1. Save the page as a file in the `patches/composer` directory. For example, `github-issue-6474.patch`. + +1. Edit the file and remove `vendor//` from all paths so that they are relative to the `vendor//` directory. + + The following example shows the previously mentioned patch file after removing all instances of `app/code/Magento/Payment`: -1. Edit the file and change all paths so that they are relative to the `vendor//` directory. For example, replace all instances of `app/code/Magento/Payment/` with `vendor/magento/module-payment/`. + ```text + From 2d31571f1bacd11aa2ec795180abf682e0e9aede Mon Sep 17 00:00:00 2001 + From: Ievgen Sentiabov + Date: Wed, 31 Aug 2016 18:46:44 +0300 + Subject: [PATCH] MAGETWO-56934: Checkout page freezes when ordering with + Authorize.net with invalid credit card + + - Added fail() method call + --- + view/frontend/web/js/view/payment/iframe.js | 1 + + 1 file changed, 1 insertion(+) + + diff --git a/view/frontend/web/js/view/payment/iframe.js b/view/frontend/web/js/view/payment/iframe.js + index c8a6fef58d31..7d01c195791e 100644 + --- a/view/frontend/web/js/view/payment/iframe.js + +++ b/view/frontend/web/js/view/payment/iframe.js + @@ -154,6 +154,7 @@ define( + */ + clearTimeout: function () { + clearTimeout(this.timeoutId); + + this.fail(); + + return this; + }, + ```
Text editors that automatically remove trailing whitespace or add new lines can break the patch. Use a simple text editor to make these changes. @@ -73,7 +101,7 @@ To apply a patch: If a patch affects multiple modules, you must create multiple patch files targeting multiple modules.
-1. Apply the patch. Use the `-v` option to show debugging information. +1. Apply the patch. Use the `-v` option only if you want to see debugging information. ```bash composer -v install From a775db1913df23cd606adb422a273b251d59ce4c Mon Sep 17 00:00:00 2001 From: Jeff Matthews Date: Mon, 4 Jun 2018 13:14:34 -0500 Subject: [PATCH 10/10] Replaced patch with diff example --- guides/v2.1/howdoi/patch_from_github.md | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/guides/v2.1/howdoi/patch_from_github.md b/guides/v2.1/howdoi/patch_from_github.md index 22f7e6aaa1f..814c2ee1b68 100644 --- a/guides/v2.1/howdoi/patch_from_github.md +++ b/guides/v2.1/howdoi/patch_from_github.md @@ -28,26 +28,15 @@ To create a patch file: 1. Append `.patch` or `.diff` to the commit URL. Use `.diff` for a smaller file size. For example: - [https://github.com/magento/magento2/commit/2d31571f1bacd11aa2ec795180abf682e0e9aede.patch](https://github.com/magento/magento2/commit/2d31571f1bacd11aa2ec795180abf682e0e9aede.patch){:target="\_blank"} + [https://github.com/magento/magento2/commit/2d31571f1bacd11aa2ec795180abf682e0e9aede.diff](https://github.com/magento/magento2/commit/2d31571f1bacd11aa2ec795180abf682e0e9aede.diff){:target="\_blank"} -1. Save the page as a file in the `patches/composer` directory. For example, `github-issue-6474.patch`. +1. Save the page as a file in the `patches/composer` directory. For example, `github-issue-6474.diff`. 1. Edit the file and remove `vendor//` from all paths so that they are relative to the `vendor//` directory. - The following example shows the previously mentioned patch file after removing all instances of `app/code/Magento/Payment`: + The following example shows the previously mentioned diff file after removing all instances of `app/code/Magento/Payment`: ```text - From 2d31571f1bacd11aa2ec795180abf682e0e9aede Mon Sep 17 00:00:00 2001 - From: Ievgen Sentiabov - Date: Wed, 31 Aug 2016 18:46:44 +0300 - Subject: [PATCH] MAGETWO-56934: Checkout page freezes when ordering with - Authorize.net with invalid credit card - - - Added fail() method call - --- - view/frontend/web/js/view/payment/iframe.js | 1 + - 1 file changed, 1 insertion(+) - diff --git a/view/frontend/web/js/view/payment/iframe.js b/view/frontend/web/js/view/payment/iframe.js index c8a6fef58d31..7d01c195791e 100644 --- a/view/frontend/web/js/view/payment/iframe.js @@ -82,7 +71,7 @@ To apply a patch: - **Module**: _"magento/module-payment"_ - **Title**: _"MAGETWO-56934: Checkout page freezes when ordering with Authorize.net with invalid credit card"_ - - **Path to patch**: _"patches/composer/github-issue-6474.patch"_ + - **Path to patch**: _"patches/composer/github-issue-6474.diff"_ For example: @@ -91,7 +80,7 @@ To apply a patch: "composer-exit-on-patch-failure": true, "patches": { "magento/module-payment": { - "MAGETWO-56934: Checkout page freezes when ordering with Authorize.net with invalid credit card": "patches/composer/github-issue-6474.patch" + "MAGETWO-56934: Checkout page freezes when ordering with Authorize.net with invalid credit card": "patches/composer/github-issue-6474.diff" } } }