HI,
I'm trying to create some custom fields. I can only create the first "string" field. If I try to create a second string field this error appears:
vmError: vmTable store insertObject #__virtuemart_customs Duplicate entry 'S-0-1' for key 'field_type_searchable_published' INSERT INTO `jos9z_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`,`locked_by`) VALUES ('0','0','1','0','0','0','sefggef','','','','addEmpty=0|selectType=0|multiplyPrice=0|transform=\"\"|product_sku=\"\"|product_gtin=\"\"|product_mpn=\"\"|','S','0','0','0','','0','0','','1','0','1','2023-03-04 22:17:47','424','0')
The same problem exists also with the "Properties" and "Boolean" fields.
Joomla 4.2.8
VirtueMart 4.0.12 10777
Lo stesso problema c'è anche con i campi "Proprietà" e "Boleano"
I think the name of post have to cannot create more then one custom field of the same name...
But you send there no info about how you create customfield :)
Where is picture?
Virtuemart - Custom Fields - New - String
Seems like is related with the index of the table #__virtuemart_customs with the name: 'field_type_searchable_published'
I suppose that it is a unique index in your case.
Use your phpMyAdmin to go to that table's structure and either delete that index or remove it's unique attribute.
Btw. In my database and under VirtueMart 4.0.12 10777 this index is not unique
What exactly should I do?
Being a new installation, is it to be considered a bug of virtuemart?
the keys in the install.sql for 4.0.12 10777 are
PRIMARY KEY (`virtuemart_custom_id`),
KEY `field_type_searchable_published` (`field_type`, `searchable`, `published`),
KEY `custom_parent_id` (`custom_parent_id`),
KEY `virtuemart_vendor_id` (`virtuemart_vendor_id`),
KEY `custom_element` (`custom_element`),
KEY `field_type` (`field_type`),
KEY `is_cart_attribute` (`is_cart_attribute`),
KEY `is_input` (`is_input`),
KEY `searchable` (`searchable`),
KEY `shared` (`shared`),
KEY `published` (`published`),
KEY `ordering` (`ordering`)
So I wonder where your Unique came from?
@GJC it was a core problem. See: https://forum.virtuemart.net/index.php?topic=148315.0
@davidex2 As said: Use your phpMyAdmin to go to that table's structure and either delete that index or remove it's unique attribute.
I took a screenshot of the table.
Do I have to modify the field_type_searchable_published line and instead of unique do I have to put index?
Thanks