VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: m.davide82 on October 14, 2021, 14:16:28 PM

Title: Problem creating a new product
Post by: m.davide82 on October 14, 2021, 14:16:28 PM
Hi,

after the upgrade to VirtueMart 3.8.9 Eagle owl 10514, when I insert a product, the form that opens is like a "modify product form" of a product, instead of a blank form to create a new product.

PHP 7.4.22
Mysql 5.5.5-10.3.27-MariaDB

How can I solve this problem?


Thanks in advance.
Davide
Title: Re: Problem creating a new product
Post by: Jörgen on October 14, 2021, 14:26:44 PM
?? Screenshot would be helpful

Jörgen @ Kreativ Fotografi
Title: Re: Problem creating a new product
Post by: m.davide82 on October 14, 2021, 14:32:56 PM
Hi Jorgen,

sure, you have it in attachment, thanks.
This is what I see when I create a new product.

Regards,
Davide
Title: Re: Problem creating a new product
Post by: Jörgen on October 14, 2021, 15:29:06 PM
Are you doing this with the new admin template ?
Switch to the old one in that case and see.

Jörgen @ Kreativ Fotografi
Title: Re: Problem creating a new product
Post by: GJC Web Design on October 14, 2021, 19:19:54 PM
or some heavy caching somewhere?
Title: Re: Problem creating a new product
Post by: m.davide82 on October 15, 2021, 10:09:36 AM
Hi to everybody!

Just disabled the VM Admin Template and the problem persists.
The same for the New Admin Theme.

Cache? It's disabled...

Thanks in advance.

Davide
Title: Re: Problem creating a new product
Post by: GJC Web Design on October 15, 2021, 11:13:20 AM
try a different browser to eliminate browser caching?
Title: Re: Problem creating a new product
Post by: m.davide82 on October 15, 2021, 16:12:10 PM
Hi,

just tried with different browsers and different pc/mac, but the problem persists...

Thanks.
Davide
Title: Re: Problem creating a new product
Post by: GJC Web Design on October 15, 2021, 22:26:07 PM
So what your saying is when u click "New" the product edit form opens but the fields are prefilled?
Always the same product detail?
What is the url?
Does this particular product exist in your shop?
If not is it in your DB?
Under virtuemart_product_id 0 perhaps?
Title: Re: Problem creating a new product
Post by: m.davide82 on October 18, 2021, 15:48:07 PM
Hi,

I'm answering to all your questions:
1. Yes, when I click on "New product" the fields are prefilled with this product.
2. Yes.
3. This: /administrator/index.php?option=com_virtuemart&view=product
4. Yes, it exists.
5. It exists.
6. The virtuemart_product_id is 7855

Thanks.
Davide
Title: Re: Problem creating a new product
Post by: Jörgen on October 18, 2021, 19:43:58 PM
The new Id is 7855, yes ?
But data comes from id = 0 right.
Delete product with Id =0.
Jörgen
Title: Re: Problem creating a new product
Post by: GJC Web Design on October 18, 2021, 22:14:12 PM
as Jörgen says .. check if u have a product in the tables with virtuemart_poduct_id = 0 .. if so delete it
Title: Re: Problem creating a new product
Post by: m.davide82 on October 20, 2021, 09:08:02 AM
Hi,

the problem is that I haven't a product with virtuemart_product_id = 0
It starts from 4.

Thank,
Davide
Title: Re: Problem creating a new product
Post by: pinochico on October 20, 2021, 09:36:52 AM
QuoteI haven't a product with virtuemart_product_id = 0

in all language?
Title: Re: Problem creating a new product
Post by: m.davide82 on October 20, 2021, 11:59:24 AM
Hi pinochico,

yes, just checked ann the 3 tables:
products
products_it
products_en

Same problem in the backend in all languages.

Thanks.
Davide
Title: Re: Problem creating a new product
Post by: Jörgen on October 20, 2021, 12:16:26 PM
You have more product related tables custom fields, prices etc. Have You checked these?

What is the highest index in Your product table ?


Jörgen
Title: Re: Problem creating a new product
Post by: m.davide82 on October 20, 2021, 12:46:16 PM
Hi,

did some tests and the situation is very strage.

I imported a new test product via ROCSVI and when I click on new, the product creation is always from the latest product inserted.

I'm very worried...


Thanks.
Davide
Title: Re: Problem creating a new product
Post by: Jörgen on October 20, 2021, 13:04:53 PM
The sql table has an index that is autoincremented ? what is the autoincrement value ? Is it one to low ?

Jörgen
Title: Re: Problem creating a new product
Post by: GJC Web Design on October 20, 2021, 14:57:18 PM
See how declaring ALL info would have helped you and stopped us wasting our time?

no where did u mention that you are importing products via a 3rd party ext. 
It is fairly obvious then that the import is not correct....
Title: Re: Problem creating a new product
Post by: m.davide82 on October 20, 2021, 16:18:54 PM
Hi GJC,

I told you everything, I wrote the situation.
But this morning I had to have a solution to create some products and I decided to do this creation with the importer, nothing else.

@Jorgen
Yes, from 4 to 10240.

Thanks.
Davide
Title: Re: Problem creating a new product
Post by: Jörgen on October 20, 2021, 16:49:26 PM
You can not create a new product with Id 7855 IF you have more than 10000 occupied indexes. You overwrite old products. Why has this happened? I Guess a wrongly applied products import or some Broken and not completed products update. Check your phpmyadmin and set a correct next autoincrement index. I already told You in my previous post to check the autoincrement indexes, have You done that ?

