Error saving characteristics attributes

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
jramirezgranada
Posts: 40
Joined: 12 Jul 2018, 19:57

Error saving characteristics attributes

Post by jramirezgranada » 18 Oct 2018, 16:41

Hi there;

When I'm saving a product with multiple attributes with the same attribute type I'm getting this error:

Code: Select all

An exception occurred while executing '\n
\t\t\t\t\t\tSELECT msupli."id" AS "supplier.lists.id", msupli."parentid" AS "supplier.lists.parentid",\n
\t\t\t\t\t\t\tmsupli."siteid" AS "supplier.lists.siteid", msupli."typeid" AS "supplier.lists.typeid",\n
\t\t\t\t\t\t\tmsupli."domain" AS "supplier.lists.domain", msupli."refid" AS "supplier.lists.refid",\n
\t\t\t\t\t\t\tmsupli."start" AS "supplier.lists.datestart", msupli."end" AS "supplier.lists.dateend",\n
\t\t\t\t\t\t\tmsupli."config" AS "supplier.lists.config", msupli."pos" AS "supplier.lists.position",\n
\t\t\t\t\t\t\tmsupli."status" AS "supplier.lists.status", msupli."mtime" AS "supplier.lists.mtime",\n
\t\t\t\t\t\t\tmsupli."editor" AS "supplier.lists.editor", msupli."ctime" AS "supplier.lists.ctime"\n
\t\t\t\t\t\tFROM "mshop_supplier_list" AS msupli\n
\t\t\t\t\t\t\n
\t\t\t\t\t\tWHERE ( msupli."siteid" IN (1) AND ( msupli."refid" IN ('1') AND msupli."domain" = 'product' AND ( msupli."status" = 1 AND ( msupli."start" <= '2018 ▶
\t\t\t\t\t\tGROUP BY msupli."id", msupli."parentid", msupli."siteid", msupli."typeid",\n
\t\t\t\t\t\t\tmsupli."domain", msupli."refid", msupli."start", msupli."end",\n
\t\t\t\t\t\t\tmsupli."config", msupli."pos", msupli."status", msupli."mtime",\n
\t\t\t\t\t\t\tmsupli."editor", msupli."ctime" \n
\t\t\t\t\t\t\n
\t\t\t\t\t\tLIMIT 2147483647 OFFSET 0\n
\t\t\t\t\t':\n
\n
SQLSTATE[25P02]: In failed sql transaction: 7 ERROR:  current transaction is aborted, commands ignored until end of transaction block
"""
Any idea or help ?
--
Jorge A Ramirez
System Engineer
PHP Developer

jramirezgranada
Posts: 40
Joined: 12 Jul 2018, 19:57

Re: Error saving characteristics attributes

Post by jramirezgranada » 18 Oct 2018, 20:28

I noticed this:

I have this attribute:
Note: If I try to save this attribute i got the above error.

Code: Select all

id: 5	
typeid: 125	
siteid: 1	
domain: product	
code: www.company.com/path/anthony-mancuso.html	 
label: Anthony Mancuso	
pos: 4	
status: 1	
mtime: 2018-10-18 08:28:47	
ctime: 2018-10-18 08:28:47	
Also I have this one:
Note: If I try to save with this attribute I don't get the error

Code: Select all

id: 4	
type id: 125	
siteid: 1	
domain: product	
code: amy-delpo.html	
label: Amy DelPo	
pos:3	
status: 1	
mtime: 2018-10-18 13:19:07	
ctime: 2018-10-18 08:28:47
Notice that both have the same type id
--
Jorge A Ramirez
System Engineer
PHP Developer

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

Re: Error saving characteristics attributes

Post by aimeos » 21 Oct 2018, 12:17

How long is the VARCHAR column of mshop_attribute.code in your database? It should be 255 characters:
https://github.com/aimeos/aimeos-core/b ... te.php#L43
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

jramirezgranada
Posts: 40
Joined: 12 Jul 2018, 19:57

Re: Error saving characteristics attributes

Post by jramirezgranada » 21 Oct 2018, 16:21

Yes, but the code in the mshop_index_attribute is 32 characters. That does not make sense. It is breaking up the data integrity.
--
Jorge A Ramirez
System Engineer
PHP Developer

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

Re: Error saving characteristics attributes

Post by aimeos » 21 Oct 2018, 18:34

You are right. It has been fixed in dev-master and 2018.10 branch. You can test by adding this to the "require" section of your composer.json file:

Code: Select all

"aimeos/aimeos-core": "2018.10.x-dev"
Then execute this to update the table:

Code: Select all

./artisan aimeos:setup
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply