BlackbitDigitalCommerce / pimcore-data-director

Import Bundle for Pimcore
16 stars 3 forks source link

Tags assignment custom callback causes exception #72

Closed ascheider closed 1 year ago

ascheider commented 1 year ago

If you try to assign multiple pimcore Tags, you need to explode the list like for the object relations. If i add custom callback and click on save: image I get this error: <br /> <b>Fatal error</b>: Nesting level too deep - recursive dependency? in <b>pimcore/vendor/blackbit/data-director/lib/Pim/Item/Importer.php</b> on line <b>3065</b><br /> {"success":false,"message":"Error: Nesting level too deep - recursive dependency?"}

How to reproduce: 1.) Create tags cool, sehr cool and wunderbar for example 2.) Create csv file like this: image 3.) Create import Dataport for the object of your choice, go to attribute mapping and try to use the callback like in screenshot on tags and save the config.

Expected behaviour: Tags are splited in array and shown in example result Current behaviour: Exception occures

Data director version: 3.2.25

BlackbitDevs commented 1 year ago

Thanks for your report. Have it fixed in just released 3.2.35. Please close issue if it works for you.

ascheider commented 1 year ago

@BlackbitDevs Hey thanks,

explode, works fine now image But the tags are nor assigned to the product after the import. Do i miss something here? Import Log: image Another question, is it possible to import Tags hierarchical? I can select target class, but don't see the possibility to import tags. Appreciate your help. Thanks!

BlackbitDevs commented 1 year ago

The log preview may be misleading here, will check this. Can you check if the tags are really not assigned when you open the object and check the "Tags" tab?

Yes, you can import tags hierarchy. Here is an excerpt from the [manual]:

Tags You can import one or multiple tags. Tag levels should be separated by /. You can either just assign a raw data field or use a callback function like this return ['Tag-Name','hierarchical/tag']; Tags which do not exist yet, get automatically created.

So in your case, you could return ['Attributes/wunderbar', 'Attributes/cool', 'Really/deep/tag/nesting'];

BlackbitDevs commented 1 year ago

Tested with version 3.3:

Log says:

Bildschirmfoto 2023-02-06 um 12 21 39

Tag panel in object:

Bildschirmfoto 2023-02-06 um 12 22 02
ascheider commented 1 year ago

@BlackbitDevs Hi,

no the tags are created, but not assigned. I'm little confused, i can not see the Version 3.3 in Bitbucket, only 3.2.36 which i'm using currently. I debug a little bit and output the data where tags are added: image I attached the output here: dump_object.txt As u can see, the $cachedItem['tags'] is empty on this point, so the tags are not assigned to the object. Here is my config and csv file: Archiv.zip I'm using pimcore v10.5.10.

BlackbitDevs commented 1 year ago

Sorry, forgot to tag 3.3.0. Now it is available. But I have also created 3.2.37 which includes the bugfix from 3.3 concerning tag import. Can you please try one of those versions?

ascheider commented 1 year ago

@BlackbitDevs Thank you very much, the version 3.2.37 solved the issue. The tags are now assigned 👍