Atechstl Posted April 7, 2015 Share Posted April 7, 2015 I just attempted to upgrade 5.2.16 to 6.0.2 and ran into an issue of not being able to add an item to the shopping cart. Kept getting an error stating that the item was no longer available and has been removed from your basket. I cleared the cache directory and the issue was never resolved. The error log kept populating with [06-Apr-2015 19:02:43 America/Chicago] PHP Notice: `customer_id` is not allowed as a key in 'CubeCart_saved_cart' table! in /home/********/public_html/classes/db/database.class.php on line 852 Any Ideas? I restored to a backup until I know there is a fix for this problem. Quote Link to comment Share on other sites More sharing options...
bsmither Posted April 7, 2015 Share Posted April 7, 2015 For the database functions to say that a column does not exist, when it plainly does, suggests to me that the database host/user/pass is pointing to the wrong database. But that shouldn't happen if the database being used is the same one as what was being used before the upgrade. If you are able to look at the database using an external utility, like phpMyAdmin, please check on what the table CubeCart_saved_cart looks like. Quote Link to comment Share on other sites More sharing options...
Atechstl Posted April 7, 2015 Author Share Posted April 7, 2015 Yes that is Odd. Since I restored from a backup I will have to attempt this again. I will attempt another upgrade this weekend. Quote Link to comment Share on other sites More sharing options...
bsmither Posted April 8, 2015 Share Posted April 8, 2015 May I ask if you upgraded from CubeCart v3/v4 into CC5? Then to CC6? If so, did you have a mod for CC3/4 that had CubeCart save customer's carts/orders? If so, then this table may have interfered with the upgrade process from CC3/4 to CC503 where:CREATE TABLE IF NOT EXISTS `CubeCart_saved_cart` If the table existed, it would not get re-created, but probably have different columns. Given the above, CC503+ has the ability to save customer's carts between sessions (admin, Store Settings, Features tab, "Auto save user's cart"). But, CC5 also has the ability to switch this feature off. In that case, this table would never be used and never cause this error. However, it appears that CC6 will always use this feature. Thus, an existing table with the wrong schema will cause this error. Quote Link to comment Share on other sites More sharing options...
Atechstl Posted April 17, 2015 Author Share Posted April 17, 2015 This website has been around since Cubecart 3 and upgraded of course. I don't recall if there are any addons. Quote Link to comment Share on other sites More sharing options...
Atechstl Posted April 17, 2015 Author Share Posted April 17, 2015 I simply dropped the table 'CubeCart_saved_cart' performed the upgrade and it worked. I tested with adding and removing from shopping cart and placed a test order. All orked. Quote Link to comment Share on other sites More sharing options...
bsmither Posted April 17, 2015 Share Posted April 17, 2015 Good to hear. The screen grab you posted shows that this schema is the same as CC5216. So, it's still weird that there was a problem with it. Quote Link to comment Share on other sites More sharing options...
Atechstl Posted April 17, 2015 Author Share Posted April 17, 2015 (edited) Is it okay that I complete dropped that table? When I did the upgrade it didn't readd it. My Error logs are populating with the following error: PHP Notice: `customer_id` is not allowed as a key in 'CubeCart_saved_cart' table! in /home/####/public_html/classes/db/database.class.php on line 852 Edited April 17, 2015 by Atechstl Quote Link to comment Share on other sites More sharing options...
bsmither Posted April 18, 2015 Share Posted April 18, 2015 The table did not get re-created??? Well, sure, an upgrade changes the existing database schema. It does not check for anything about the database schema that may be amiss.Using an external utility such as phpMyadmin, execute the statement that creates this table:CREATE TABLE `CubeCart_saved_cart` ( `customer_id` INT UNSIGNED NOT NULL, `basket` mediumblob NOT NULL, PRIMARY KEY (`customer_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; Quote Link to comment Share on other sites More sharing options...
Atechstl Posted April 18, 2015 Author Share Posted April 18, 2015 Thank you BSmither. I executed the command and the table was created. I will keep an eye on the error log but that should have fixed it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.