[SOLVED] vm208e: database error when copy (clone) product with custom plugin

Started by CE WebDesign München, July 17, 2012, 18:06:20 PM

Previous topic - Next topic

CE WebDesign München

hi,

thanks a lot for adding copying of custom fields, that's really timesaving, great!
now just one issue:
since 208d I get this error when copying product with custom plugin for vm (NetBase VM-Youtube Plugin)

it works, when i manually add the missing database-fields to gvd0t_virtuemart_products_en_gb

sorry for having to ask this here (got no feedback from NetBase):

is it ok to fix it like this, or will it cause trouble sometime ahead?

and is the plugin not ready for vm208e or buggy or will vm insert these custom-plugin-fields in future?

thanks again for helping, maybe this is usefull for 3party-developer too
(a short yes or no will do, just so i know if i wait with updating the lifesite)


here is the error:
vmError: VmTableData::store failed - Unknown column 'custom_nbyoutube_title' in 'field list' SQL=INSERT INTO `gvd0t_virtuemart_products_en_gb` (`virtuemart_product_id`,`product_name`,`product_s_desc`,`product_desc`,`metadesc`,`metakey`,`customtitle`,`slug`,`id`,`custom_nbyoutube_title`,`custom_nbyoutube_url`,`custom_nbyoutube_width`,`custom_nbyoutube_height`,`created_on`,`created_by`,`modified_on`,`modified_by`,`locked_on`,`locked_by`) VALUES ( .....
CE WebDesign München: https://ce-webdesign.de | Websites, eCommerce WebShops | Responsive Design | SEO

Milbo

I had also one time a problem cloning a product, but I was not able to reproduce it.

So you say it is connected to the customplugins, good to have a grib. I dont know if it is the plugin or the core. Maybe the developer write a pm to me.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

CE WebDesign München

yes, i can clone products without that plugin.
i could pm you the plugin if you like, for a closer look (very small, but cant attach, its commercial)
or here is the link: http://www.cms-extensions.net/netbase-youtube-for-virtuermart-plugin.html

do you see a problem adding the databasefields to virtuemart_products_en_gb manually?

kind regards and greetings
CE WebDesign München: https://ce-webdesign.de | Websites, eCommerce WebShops | Responsive Design | SEO

bluesheep

Hallo milbo
Mit dem mitgelieferten VM CustomFields PlugIn erscheint der Fehler ebenfalls.
The error appears also with the original VM CustomFields PlugIn.

cya
bluesheep

bluesheep

Ich habe das Problem evtl. Gelöst: in der Datei administrator/component/com_virtuemart/models/product.php in Zeile 1404 muss man
$product = $this->getProduct($id, FALSE, TRUE, FALSE);
in
$product = $this->getProduct($id);
wechseln.

@Milbo: Kannst Du das so Bestätigen?

I have found a solution for the problem: in file administrator/component/com_virtuemart/models/product.php at row 1404 you must change
$product = $this->getProduct($id, FALSE, TRUE, FALSE);
to
$product = $this->getProduct($id);

@Milbo: Can you confirm that?

cya
bluesheep

bubster

I have the same problem with VMCALCULATION_VMISTRAXX_QUANTITY plugin.

When i try to clone a product with the plugin enabled I get a database error:

vmError: VmTableData::store failed - Unknown column 'id' in 'field list' SQL=INSERT INTO `n57vi_virtuemart_products_en_gb` (`virtuemart_product_id`,`product_name`,`product_s_desc`,`product_desc`,`metadesc`,`metakey`,`customtitle`,`slug`,`id`,`created_on`,`created_by`,`modified_on`,`modified_by`,`locked_on`,`locked_by`)

As I understand Virtuemart is attempting to write data for;

'created_on`,`created_by`,`modified_on`,`modified_by`,`locked_on`,`locked_by`

These columns do not exist in virtuemart_products.

When I disable Istraxx quantity plugin, products can be cloned.

I have applied the solution above but this doesn't fix the clone problem.


CE WebDesign München

hm, maybe a solution would be,

if vm stores the custom-plugin-entries for the clone with its new id,
where it takes the copied data from -

the table where all needed columns already exist
and the origin data comes from? (sorry, absolute beginner concerning databases)
CE WebDesign München: https://ce-webdesign.de | Websites, eCommerce WebShops | Responsive Design | SEO

Milbo

This is strange


getProduct ($virtuemart_product_id = NULL, $front = TRUE, $withCalc = TRUE, $onlyPublished = TRUE)


we use line 1410

$product = $this->getProduct($id, FALSE, TRUE, FALSE);

$withCalc is in both cases true and I think onlyPublished should be ignored, so it should be FALSE.

So the error is in $front= FALSE

So I think the best is

$product = $this->getProduct($id, TRUE, TRUE, FALSE);
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

CE WebDesign München

hm, for me it is line 1411 (vm208e, opened with notepad++)

tested:    TRUE TRUE FALSE, TRUE FALSE FALSE, FALSE FALSE FALSE
and just:    $product = $this->getProduct($id);

still same error as in post on top
probably special in my case because of custom plugin
CE WebDesign München: https://ce-webdesign.de | Websites, eCommerce WebShops | Responsive Design | SEO

bluesheep

This work for me on 2.0.8C:
$product = $this->getProduct($id, TRUE, TRUE, FALSE);

bubster

Hi

Tested:
TRUE TRUE FALSE, TRUE FALSE FALSE, FALSE FALSE FALSE
$product = $this->getProduct($id);

Still unable to clone with Istraxx plugin published.

All products attempted to be cloned are published and have no children.


CE WebDesign München

[SOLVED] Hi, it works for me and that youtube plugin now in VM 2.0.14 + J 2.5.8,
no need for database change! THANK YOU!
CE WebDesign München: https://ce-webdesign.de | Websites, eCommerce WebShops | Responsive Design | SEO