categories of products children deleted when parent product saved

Started by ntougouchi, April 24, 2012, 12:27:47 PM

Previous topic - Next topic

ntougouchi

Hello,

I'm on VM2.0.4 : The 2.0.6 version seems to have a lot of bugs (cf this forum) and auto-update go in time out (2 reasons to preserve 2.0.4 !)
All other problems encoured have been repaired with custom hacks in CSS or in PHP code.

My new (and last?!?) problem is with children products.
I've created 1 parent product, with 9 children products.
My parent has categories (main categories) and children have a specific category (collection).
No problem with this, when shoppers search by "main categories", they find the parent, and when they search by "collection", they find children.
BUT ..
When I edit the parent product and save it (even without modification), all categories for all children of tjis product are deleted.

When I comment :
/administrator/components/com_virtuemart/models/product.php line 1059
$data = $this->updateXrefAndChildTables($data,'product_categories');

No modifcations are saved for all categories.. so I suppose it is near this line the problem occurs..
I think there is a loop anywhere wich delete children categories..

Thanks in advance !




ntougouchi

Hehe..

It seems to be a real beautiful bug !
The problem is so easy... on the parent product page, we can create or change immediatly children products.
This process is very poor, it save only data they are displayed : name, published or not, price... but not description, categories, etc..
95% of children data are cleared, because only 5% are shown in product parent form.

I found a dirty issue for this problem : Disable functionnality (a child can also be created on product list page)

To do this :
/administrator/components/com_virtuemart/models/product.php LINE 1090
- comment   $this->store($child);


/administrator/components/com_virtuemart/views/product/tmpl/product_edit_information.php  LINE 285 :
- delete "<a href" link, to avoid to creat new child by this damned page !
- you can delete the children "input type text" too


I hope this functionnality will be correct in future..