XML import of product attributes does not work in 19.10.4

Questions around the TYPO3 integration and plugins
Forum rules
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
cnoelker
Advanced
Posts: 140
Joined: 20 Feb 2016, 18:21

XML import of product attributes does not work in 19.10.4

Post by cnoelker » 25 Jan 2020, 10:38

Hello,

after updating from Aimeos 19.9.3 to 19.10.4 (TYPO3 9.5.13), the import of product xml files no longer imports the attributes of products.
The format of the import file has not changed. The attribute items in the import file look like this:

<lists>
<attribute>
<attributeitem ref="product|productgroup|productgroup_4" lists.type="default" lists.position="0" lists.status="1"/>
<attributeitem ref="product|season|season_1" lists.type="default" lists.position="1" lists.status="1"/>
<attributeitem ref="product|program|program_1_10" lists.type="default" lists.position="2" lists.status="1"/>
</attribute>
...

All referenced attributes are existing and are active.

As a test, I started the export of the products and afterwards imported one productitem of this file. (The syntax of the xml file is correct.) This results in an error:
Argument 1 passed to Aimeos\MShop\Product\Item\Standard::setConfig() must be of the type array, string given.

Also, the export of the product.label does not contain the correct value. It's exporting the code, not the label set for the product.

I was able to fix the first problem in the xml file by removing the offending line:
<product.config><![CDATA[[]]]></product.config>

Afterwards, I was able to import the file. But same result: The attributes are missing!

Could you please have a look at these problems?

All products in our shop are created by this import. None of the products now has attributes anymore. Since these are partly variant attributes, no products can be bought!

Claudia

cnoelker
Advanced
Posts: 140
Joined: 20 Feb 2016, 18:21

Re: XML import of product attributes does not work in 19.10.4

Post by cnoelker » 25 Jan 2020, 11:00

I fixed the minor issue of the product.label containing the wrong content. Pull request is started.

cnoelker
Advanced
Posts: 140
Joined: 20 Feb 2016, 18:21

Re: XML import of product attributes does not work in 19.10.4

Post by cnoelker » 25 Jan 2020, 11:09

And another note: Exporting the product.config containing some content can't be imported, either. Export file contains:

<product.config><![CDATA[{"css-class":"fds"}]]></product.config>

Starting the import resulted in
[ TypeError ]
Argument 1 passed to Aimeos\MShop\Product\Item\Standard::setConfig() must be of the type array, string given,
called in [my-path]/typo3conf/ext/aimeos/Resources/Libraries/aimeos/aimeos-core/lib/mshoplib/src/MShop/Product/Item/Standard.php on line 343

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

Re: XML import of product attributes does not work in 19.10.4

Post by aimeos » 25 Jan 2020, 14:10

Thanks, the config issue has been fixed in dev-master and 2019.10.x-dev.

Do you have a clue why the attribute references are missing now?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

cnoelker
Advanced
Posts: 140
Joined: 20 Feb 2016, 18:21

Re: XML import of product attributes does not work in 19.10.4

Post by cnoelker » 25 Jan 2020, 15:10

When I compare the mshop_attribute table of a former aimeos, then the key in this table is e.g. "product|size|size_36", so it is combined of domain, type and code.

After updating to 19.10.4, the key is crypted version of "product|size|size_36", e.g. 95e1468b99a23be8d30dc27e51252ee7 .

Maybe this change is be the cause of the problem?

cnoelker
Advanced
Posts: 140
Joined: 20 Feb 2016, 18:21

Re: XML import of product attributes does not work in 19.10.4

Post by cnoelker » 25 Jan 2020, 15:18

I gave the import a quick try and exchanged the ref="product|size|size_36" with ref="95e1468b99a23be8d30dc27e51252ee7".
However, nothing changed. Still no attributes.

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

Re: XML import of product attributes does not work in 19.10.4

Post by aimeos » 25 Jan 2020, 15:47

No, the value is updated by the setup script to a hash to avoid problems with domain|type|code combinations that are longer than the key column. The domain|type|code combination is hashed by md5() before it's compared to the key in the database.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

cnoelker
Advanced
Posts: 140
Joined: 20 Feb 2016, 18:21

Re: XML import of product attributes does not work in 19.10.4

Post by cnoelker » 25 Jan 2020, 17:00

Then why doesn't it find the key? I did already compare the md5sum, this matches the value stored in the table.

Can you reproduce this? I.e. exporting the products which contain attributes and then importing it again?

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

Re: XML import of product attributes does not work in 19.10.4

Post by aimeos » 26 Jan 2020, 19:00

We have been able to reproduce the error and it occurred due to a duplicate md5 encoding. A new release of the core and the job controller package has been tagged. Can you please update and test again?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

cnoelker
Advanced
Posts: 140
Joined: 20 Feb 2016, 18:21

Re: XML import of product attributes does not work in 19.10.4

Post by cnoelker » 27 Jan 2020, 08:47

It's no composer installation so I exchanged ai-controller-jobs, aimeos-core and ai-typo3 (because of an error) manually.
But now I get other errors when calling the XML import:
Call to undefined function Aimeos\MShop\Common\Manager\Decorator\map()

Post Reply