I am trying to use the objectdiff module on 2 objects of the same entity with a set of attributes among which some are foreign keys.
When I use the module to catch any difference between these 2 objects, some comparisons work while for some attribute the module is catching a difference but overwrites the old value with “EMPTY” and the new value with “EMPTY” as well.
The comparison doesn’t seem to be working when:
The attribute that is being changed is a foreign key to an entity where this same attribute is the primary key
The attribute that is being changed is a foreign key that point to an entity that is not static
Only use case where the comparison works as expected is when the foreign key being changed is pointing at a static entity?
Is that an expected behavior?
The entity being compared is provided in the screenshot. Among all the attributes, some like BrandId, CostDistributionId, CampaignStartDate, CampaignEndDate, PrintingFlag are correctly being compared by the objectdiff component while some other like CampaignId, ChannelName are not
Hi Meziane,
The entity the foreign key points to must have its Label attribute set. Values for foreign keys use the "Label" attribute of the foreign entity as well as displaying the id.
Could you check your entities, Brand, CostDistribution, CampaignStartDate, etc have a Label attribute set?
Kind regards,
Stuart
Hi Stuart,
I am comparing 2 objects of the ExpenseLog nature (see screenshot)
The comparison on brandId works as expected. I attached a screenshot of the BrandId key defined in the Brand entity
However the comparison is not working for the channel name attribute. See following screenshot and the next. The label seems appropriately set from what I can see. Or do you mean something else by "Label"
See additional screenshot for Channel entity
Thank you, those images really help! :)
Ah yes, I do mean something else by Label. Its the Label attribute on the entity.
To get to this screen select the foreign entity, eg the ChannelName entity, then click on More...
Then set the Label Attribute to ChannelName.
If this is not the issue we'll have to keep investigating, but hopefully that is what is missing.
And if it doesn't work, could you post an example of the diff output?
Thanks and I hope this helps.
Hello Meziane,
I hope your issues have been resolved.
If not, I have just found and fixed a bug (fixed in version 1.0.0.5) where the value displayed for foreign keys was "EMPTY" when the foreign key entity identifier data type was "Text" rather than "Long Integer" or "Integer". This seems to be the same behaviour you were experiencing.
I hope this helps.