VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: hazael on May 04, 2022, 14:00:04 PM

Title: Problem with creating a new vendor and clone customfields[Vm 4]
Post by: hazael on May 04, 2022, 14:00:04 PM
I installed a clean stable version of VM4. There was an immediate problem in editing the store (filling in the seller's details and the store's currency).

vmError: Registration failed: The object must be an array or an object that implements ArrayAccess
vmError: Save failed with the following error: The object must be an array or an object that implements ArrayAccess

I have tried multiple times to fill in all the fields for each tab. Unsuccessfully...


Another problem is the inability to clone custom fields.
Generally, I can add up to 2 custom fields. I get an error when I add any custom field number 3.


"vmError: vmTable store insertObject #__virtuemart_customs Duplicate entry 'S-0-1' for key 'field_type_searchable_published' INSERT INTO `szereg_virtuemart_customs` (`virtuemart_custom_id`,`custom_parent_id`,`virtuemart_vendor_id`,`admin_only`,`custom_jplugin_id`,`custom_element`,`custom_title`,`custom_tip`,`custom_value`,`custom_desc`,`custom_params`,`field_type`,`is_list`,`is_input`,`is_hidden`,`virtuemart_shoppergroup_id`,`is_cart_attribute`,`searchable`,`layout_pos`,`published`,`ordering`,`show_title`,`created_on`,`created_by`) VALUES ('0','0','1','0','0','0','test Copy','','','','addEmpty=0|selectType=0|multiplyPrice=0|transform=\"\"|product_sku=\"\"|product_gtin=\"\"|product_mpn=\"\"|','S','0','0','0','','0','0','','1','0','1','2022-05-04 13:44:30','870')"

VirtueMart 4.0.0 10645
Joomla 4.1.2
PHP: 8.0.18
PHP 7.4.29
Title: Re: Problem with creating a new vendor and clone customfields[Vm 4]
Post by: hazael on May 05, 2022, 13:42:57 PM
I think I found the answer to my problem. on the server in PHP settings I had the "parse_ini_file" function turned off
Title: Re: Problem with creating a new vendor and clone customfields[Vm 4]
Post by: hazael on May 10, 2022, 11:55:26 AM
My problem came up again - exactly the same. Once I removed the custom fields and started adding again.
When I try to add a custom field "string" the database gives me an error:

"Repeated occurrence of 'S-0-1' for key 'field_type_searchable_published'"

INSERT INTO `szeregi_virtuemart_customs` (`virtuemart_custom_id`, `custom_parent_id`, `virtuemart_vendor_id`, `custom_jplugin_id`, `custom_element`, `admin_only`, `custom_title`, `show_title`, `custom_tip`, `custom_value`, `custom_desc`, `field_type`, `is_list`, `is_hidden`, `is_cart_attribute`, `is_input`, `searchable`, `layout_pos`, `custom_params`, `virtuemart_shoppergroup_id`, `shared`, `published`, `created_on`, `created_by`, `ordering`, `modified_on`, `modified_by`, `locked_on`, `locked_by`) VALUES (NULL, '0', '1', '0', '0', '0', 'Rodzaj zabudowy', '1', '', '', '', 'S', '0', '0', '0', '0', '0', '', 'addEmpty=0|selectType=0|multiplyPrice=0|transform=\"\"|product_sku=\"\"|product_gtin=\"\"|product_mpn=\"\"|', '', '0', '1', '2022-05-10 09:19:15', '218', '0', NULL, '0', NULL, '0')

If I change "field_type: S" to a different letter, the field is saved in the database.
Title: Re: Problem with creating a new vendor and clone customfields[Vm 4]
Post by: pinochico on May 10, 2022, 11:56:35 AM
php8?
I don't think so if really function....
Title: Re: Problem with creating a new vendor and clone customfields[Vm 4]
Post by: hazael on May 10, 2022, 11:57:57 AM
I tested on php7 and php8 - it works similar.
Database: MariaDB 10.1.48

I have VM4 installed on the latest Joomla 3 and 4. Both versions are also reporting this error to me.
Title: Re: Problem with creating a new vendor and clone customfields[Vm 4]
Post by: pinochico on May 10, 2022, 11:59:11 AM
ok,
I don't try VM4 version not yet, because now we upgrade for J4 others extensions and waiting for info from JED
Title: Re: Problem with creating a new vendor and clone customfields[Vm 4]
Post by: hotrod on May 10, 2022, 13:12:10 PM
 I have the same Issue...   Guess I'll be stepping back to VM 3 and starting over..
Title: Re: Problem with creating a new vendor and clone customfields[Vm 4]
Post by: hazael on May 10, 2022, 13:39:20 PM
It's strange ... After an hour the problem disappears by itself ... After a while it reappears. As if some old references are being kept in the server's memory. :-/
Title: Re: Problem with creating a new vendor and clone customfields[Vm 4]
Post by: Jörgen on May 10, 2022, 16:10:58 PM
Turn off cache, Joomla plugins, server cache etc
Jörgen
Title: Re: Problem with creating a new vendor and clone customfields[Vm 4]
Post by: hazael on May 12, 2022, 14:01:39 PM
This is some weird problem that has never been seen on the same server in previous versions before.
This error keeps showing up even when I try to add a similar record in the phpMyAdmin console.
I pasted a copy of the database tables (#_virtuemart_customs ) from the older VM version, I added missing line "virtuemart_shoppergroup_id" and the problem is gone.

The only difference in these tables is the "Subtitle Comparison Method". Was utf8_general_ci and it is utf8mb4_unicode_ci




Title: Re: Problem with creating a new vendor and clone customfields[Vm 4]
Post by: Studio 42 on May 12, 2022, 21:00:02 PM
"Repeated occurrence of 'S-0-1' for key 'field_type_searchable_published'"
I think  this is something about a table KEY ?
Title: Re: Problem with creating a new vendor and clone customfields[Vm 4]
Post by: balai on June 23, 2022, 14:53:00 PM
It is a wrong key
UNIQUE KEY field_type_searchable_published  (`field_type`, `searchable`, `published`),

Obviously this key cannot be unique since the mentioned fields combination can be repeated several times.
Title: Re: Problem with creating a new vendor and clone customfields[Vm 4]
Post by: Jumbo! on June 23, 2022, 15:28:01 PM
It can be a regular key which can be used for indexation. But it can not be a unique key.
Title: Re: Problem with creating a new vendor and clone customfields[Vm 4]
Post by: Milbo on June 27, 2022, 10:09:23 AM
ehrm, and no one tells me. Luckily I found it, replaced the UNIQUE against KEY