What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

Hello! I have a question about DataImporters: After changing stuff in the csv files (images, localiz

U039H1K90BH
U039H1K90BH Posts: 9 πŸ§‘πŸ»β€πŸš€ - Cadet

Hello! I have a question about DataImporters: After changing stuff in the csv files (images, localized attributes, etc.), these changes are not reflected in Yves in our current project. So far I resorted to fire publish events manually (i. e. with DataImporterPublisher::addEvent ). Is this the correct default behavior or am I missing some configuration?

Comments

  • U031G802S74
    U031G802S74 Posts: 29 πŸ§‘πŸ»β€πŸš€ - Cadet

    you run the dataimportpublisher trigger events at some point?

  • U039H1K90BH
    U039H1K90BH Posts: 9 πŸ§‘πŸ»β€πŸš€ - Cadet

    No. Do I have to do that? I mean I am using the default importers (for example data:import:product-abstract , and when I change an attribute, this is not synced with Yves). I could of course add code to every data importer where this problem occurs, but it feels like this is either a bug or I’m doing something wrong

  • U01F7P3D9NH
    U01F7P3D9NH Posts: 60 πŸ§‘πŸ»β€πŸš€ - Cadet

    You always have to trigger an event in order to get publish&sync done. F.e. vendor/bin/console publish:trigger-events -r product_concrete -i 5 triggers the sync for element with that ID. Other way is to save to product in Backoffice. After the trigger you will see multiple new messages in Rabbit. So urls, searchkey etc. will be updated

  • U039H1K90BH
    U039H1K90BH Posts: 9 πŸ§‘πŸ»β€πŸš€ - Cadet

    Ah okay, didn’t know that. Is there an easy way to see which entities were actually changed during the import? Right now I compare the csv content manually with what’s in the database, which is expensive with thousands of products. The csv files contain all data (not just the changes)

  • U01F7P3D9NH
    U01F7P3D9NH Posts: 60 πŸ§‘πŸ»β€πŸš€ - Cadet

    Some entities have β€šupdatedAtβ€˜ columns. You can also get changes on the sql level but this is more expert level. You can use multiple entities in the trigger event and let the system manage the changes. Go and check the deployment.yml files. It helped me a lot understanding the import steps

  • U039H1K90BH
    U039H1K90BH Posts: 9 πŸ§‘πŸ»β€πŸš€ - Cadet

    Thank you, I think I’ll use the updatedAt columns to see which localized_attributes entries in the db where changed during import and publish the corresponding products. The sql level would be nice though, since all statements are wrapped in a transaction it should theoretically be possible to see which entities were changed. Maybe the touch facade has something to do with it as well? Difficult topic.

  • U031G802S74
    U031G802S74 Posts: 29 πŸ§‘πŸ»β€πŸš€ - Cadet

    For triggering the event run DataImporterPublisher::triggerEvents() after your import process and the every event you added there before will be released. This is so you can add them add any point and trigger them in one bulk action.

  • U039H1K90BH
    U039H1K90BH Posts: 9 πŸ§‘πŸ»β€πŸš€ - Cadet

    Yes I know, the problem was that events were not automatically added for the entities that were changed during import. So I had to manually determine which entity was updated and use ::addEvent to add events

  • U031G802S74
    U031G802S74 Posts: 29 πŸ§‘πŸ»β€πŸš€ - Cadet

    The Importer will for example find Product by SKU and modify it. At this point, you know the Id and add the event, depending on if you have a isModified or isNew to true ob your product entity.