Quote:
Originally Posted by kustomrides
Oh, I have an idea about the upgrade/patch procedure. Instead of the process failing because the code-to-be-replaced isn't on the expected line, why not do a search-and-replace? It's an easy code to do in whatever language. Currently almost every modified file will fail an upgrade because added/deleted code moves the location of everything below it. Sure, you'll get fewer tickets from people asking you to do the upgrade, but still. And it would be easy. Just write a program to convert your diff files. I'd write one myself but I forgot my schooling.
|
Actually, the patch/upgrade utility has been improved in the latest versions of X-Cart (as far as I remember, since 4.3.0).
Specifically, it searches for the code to be replaced around (above and below) the expected line. If found, it changes it to the new code.
For example:
Quote:
Index: include/func/func.category.php
@@ -942,8 +940,7 @@
'c.rpos'
);
- $search_condition =
- $join_tbl = array();
+ $search_condition = $join_tbl = array();
if ($current_area == 'A' || $current_area == 'P') {
|
The patch/upgrade utility searches for the following 8 lines of code around the line 942 in include/func/func.category.php:
Quote:
line 942: 'c.rpos'
line 943: );
line 944:
line 945: $search_condition =
line 946: $join_tbl = array();
line 947:
line 948: if ($current_area == 'A' || $current_area == 'P') {
line 949:
|
If found, the exiting code is changed to the following 7 lines of code:
Quote:
line 940: 'c.rpos'
line 941: );
line 942:
line 943: $search_condition = $join_tbl = array();
line 944:
line 945: if ($current_area == 'A' || $current_area == 'P') {
line 946:
|
It is basically the same procedure when applying patches manually:
http://help.qtmsoft.com/index.php?title=X-Cart:To_apply_a_patch_manually