BlackbitDigitalCommerce / pimcore-data-director

Import Bundle for Pimcore
16 stars 3 forks source link

Different value in store and query table for the same field. #111

Closed betterapp closed 1 year ago

betterapp commented 1 year ago

Hello.

We have DataPort that is runned throw API call. It have compatibility mode = On. image

We have some custom bundle that check what fields was changed on the object and if specified fields was changed then we set SendToSAP field to 1. The event we use is: pimcore.dataobject.postUpdate In this bundle we use built-in PimCore Object's standard save() metod for update SendToSAP field value.

In this case SendToSAP field should have the same value in store and query table. But what we check the database we see that the values in query and store table are different. Is it possible that DataDiector changes something on saving this data in those tables during import process ?

We use DD: 3.2.39 and Pim 6.9

betterapp commented 1 year ago

From my testing this is related to inheritance - not DD itself.

BlackbitDevs commented 1 year ago

From my testing this is related to inheritance

This is the whole purpose of query and store database tables: store there is the value of the object without inheritance and in query there is the value with resolved inheritance. If store value is null for SendToSAP then the value in the query table gets inherited from a parent object of the same class.

Especially for checkboxes you have to be careful as true and false prevent inheritance while null enables inheritance. So if you want to exclude SendToSAP from being inherited at all, set it to false by default.