Difference between revisions of "X-Cart:To apply a patch manually"
(Created page with '1. Open the diff file in a text editor; : Diff files are divided into parts ("hunks"). Each "hunk" starts with a line like this: <pre>@@ -67,7 +67,10 @@</pre> : where: :* 67 -…') |
|||
Line 36: | Line 36: | ||
$category_lng['code'] = $shop_language; | $category_lng['code'] = $shop_language; | ||
+ | |||
</pre> | </pre> | ||
2. Edit the file (in our example, admin/category_modify.php): | 2. Edit the file (in our example, admin/category_modify.php): | ||
+ | |||
:* Find the lines, which are marked by "-" in the text of patch, and remove them. | :* Find the lines, which are marked by "-" in the text of patch, and remove them. | ||
:* Insert the lines, which are marked by "+" in the text of patch. | :* Insert the lines, which are marked by "+" in the text of patch. |
Revision as of 10:43, 13 September 2010
1. Open the diff file in a text editor;
- Diff files are divided into parts ("hunks"). Each "hunk" starts with a line like this:
@@ -67,7 +67,10 @@
- where:
- 67 - indicates the number of the line of the code where the changes start
- 7 - indicates the number of the lines in the hunk before patch applying
- 10 - indicates the number of the lines in the hunk after patch applying
- Then follows the file code marked with "+" and "-" signs. Lines marked with "+" are the lines that you need to add in the file that you should patch. Lines marked with "-" are the lines that you need to remove from the file that you should patch.
- Under 'Index:' you will find the name of the file that you should patch, for example:
Index: admin/category_modify.php
- Here is an example of complete diff file:
Index: admin/category_modify.php @@ -67,7 +67,10 @@ # if ($shop_language == $config['default_admin_language']) { - func_array2update("categories", $category_lng, "categoryid = '$cat'"); + $_category_lng = $category_lng; + if (empty($_category_lng['category'])) + func_unset($_category_lng, 'category'); + func_array2update("categories", $_category_lng, "categoryid = '$cat'"); } $category_lng['code'] = $shop_language;
2. Edit the file (in our example, admin/category_modify.php):
- Find the lines, which are marked by "-" in the text of patch, and remove them.
- Insert the lines, which are marked by "+" in the text of patch.
If you cannot apply the patch in these ways it means the file that needs to be patched has been modified or this file is from another version of X-Cart and cannot be patched by this patch. Ask technical support to help you.