1. roderic
  2. RO CSVI
  3. Monday, 17 January 2022
  4.  Subscribe via email
Hello again,

Last week I tweaked the Parent product template made a new child product template to import shoes separately because I want those products to use another Stockable customfield then other products. At first this worked fine, I only did this for 2 brands and then on Friday my client made a change to all shoe brands and then I changed the template once more. This time I did not get it working. I just found out this is because of the 8.2.0 update.

On the test website I was still running 8.1.0 and I ran the Parent product import (without the changes I made on the live site). All Parent products got imported as expected with stockable fields waiting to get filled by the Child template import. I then ran the child import with a smaller test file that contains only 1 or 2 products and it added those child products in the file to the Parent product and left all other products untouched. So far so good.

I then updated to 8.2.0 and ran the same child product. This time it again imported the same child products as before but removed ALL the stockable fields for the other Parent products. This is the same experience I had during hours of testing on Friday. You need to import everything in one import now otherwise it will also mess with products that are NOT in the import file.

If you want to test this, on the test website you can run the Parent Basic import. This will add all the Stockables. Then run "CHILD working" and you will see all Stockables are removed. (I just tested this again and this time I had to run the Child one twice, after 2nd time they were removed. Log attached).

Cheers
Attachments (1)
Accepted Answer
Accepted Answer Pending Moderation
Hello Roderic,
Thank you for the explanation. I was able to reproduce the issue and fix it. I have uploaded a patch file on your test site and see that issue is fixed. Please test the import and let me know on how it goes. I have attached the patch file here in case you want to use it on other sites.
Attachments (1)
Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # Permalink
Accepted Answer Pending Moderation
Hello Roderic,
I then updated to 8.2.0 and ran the same child product. This time it again imported the same child products as before but removed ALL the stockable fields for the other Parent products. This is the same experience I had during hours of testing on Friday. You need to import everything in one import now otherwise it will also mess with products that are NOT in the import file.

I see that you have set Delete custom fields relation to Yes in the template. With this setting existing custom fields linked to the product are deleted and the new custom fields from the file are imported. This also includes stockable custom fields. Also the delete query for this runs based on one product and does not remove it for all the products. See the query from the debug log. We do not include rows of related products and related categories in this delete query and so the where condition for not including virtuemart_custom_id 1 and 2.


DELETE FROM `si1bf8ru_virtuemart_product_customfields` WHERE `virtuemart_product_id` = 15889 AND `virtuemart_custom_id` != 1 AND `virtuemart_custom_id` != 2


If you want to test this, on the test website you can run the Parent Basic import. This will add all the Stockables. Then run "CHILD working" and you will see all Stockables are removed. (I just tested this again and this time I had to run the Child one twice, after 2nd time they were removed. Log attached).

Please post the login details of test site here. You can post them in the Site Details tab under your reply.
Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 1
Accepted Answer Pending Moderation
Hi,

I see that you have set Delete custom fields relation to Yes in the template. With this setting existing custom fields linked to the product are deleted and the new custom fields from the file are imported


Yes, that's fine. It should however only be doing that for the product that's in the import and not for all products.

Also the delete query for this runs based on one product and does not remove it for all the products.


And yet this seems to be the result. I've set Delete customfield relations to No, did the same procedure (PARENT Basic 1x -> CHILD Working 2x) and the same problem occures. So Delete customfield relations is not the problem.

Please post the login details of test site here. You can post them in the Site Details tab under your reply.


It's the same site as before. Details attached.
  1. more than a month ago
  2. RO CSVI
  3. # 2
Accepted Answer Pending Moderation
Hello Roderic,
Thank you for posting the site details. Can you load the attached patch file and run the import? This should not be deleting rows of products which are not in import file.
Attachments (1)
Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 3
Accepted Answer Pending Moderation
Hi,

Thanks for the patch, as far as I can see, there has been no difference in the result after loading the patching.

Log attached of the last import on the screenshot.

log-overview.jpg
Attachments (2)
  1. more than a month ago
  2. RO CSVI
  3. # 4
Accepted Answer Pending Moderation
Hello Roderic,
Do you still see rows deleted from product which are not in import file? The debug log attached has no delete query at all. Is it possible you tell me an example product so i can check the import on your test site?
Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 5
Accepted Answer Pending Moderation
Hello Tharuna,

I am not sure if they are deleted, or just not connected anymore. But every product that has stockable customfields (waiting to be filled by the child product import) after the Parent import, loses these after the 2nd child import.

Example product: Specialized Aethos Pro Frame - 79AFC7D9-C6EA-4DC0-ACF7-B16E24CB0E32
looks like this after Parent import:
aethos1.jpg

That looks normal. Now when I would run the child import with the same file, these stockable customfields would be filled. As I'm only importing one product, these remain empty. Still everything normal. Now when I run that child import twice, they are gone. But not sure if deleted or just ghosting in database. The only product that still has values, is the one product that is in the Product-test.xml file.
Attachments (1)
  1. more than a month ago
  2. RO CSVI
  3. # 6
Accepted Answer Pending Moderation
Hi Tharuna,

Thanks, this seem to have fixed it!
  1. more than a month ago
  2. RO CSVI
  3. # 7
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!