VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: ocram44 on February 27, 2025, 18:27:21 PM

Title: Error inserting new order: vmTable store insertObject
Post by: ocram44 on February 27, 2025, 18:27:21 PM
When storing a new order this error occurs:

"vmTable store insertObject"

The details about the error when debugging are as follows:
mysqli_sql_exception: Out of range value for column 'virtuemart_calc_id' at row 1
It tries to store the id -1 in the table 'jos_virtuemart_order_calc_rules'.

Someone can help?

Virtuemart Version: 4.4.6 11109
Joomla Version: 5.2.3
PHP Version: 8.3
Title: Re: Error inserting new order: vmTable store insertObject
Post by: p.barg on February 28, 2025, 09:18:03 AM
Hello,

I've had that problem too. In my case the culprit was a payment method that had no tax rule selected. After setting
the tax field to "default", the problem was gone.

Hope that helps,

Petra
Title: Re: Error inserting new order: vmTable store insertObject
Post by: ocram44 on March 04, 2025, 21:02:37 PM
Hi,
Thanks Petra.
My Payment Tax field shows this value: "Apply default rules".
Unfortunately the error persists.
Title: Re: Error inserting new order: vmTable store insertObject
Post by: p.barg on March 05, 2025, 10:18:49 AM
Hi,
you may also want to check the taxes in shipping rules.
If you check the log file, you may find some more detailed information about the sql error.

Petra
Title: Re: Error inserting new order: vmTable store insertObject
Post by: ocram44 on March 14, 2025, 12:11:55 PM
Hi,
Since I don't need VAT tax on the products there were no "taxes and calculation rules". IT worked until now like that, but it seems that I need to specify at least on VAT tax calculation rule with the new version. So I did just specify a 0% Tax Rule and now it works.
Thanks for your help.
Title: Re: Error inserting new order: vmTable store insertObject
Post by: Milbo on May 16, 2025, 21:29:36 PM
That is really a funny, strange hack to solve this problem. But great way. I wonder what means "until now". What changed? did you update your joomla, or just virtuemart?

Ahh moment. I just see. Yes. Just Virtuemart. It looks like that the tableupdater did not update your __virtuemart_order_calc_rules table. The columns virtuemart_calc_id must not have "unsigned", just normal int.
The -1 is used if it tries to set a "mixed" rule. So it should also work to set in the config the "Simplified VAT for shipping".