Good luck

Jörgen
Title: Re: Problem creating a new product
Post by: m.davide82 on October 21, 2021, 16:53:47 PM
Hi Jorgen,

I know!  :)

No, I NEVER did an import before lastday... so I don't know how this problem was created.
In mysql, the next autoincrement works.

Thanks.
Davide
Title: Re: Problem creating a new product
Post by: Jörgen on October 21, 2021, 16:55:27 PM
How can You have index 7855 Then ?
Jörgen
Title: Re: Problem creating a new product
Post by: m.davide82 on October 21, 2021, 17:26:17 PM
Hi Jorgen,

this is a beautiful question...
I'm sorry, but I don't know....

Probably an update of Virtuemart?


Thanks.
Davide
Title: Re: Problem creating a new product
Post by: GJC Web Design on October 21, 2021, 17:28:07 PM
VM updates do not alter any table entries
Title: Re: Problem creating a new product
Post by: Jörgen on October 21, 2021, 18:57:00 PM
If Your autoincrement points to one past the last of your table. I am out of guesses.

Jörgen
Title: Re: Problem creating a new product
Post by: m.davide82 on October 22, 2021, 11:04:56 AM
Hi,

In attachment you find the table structure...
Thanks,
Davide
Title: Re: Problem creating a new product
Post by: Jörgen on October 22, 2021, 11:24:23 AM
This tells us nothing about the issue.

You have to check under Operations for this table. There you will see and can also set the actual Autoincrement value.

Jörgen @ Kreativ Fotografi
Title: Re: Problem creating a new product
Post by: m.davide82 on October 22, 2021, 11:55:52 AM
Hi,

the last ID is 10216 in the products table, so in the operation is 10217.
In attachment the screenshot.

Thanks.
Davide
Title: Re: Problem creating a new product
Post by: Jörgen on October 22, 2021, 12:24:55 PM
OK, when Do you get product id 7855 ?

Where does this come from ?

Was it perhaps the last product You edited before you med a new product ?

Can this be some autofill that comes from Your web browser ? Browser cache issue perhaps ?

Jörgen @ Kreativ Fotografi
Title: Re: Problem creating a new product
Post by: m.davide82 on October 22, 2021, 12:53:19 PM
Hi Jorgen,

I did a copy of the website, I updated VM and the info I'm saying to you are from the copy of the website.
In the new copy, the product that always appears when I create a product is the 10216.

No browser cache, I tested in various browser, incognito and various computers.

I'm going crazy!


Thanks,
Davide
Title: Re: Problem creating a new product
Post by: Jörgen on October 22, 2021, 13:21:18 PM
What language do you use ? Is italian default?
If You change back end language, still the same id ?

Jörgen
Title: Re: Problem creating a new product
Post by: m.davide82 on October 22, 2021, 14:57:38 PM
Hi,

Yes, italian default and english secondary.
If I change the backend language, when I click on new, I get always the same ID.

Thanks.
Davide
Title: Re: Problem creating a new product
Post by: Jörgen on October 22, 2021, 17:55:08 PM
Increase the autoincrement value with 5 f.e and see what happens.

If You do not save the product, no harm done.

Jörgen
Title: Re: Problem creating a new product
Post by: m.davide82 on October 22, 2021, 19:29:39 PM
Hi Jorgen,

I just did it but I always see the same product when creating a new one... :'(

Thanks,
Davide
Title: Re: Problem creating a new product
Post by: GJC Web Design on October 22, 2021, 22:20:00 PM
You need to debug what is happening at the product model level... why is the form filling and what queries are being made etc...
Title: Re: Problem creating a new product
Post by: Milbo on October 25, 2021, 22:18:25 PM
I think you should update to this version https://dev.virtuemart.net/attachments/1287/com_virtuemart.3.8.9.10544_package_or_extract.zip FIRST!

Somehow that reminds me to a bug, maybe it is fixed already. If not,... the problem is not the index of the table, or something like that. The problem is not storing. I am sure, when he changes the virtuemart_product_id in the form and URL to 0 it will create a new product.

The problem is the loading. He opens a product edit with id=0 and gets the data of id =X and there is the error. But as I said, please use first the most recent version. Thank you.
Title: Re: Problem creating a new product
Post by: m.davide82 on October 26, 2021, 18:23:58 PM
Hi Milbo,

thank you very much.
I did it, but I didn't solved.
I updated to the latest version too, but nothing.

Any idea on how can I solve it?
Thanks a lot.


Regards,
Davide
Title: Re: Problem creating a new product
Post by: Milbo on October 28, 2021, 00:45:06 AM
Buy a bronze membership https://extensions.virtuemart.net/support/virtuemart-supporter-membership-bronze-detail

and write a ticket to me at https://extensions.virtuemart.net/ticket
Title: Re: Problem creating a new product
Post by: m.davide82 on October 28, 2021, 10:33:22 AM
Hi Milbo,

just did it, thanks.


Regards,
Davide
Title: Re: Problem creating a new product
Post by: Studio 42 on November 01, 2021, 12:43:28 PM
Do you hecked your .haccess rules ?
If you cache the PHP/HTML files in admin, thee you can have this issue.
If you use cloudflare or other server caching system then you can have this issue.
Check in the product edit form if this ID is set to 7855
Try to use a link with a non existing ID
For eg
administrator/index.php?option=com_virtuemart&view=product&task=edit&virtuemart_product_id=100000
OR administrator/index.php?option=com_virtuemart&view=product&task=edit&cache=29102021And check if the form is empty.