VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: JDmpdx on September 19, 2018, 21:43:42 PM

Title: Getting "1054 Unknown column 'STsameAsBT' in 'field list'...
Post by: JDmpdx on September 19, 2018, 21:43:42 PM
Hi all- 

Basics:  I'm using VM 3.4.0, Joomla 3.8.12, PHP 7.2.8

When people go to "confirm purchase," they are normally redirected to Paypal. But, currently, it just goes to an error page "1054 Unknown column 'STsameAsBT' in 'field list' "

I've tried:  (1) Disabling any HTML overrides ... same problem / didn't fix, (2) disabling a "One Step Checkout for Virtuemart" plugin ... same problem, didn't fix.

Any thoughts on what might be at play here?
Title: Re: Getting "1054 Unknown column 'STsameAsBT' in 'field list'...
Post by: tomaa on September 20, 2018, 09:01:05 AM
After update to VM 3.4.0 I got the same problem error when trying to change orderstatus from Payed to Shipped.
I need help to.
Title: Re: Getting "1054 Unknown column 'STsameAsBT' in 'field list'...
Post by: p.barg on September 20, 2018, 10:16:02 AM
Same problem here (on a test installation) with standard payment.
Title: Re: Getting "1054 Unknown column 'STsameAsBT' in 'field list'...
Post by: Leila on September 20, 2018, 10:36:36 AM
After update to VM 3.4 I have the same problem. Joomla 3.8.12, VM 3.4, PHP 7.2. Besides I get 404 error on product details page when activate customfileds with price. "Call to undefined method VirtueMartModelCustomfields::_getCustomPrice()".
Title: Re: Getting "1054 Unknown column 'STsameAsBT' in 'field list'...
Post by: AH on September 20, 2018, 10:50:26 AM
Looks like your order table has not been updated

Look in virtuemart_orders table

There should be a field STsameAsBT TINYINT default set to 0
Title: Re: Getting "1054 Unknown column 'STsameAsBT' in 'field list'...
Post by: Milbo on September 20, 2018, 11:00:44 AM
Looks like the updater did not update the order table correctly. The order table has now
`STsameAsBT` tinyint(1) NOT NULL DEFAULT '0',

Usually the updater should also update the table structure. So it is interesting to understand, why that did not work in your case.
Quote from: Leila on September 20, 2018, 10:36:36 AM
After update to VM 3.4 I have the same problem. Joomla 3.8.12, VM 3.4, PHP 7.2. Besides I get 404 error on product details page when activate customfileds with price. "Call to undefined method VirtueMartModelCustomfields::_getCustomPrice()".


This is quite likely an outdated template. The function was set to deprecated a year ago (Revision 9639). I must admit this template change slipped through. 

It was

$price = VirtueMartModelCustomfields::_getCustomPrice($productCustom->customfield_price, $currency, $calculator);


and is now

$price = VirtueMartModelCustomfields::renderCustomfieldPrice($productCustom, $product, $calculator);
Title: Re: Getting "1054 Unknown column 'STsameAsBT' in 'field list'...
Post by: Leila on September 20, 2018, 11:24:23 AM
Milbo, thank you very much for help. The problem is solved. Will you help me with another similar question? When I save product in backend I have error " Unknown column 'product_canon_category_id' in 'field list'"
Now I understand that I have to add some data to DB, but i dont know where exactly.
Title: Re: Getting "1054 Unknown column 'STsameAsBT' in 'field list'...
Post by: Milbo on September 20, 2018, 11:39:03 AM
It seems to be the same problem. The table updater is not executed. You should first try todo that manually. Maybe  set your page offline for that time. Maybe you have a lot visitors, so that the db is not properly updated? I dont know, I can just guess.

Please check  http://docs.virtuemart.net/manual/tools-menu/70-tools-migration.html and use "INSTALL TABLES OR IF NECESSARY UPDATE THEM"
Title: Re: Getting "1054 Unknown column 'STsameAsBT' in 'field list'...
Post by: Leila on September 20, 2018, 12:32:22 PM
Thank you! Now everything works fine!  :)
Title: Re: Getting "1054 Unknown column 'STsameAsBT' in 'field list'...
Post by: JDmpdx on September 20, 2018, 19:41:07 PM
Yep, that error is no longer present after running the database tool. Thanks!  I believe I have one further issue, but it appears unrelated, so I'll post a sseparate topic, as the fix here seemed to fix things for everyone.
Title: Re: Getting "1054 Unknown column 'STsameAsBT' in 'field list'...
Post by: AH on September 21, 2018, 09:45:52 AM
See above for solution
Title: Re: Getting "1054 Unknown column 'STsameAsBT' in 'field list'...
Post by: Milbo on September 24, 2018, 22:26:28 PM
Quote from: Milbo on September 20, 2018, 11:00:44 AM
This is quite likely an outdated template. The function was set to deprecated a year ago (Revision 9639). I must admit this template change slipped through. 

It was

$price = VirtueMartModelCustomfields::_getCustomPrice($productCustom->customfield_price, $currency, $calculator);


and is now

$price = VirtueMartModelCustomfields::renderCustomfieldPrice($productCustom, $product, $calculator);


This function will be readded in the next release, coming the next days. We also found the reason that the updater did not update the tables properly.