Plugin limitations - Duplicate entry

How to configure and adapt Aimeos based shops as developer
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
createanet
Posts: 72
Joined: 22 Mar 2021, 16:56

Plugin limitations - Duplicate entry

Post by createanet » 03 Dec 2021, 10:21

Hello,

I notice when trying to create more than once instance of a plugin provider in the admin that it is failing. I thought perhaps this was with my custom plugin provider, but I have tested and confirmed the same with the stock plugins.

Code: Select all

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1.-order-BasketLimits' for key 'unq_msplu_sid_ty_prov':
INSERT INTO "mshop_plugin" (
"type", "label", "provider", "config", "pos",
"status", "mtime", "editor", "siteid", "ctime"
) VALUES (
?, ?, ?, ?, ?, ?, ?, ?, ?, ?
)
I have double checked and run the index/rebuild job in case something was going a miss there, but this unfortunately made no difference.

I am currently working with 2020.10.* release.

The error is coming from MySQL as when I attempt to duplicate the row in the database I receive a similar error.

Code: Select all

Duplicate entry '1.-order-BasketLimits' for key 'unq_msplu_sid_ty_prov'
When I look into the structure I can see there is now a compound index on provider, type & siteid.

Is there a suggestion on how we can reuse a plugin with a different configuration? I dont think decorator fits the use case here.

Thanks,

User avatar
aimeos
Administrator
Posts: 7873
Joined: 01 Jan 1970, 00:00

Re: Plugin limitations - Duplicate entry

Post by aimeos » 05 Dec 2021, 09:30

You can't add the same plugin again. Adapt the existing entry with the BasketLimits plugin instead.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply