Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Upgrade your store
 
Reply
   X-Cart forums > General > General talk
 
Thread Tools
  #191  
Old 11-24-2008, 05:02 PM
 
kenneth kenneth is offline
 

Newbie
  
Join Date: Mar 2005
Posts: 1
 

Default Re: Upgrade your store

I've just upgraded my 4.0.12 to 4.0.17 and applied the Mysql 5 patch. Several files had to be manually patched during the upgrade because of custom site modifications.

I have this on a test box and have discovered one problem, the anonymous check out button is no longer working as is the modify profile for login accounts. Other buttons appear to work but have only finished the upgrade this evening, so it isn't heavily tested yet.

I'm a newbie at this but managed to get this far. Any advice on where to look for the problems? It's not throwing out any SQL errors. It's as if the buttons are no longer connected.

Mysql 5.0
php 5

Thanks

Ken
__________________
xcart gold v 4.0.12 upgraded to 4.0.17
Reply With Quote
  #192  
Old 03-27-2009, 11:56 AM
 
html_sucks html_sucks is offline
 

Advanced Member
  
Join Date: May 2004
Location: London, UK
Posts: 63
 

Default Re: Upgrade your store

hi,
could anyone please tell me if I can upgrade from 4.0.13 to 4.0.19 at once or do I have to upgrade first to 4.0.17, then to 4.0.18 and then to 4.0.19 ? I just need sql upgrade but in File Area there's only sql upgrade for 4.0.19-4.1.11
__________________
X-Cart v4.2.0, v4.0.13, v4.0.9, v4.0.17
Reply With Quote
  #193  
Old 03-28-2009, 04:25 PM
 
Dawn Dawn is offline
 

Member
  
Join Date: Oct 2005
Posts: 25
 

Default Re: Upgrade your store

Somewhat frustrated here. Can't run the patch as it claims it's already patched (it isn't) and no one seems willing to explain manually patching the one file (or I've managed to miss it). I get that the "-" means remove and "+" means add, but there are lines that don't exist in the right place in the original file that it has neither "+" nor "-" next to.
Confusing.
The latter half of the patch has this:
Quote:
function db_select_db($sql_db) {
@@ -51,6 +53,10 @@
global $debug_mode;
global $mysql_autorepair;

+ if(MYSQL5 && preg_match("/\s*SELECT/i", $query)) {
+ $query = preg_replace("/FROM([^\"\']+?)LEFT\s+?JOIN/is","FROM($1)LEFT JOIN",$query);
+ }
+
if(defined("START_TIME")) {
global $__sql_time;
$t = func_microtime();
if(defined("START_TIME")) is actually defined lower down in another function: "function db_query($query)", as are the two globals, not in the one given in the patch:
Quote:
function db_select_db($sql_db) {
return mysql_select_db($sql_db) || die("Could not connect to SQL db");
}

How do you manually patch? Can someone show an example of a patched section from lines 40-70 or so?

I should mention I tried adding in just the "+" lines and removing the "-" lines, but the mysql errors persist, same as before.
__________________
X-cart 4.0.16 Pro
Reply With Quote
  #194  
Old 03-28-2009, 05:07 PM
 
Dawn Dawn is offline
 

Member
  
Join Date: Oct 2005
Posts: 25
 

Default Re: Upgrade your store

Quote:
Originally Posted by Dawn
if(defined("START_TIME")) is actually defined lower down in another function: "function db_query($query)", as are the two globals, not in the one given in the patch:
That explained it. I was assuming because it was showing this line "function db_select_db($sql_db)" that the lines needed to go there. The lines above and below that show the context of the section to edit exist in the query just below that for whatever reason. Added the lines to that function "function db_query($query)" and it's working now.

Weird, but done.
__________________
X-cart 4.0.16 Pro
Reply With Quote
  #195  
Old 07-28-2009, 06:13 AM
 
bobb bobb is offline
 

Member
  
Join Date: Jul 2005
Location: LI, NY, USA
Posts: 27
 

Default Re: Upgrade your store

The patch on page 7 of this thread did not work for me. Qualiteam support provided the patch below, which fixed our X-Cart 4.0.x and MySQL 5.x incompatibility problem.

This was applied to a server running FreeBSD with Apache 2.2.1, MYSQL 5.0.84, PHP 5.2.10.

If you apply the patch manually, make a backup of \include\func.php and do the 2nd section 1st so the line #'s are a help. Or have Qualiteam install it for a nominal fee.

Code:
Index: include/func.php --- /u/install/www/xcart_4_0_x/include/func.php 2008-07-05 08:14:26.000000000 +0400 +++ /u/seyfin/www/xcart_4_0_x/include/func.php 2009-07-01 08:09:15.000000000 +0400 @@ -36,6 +36,17 @@ if ( !defined('XCART_START') ) { header("Location: ../"); die("Access denied"); } +/* MySQL 5.0 Compatibility Code */ +define("MYSQL5", true); +#define("MYSQL5",substr(mysql_get_server_info(),0,1)=="5"); +function upgrade_to_mysql_5($qry) { + if (strpos(strtoupper($qry),"SELECT")!==false) { + $qry=preg_replace("/FROM([^\"\']+?)LEFT\s+?JOIN/is","FROM($1)LEFT JOIN",$qry); + } + return $qry; +} +/* End Compatibility Code */ + # # Database abstract layer functions # @@ -55,7 +66,12 @@ global $__sql_time; $t = func_microtime(); } + + /* Check for MySQL 5 */ + if (MYSQL5) $query = upgrade_to_mysql_5($query); $result = mysql_query($query); + /* End MySQL 5 check */ + if(defined("START_TIME")) { $__sql_time += func_microtime()-$t; }
__________________
X-Cart Gold v 4.0.18
FreeBSD 6.2, Apache 2.2.11, PERL 5.8.8, PHP 5.2.10, MySQL 5.0.84
rearendparts.com
Reply With Quote
Reply
   X-Cart forums > General > General talk


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 07:50 AM.

   

 
X-Cart forums © 2001-2018