SOLVED - I cannot create two custom field of the same type, set the same way

Started by ISOTTA WEB, October 24, 2024, 11:00:07 AM

Previous topic - Next topic

ISOTTA WEB

Hi there,

I'm writing because I cannot create two custom field of the same type, set the same way. I do a research online but I only found posts from 2023.

I'm using Virtuemart 4.2.18 with Joomla 5.2.0

When I set a new customfiled of the same type and set in the same way of an existed one the system gives me back this error:
    vmError: vmTable store insertObject #__virtuemart_customs Duplicate entry 'S-0-1' for key 'f0r61_virtuemart_customs.field_type_searchable_published' INSERT INTO `f0r61_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','prova','','','','addEmpty=0|selectType=0|multiplyPrice=0|transform=\"\"|product_sku=\"\"|product_gtin=\"\"|product_mpn=\"\"|','S','0','0','0','','0','0','','1','0','1','2024-10-22 08:06:07','780','0')
     
Set the same way I mean that I can create a custom field "string" researcheable and one not. Stop.

Can you please help me?

Thank you,
    Diana

Milbo

Usually it is enough to install VirtueMart again, because it should recreate the keys. Or to use the database tools.

You must check your database and check the table f0r61_virtuemart_customs for the key field_type_searchable_published, which should be just a key, in your case it seems to have the "unique" property set.

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

ISOTTA WEB

Hi Milbo,
Many thanks. It's solved.

You were right, the key of field_type_searchable_published was set as unique. I changed it and it works.

Thank you,