VirtueMart Forum

VirtueMart 2 + 3 + 4 => Administration & Configuration => Topic started by: melsonmarketing on August 30, 2019, 15:30:27 PM

Title: Products kicked out of category on save
Post by: melsonmarketing on August 30, 2019, 15:30:27 PM
J! 3.9.11
VM 3.6
Php 7.2.18

Hi everybody I have a problem at https://www.deko-gama.de/

The Shop was on VM 3.4.2 and suddenly the categorypicker in the productview didn't work anymore.

So we thought it was a good idea to update everything. But unfortunately the problem remains.

Opening an existing product the categoryfield is empty though the category is choosen. Saving the product after edition deletes the category-assignment. That means for the moment, that we have to assign products back to their category using "Bulk Associate".

Has anyone had this before and is able to help here?

Thanks in advance
Michael
Title: Re: Products kicked out of category on save
Post by: GJC Web Design on August 30, 2019, 15:46:13 PM
If the cat dropdown is empty then u have a problem populating it by ajax

check the JS ajax console for corrupted returned json ( notices etc in the json)  or even that the json is correctly returned .. not an error etc

the product is removed from cats as the post when u save is empty/0 for the category id
Title: Re: Products kicked out of category on save
Post by: Milbo on September 06, 2019, 20:00:39 PM
But actually, even when the js breaks, the categories should be kept. When the ajax does not load the category tree, the value is -1 or something like that and should not executed storing of the category relation.
Title: Re: Products kicked out of category on save
Post by: Jörgen on September 06, 2019, 20:40:05 PM
Sorry to disagree, I saw a similar issue some versions ago where the js did not load the categories on product edit. If You are changing price or some other detail, you will just not notice that the categories for the product are not loaded so you make a save. Viola, the categories are gone. This was over a year ago, I believe, I can not remember all the details, just that it was very annoying and that it was quickly solved at the time. It could have been a clash with JCE text editor, not sure.

Jörgen @ Kreativ Fotografi
Title: Re: Products kicked out of category on save
Post by: AH on September 07, 2019, 12:21:43 PM
I thought this was solved - I reported ages ago and Milbo did the fix to not save categories on failed category load

I will test - but assume it is working as I have not had issues since the fix
Title: Re: Products kicked out of category on save
Post by: Milbo on September 09, 2019, 08:32:38 AM
Quote from: Jörgen on September 06, 2019, 20:40:05 PM
This was over a year ago,

Exactly a year ago. I worked on that problem two times. vm3.6.0 got tested against this problem, as Andrew said.
Title: Re: Products kicked out of category on save
Post by: melsonmarketing on November 22, 2019, 11:56:10 AM
Hi Guys

Thanks for discussing this matter.

I've been caught in other projects the last months.

