VirtueMart Forum

VirtueMart 2 + 3 + 4 => Plugins: Payment, Shipment and others => Topic started by: michal123 on February 12, 2015, 13:25:17 PM

Title: error 1075 while saving payment and shipment method
Post by: michal123 on February 12, 2015, 13:25:17 PM
Hello, i have problem with vm. When i'll try to save payment and shipment method there's an error.

Shipment method:

1075 Incorrect table definition; there can be only one auto column and it must be defined as a key SQL=CREATE TABLE IF NOT EXISTS `abc_virtuemart_shipment_plg_weight_countries` ( `id` int(1) UNSIGNED NOT NULL AUTO_INCREMENT, `virtuemart_order_id` int(11) UNSIGNED, `order_number` char(32), `virtuemart_shipmentmethod_id` mediumint(1) UNSIGNED, `shipment_name` varchar(5000), `order_weight` decimal(10,4), `shipment_weight_unit` char(3) DEFAULT 'KG', `shipment_cost` decimal(10,2), `shipment_package_fee` decimal(10,2), `tax_id` smallint(1), `created_on` datetime NOT NULL default '0000-00-00 00:00:00', `created_by` int(11) NOT NULL DEFAULT '0', `modified_on` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `modified_by` int(11) NOT NULL DEFAULT '0', `locked_on` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `locked_by` int(11) NOT NULL DEFAULT '0') ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

Payment method:

1075 Incorrect table definition; there can be only one auto column and it must be defined as a key SQL=CREATE TABLE IF NOT EXISTS `abc_virtuemart_payment_plg_standard` ( `id` int(1) UNSIGNED NOT NULL AUTO_INCREMENT, `virtuemart_order_id` int(1) UNSIGNED, `order_number` char(64), `virtuemart_paymentmethod_id` mediumint(1) UNSIGNED, `payment_name` varchar(5000), `payment_order_total` decimal(15,5) NOT NULL DEFAULT '0.00000', `payment_currency` char(3), `email_currency` char(3), `cost_per_transaction` decimal(10,2), `cost_percent_total` decimal(10,2), `tax_id` smallint(1), `created_on` datetime NOT NULL default '0000-00-00 00:00:00', `created_by` int(11) NOT NULL DEFAULT '0', `modified_on` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `modified_by` int(11) NOT NULL DEFAULT '0', `locked_on` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `locked_by` int(11) NOT NULL DEFAULT '0') ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

I have updated VM from 3.0.3 to 3.0.4 but nothing.
Joomla 3.3.6
Php 5.3.29

Please help
Title: Re: error 1075 while saving payment and shipment method
Post by: unaiestefania on February 21, 2015, 21:21:14 PM

Hi , I 'm the same , you know Any solution?

Title: Re: error 1075 while saving payment and shipment method
Post by: jenkinhill on February 21, 2015, 23:33:48 PM
Have you tried the "Install or if necessary update tables" tool?
Title: Re: error 1075 while saving payment and shipment method
Post by: unai on February 22, 2015, 22:25:02 PM
Hello , I tested the tool "Install tables or if necessary update them" and I still get the same error.
joomla 3.3.6
virtuemart 3.0.4
php 4.2.13.1
Title: Re: error 1075 while saving payment and shipment method
Post by: GJC Web Design on February 22, 2015, 23:26:41 PM
Very odd - in your paste above the   ---  PRIMARY  KEY (id)  ---  is missing causing the failure

but that query comes from administrator\components\com_virtuemart\plugins\vmplugin.php func createTableSQL

in both 3.0.4 & 3.0.6 the PRIMARY KEY (id)  is there (and of course always has been)

protected function createTableSQL ($tableComment,$tablesFields=0) {

$query = "CREATE TABLE IF NOT EXISTS `" . $this->_tablename . "` (";
if(!empty($tablesFields)){
foreach ($tablesFields as $fieldname => $fieldtype) {
$query .= '`' . $fieldname . '` ' . $fieldtype . " , ";
}
} else {
$SQLfields = $this->getTableSQLFields ();
$loggablefields = $this->getTableSQLLoggablefields ();
foreach ($SQLfields as $fieldname => $fieldtype) {
$query .= '`' . $fieldname . '` ' . $fieldtype . " , ";
}
foreach ($loggablefields as $fieldname => $fieldtype) {
$query .= '`' . $fieldname . '` ' . $fieldtype . ", ";
}
}

$query .= "       PRIMARY KEY (`id`)
    ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COMMENT='" . $tableComment . "' AUTO_INCREMENT=1 ;";
return $query;
}


Title: Re: error 1075 while saving payment and shipment method
Post by: jjk on February 23, 2015, 09:17:02 AM
Quote from: unai on February 22, 2015, 22:25:02 PM
Hello , I tested the tool "Install tables or if necessary update them" and I still get the same error.
joomla 3.3.6
virtuemart 3.0.4
php 4.2.13.1
This type of error might be due to an incomplete installation. You may try to install VM 3.0.6 (com_virtuemart.3.0.6.zip, com_virtuemart.3.0.6_ext_aio.zip and com_tcpdf_1.0.0.zip).
Also note, that your php version is below the Joomla 3.x minimum requirement of php 5.3.10 + (although this probably is not related to your error)
Title: Re: error 1075 while saving payment and shipment method
Post by: GJC Web Design on February 23, 2015, 11:43:28 AM
or if your confident that everything is working as it should except this you can make the tables manually in your DB with the key added to get u up and running

just run

CREATE TABLE IF NOT EXISTS `abc_virtuemart_payment_plg_standard` ( `id` int(1) UNSIGNED NOT NULL AUTO_INCREMENT, `virtuemart_order_id` int(1) UNSIGNED, `order_number` char(64), `virtuemart_paymentmethod_id` mediumint(1) UNSIGNED, `payment_name` varchar(5000), `payment_order_total` decimal(15,5) NOT NULL DEFAULT '0.00000', `payment_currency` char(3), `email_currency` char(3), `cost_per_transaction` decimal(10,2), `cost_percent_total` decimal(10,2), `tax_id` smallint(1), `created_on` datetime NOT NULL default '0000-00-00 00:00:00', `created_by` int(11) NOT NULL DEFAULT '0', `modified_on` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `modified_by` int(11) NOT NULL DEFAULT '0', `locked_on` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `locked_by` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (id) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

with your table prefix obviously .. but you would need to do this for any new VM plugin you want to configure
Title: Re: error 1075 while saving payment and shipment method
Post by: unai on March 12, 2015, 21:25:23 PM
  Hi, I do not quite understand what would be the solution to my problem. I do not think the reason is a wrong installation of virtuemart, virtuemart I upgraded to the latest version several times. My website only has virtuemart not have any article or anything weird installed.
the solution would create the tables by hand? which would be the next steps? Can someone help me?
This problem is giving me a lot of headaches.
Thank You
Title: Re: error 1075 while saving payment and shipment method
Post by: keora on November 22, 2016, 09:55:06 AM
Any step by step solution to this? Could you solve it? If I reset the tables everything is fine. Can't understand why... there a few topics, but no real solution - or at least no solutions people like me can understand. :D
Title: Re: error 1075 while saving payment and shipment method
Post by: GJC Web Design on November 22, 2016, 10:14:55 AM
don't understand what your asking?

QuoteIf I reset the tables everything is fine.

so the problem is?