The client helped himself by  using the mass-assign function after editing products. This is working but absolutely NOT comfortable :-(

In the meantime we made all updates and checked / disabled third party plugins etc.

We have the following situation:

J! 3.9.13
VM 3.6.8 10197

Editing products:
Product-information Tab

- Manufacturer Dropdown is working
- Category Dropdown is not working AND on save the product is deleted from current category
- Dropdown for the buyergroup is working

Product images Tab

- Can't delete assigned images

Thank you for any help and tipps
Title: Re: Products kicked out of category on save
Post by: jenkinhill on November 22, 2019, 12:32:29 PM
I fixed a similar problem for a client simply using the "Install or if necessary update tables" tool.  Obviously, test on a copy of the live site.
Title: Re: Products kicked out of category on save
Post by: melsonmarketing on November 25, 2019, 09:30:09 AM
Thank you for your tipp jenkinhill - I tried that, unfortunately without success

Updated to 3.6.10 in the meantime - no changes
Title: Re: Products kicked out of category on save
Post by: Studio 42 on November 25, 2019, 19:55:23 PM
The category use JSON, check your XHR tab in google chrome, if you have PHP error reporting and have an error then categories doesn't show.
Title: Re: Products kicked out of category on save
Post by: melsonmarketing on November 26, 2019, 09:03:16 AM
This is the error I found:

Uncaught TypeError: jQuery(...).dynoTable is not a function
    at HTMLDocument.<anonymous> (index.php?option=com_virtuemart&view=product&task=edit&virtuemart_product_id=116:2871)
    at u (jquery.min.js?55933016be521ee82b4c3e3b2ca30436:2)
    at Object.fireWith [as resolveWith] (jquery.min.js?55933016be521ee82b4c3e3b2ca30436:2)
    at Function.ready (jquery.min.js?55933016be521ee82b4c3e3b2ca30436:2)
    at HTMLDocument._ (jquery.min.js?55933016be521ee82b4c3e3b2ca30436:2)
(anonymous) @ index.php?option=com_virtuemart&view=product&task=edit&virtuemart_product_id=116:2871
u @ jquery.min.js?55933016be521ee82b4c3e3b2ca30436:2
fireWith @ jquery.min.js?55933016be521ee82b4c3e3b2ca30436:2
ready @ jquery.min.js?55933016be521ee82b4c3e3b2ca30436:2
_ @ jquery.min.js?55933016be521ee82b4c3e3b2ca30436:2
Title: Re: Products kicked out of category on save
Post by: Milbo on December 03, 2019, 17:41:39 PM
Maybe a file got not correctly copied. Just install vm again.
Title: Re: Products kicked out of category on save
Post by: melsonmarketing on December 09, 2019, 14:03:50 PM
Hi Milbo,

I installed the latest 3.6.10 over the existing - no changes.

Even stranger:

Typing the first 3 letters the field responds with : No results match "Catname"
Title: Re: Products kicked out of category on save
Post by: melsonmarketing on May 05, 2020, 08:47:17 AM
Hi all!

I don't know what I did wrong but I'm a little confused. This topic is still hot for me.
Why am I confused?

I wanted to proceed this post and the warning message says

QuoteWarning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

So I started a new one and pointed to this thread here.

It was removed by Jörgen @ Kreativ Fotografi:

QuoteThe text of the reply is shown below:
Please Do not start a new thread for an ongoing issue.

Hmm...  :-\

Okay, so here I am again:

Meanwhile I'm sure, that it is a VM-problem. It only happens in the backend, using only VM and core-template. There are no vm plugins or extensions in the backend

Joomla! 3.9.18 Stable
Php 7.3.15
MySQL 5.7.29
VM 3.6.10 10211

Debug Info:

1 vmdebug Show All Errors, PHP-Version 7.3.15
2 vmdebug 1 Language, default shoplanguage (VmConfig::$jDefLang): de_de de-DE
3 vmdebug vmTime: time to load config: 0.011167049407959
4 vmdebug vmTime: time to import plugins vmuserfield: 0.000101089477539062
5 vmdebug Start used Ram 2M
6 vmdebug My Memory Limit in Bytes 268435456
7 vmdebug getVendorId manager
8 vmdebug vmTime: "VirtueMartControllerProduct" Finished task product: 0.282629013061523
9 vmdebug End used Ram 12M
10 vmdebug Peak memory peak 12M

Thanks and regards
Michael
Title: Re: Products kicked out of category on save
Post by: Jörgen on May 05, 2020, 09:27:01 AM
Quote from: melsonmarketing on December 09, 2019, 14:03:50 PM
Hi Milbo,

I installed the latest 3.6.10 over the existing - no changes.

Even stranger:

Typing the first 3 letters the field responds with : No results match "Catname"

If You do not have any matching category names the error message is totally correct, please show an image.

Jörgen @ Kreativ Fotografi
Title: Re: Products kicked out of category on save
Post by: AH on May 05, 2020, 09:40:40 AM
Kicked out - is not what I think is happening here

Check the listing of the categories - I think you will find that current categories for the item along with the category drop list is empty!

Therefore on a save - it stores no setting for category.

Check console and see if any js errors or php errors

A fix was made to stop this happening i.e dont store "blank categories" if the category listing has failed to load.

Title: Re: Products kicked out of category on save
Post by: GJC Web Design on May 05, 2020, 09:43:05 AM
have u gone through this post step by step trying the suggestions?
http://forum.virtuemart.net/index.php?topic=144464.0
Title: Re: Products kicked out of category on save
Post by: melsonmarketing on May 05, 2020, 10:18:57 AM
Thanks for your replies.

I didn't check the thread suggested by GJC Web Design later.

Attached some screenshots that might make it clearer:

Screen1 shows, that the categories are there
Screen2 shows the problem to assign the product to the cat
Screen3 is (a part of) the category overview
Screen4a is a product before changes
Screen4b after saving changes - no category. (wasn't allowed to post)

Title: Re: Products kicked out of category on save
Post by: Jörgen on May 05, 2020, 10:24:57 AM
Screenshots ?

Jörgen @ Kreativ Fotografi
Title: Re: Products kicked out of category on save
Post by: melsonmarketing on May 05, 2020, 10:29:10 AM
Sorry Jörgen - missed to save.
Thanks for your hint
Title: Re: Products kicked out of category on save
Post by: Jörgen on May 05, 2020, 10:50:22 AM
Inconsistent type for the dbase files ? Collation ?

How does the category Kleider look ? Published ?

Jörgen
Title: Re: Products kicked out of category on save
Post by: AH on May 05, 2020, 11:02:46 AM
Looks like it is as I said

There are NO categories loaded on the product page which is the first issue

It looks like you have something in your setup that is causing issues - and GJC noted such things in the related article

One observation:
I reported categories being removed - this was due to the fast save issue and was resolved by the VM team. That issue is no longer causing any problems and has been working for some time.

So that leads to 2 questions:

1 - Why are your categories on the product page not getting loaded - what is your setup that results in this.
2 - Why is VM allowing a product save that is not detecting non loaded categories and thus allowing an "empty" category value to be stored.

Title: Re: Products kicked out of category on save
Post by: Studio 42 on May 06, 2020, 00:25:26 AM
Perhaps PHP max post size problem or something similar?
It's hard to say if you dont have all informations.
Title: Re: Products kicked out of category on save
Post by: GJC Web Design on May 06, 2020, 12:10:07 PM
what do u see when u try the catlist url?

https://yoursite.com/administrator/index.php?option=com_virtuemart&view=product&type=getCategoriesTree&virtuemart_product_id=XXX&format=json&lang=de

should be a clean json representation of the cat options
Title: Re: Products kicked out of category on save
Post by: melsonmarketing on May 08, 2020, 10:01:24 AM
Thank you all.

@ Jörgen: collation is okay and fixed with admintools, all categories in use are published

@ AH: you're right: On product-view level the categories are not being loaded

@ Studio 42: post_max_size is set to 64MB, memory_limit 256 MB - shouldn't be a problem as I have severeal working shops on the same server with the same setup

@ GJC WebDesign: Yep, that's working - try here: https://www.deko-gama.de

The problem occurs only on productview-level. At the moment we can fix it by using the mass assignment to categories function - but this is very frustrating work as it has to be done after each product edit...

Stay safe and have a nice weekend.
Title: Re: Products kicked out of category on save
Post by: GJC Web Design on May 08, 2020, 11:00:18 AM
Quote@ GJC WebDesign: Yep, that's working - try here: https://www.deko-gama.de

we cannot check this as u have to be logged in as an admin

but screenshot what returns
Title: Re: Products kicked out of category on save
Post by: melsonmarketing on May 08, 2020, 11:20:05 AM
Ouch - sorry I missed the admin-part in tzhe URL :-(

But here's a screenshot - looks okay I think
Title: Re: Products kicked out of category on save
Post by: GJC Web Design on May 08, 2020, 11:40:22 AM
yes-- looks fine

be aware that any php notices etc that are returned in the response will break the select .. so do this check on a live edit of a product