Hi,
i just found out that when the addon GitHub - mariodavid/cuba-component-entity-soft-reference: CUBA component that allows reference any entities with soft references is used in an entity, this breaks the functionality of the entity export in the entity inspector as well as “System Information” > “Insert Script” information.
Basically the data that is used in the soft-reference attribute is not correct. Unfortunately this leads to the fact that the entity export for this entity is broken completely.
Attached you’ll find an example project.
cuba-problem-entity-soft-reference-export.zip (108.7 KB)
Here is an example exported JSON:
[
{
"_entityName": "cpesre$Order",
"id": "d3f1575f-d0ea-6cef-31d1-7200ea634461",
"createdBy": "admin",
"createTs": "2018-07-05 18:43:22.638",
"version": 1,
"updateTs": "2018-07-05 18:43:22.638",
"orderDate": "2018-07-05",
"customer": "Fry" // <<-- this is wrong. Expected value might be "cpesre$Customer-7034a7c6-5211-2c42-ec54-e06226f5103a"
}
]
Here’s the broken SQL:
insert into CPESRE_CUSTOMER
(ID, VERSION, CREATE_TS, CREATED_BY, UPDATE_TS, UPDATED_BY, DELETE_TS, DELETED_BY, NAME)
values ('7034a7c6-5211-2c42-ec54-e06226f5103a', 2, '2018-07-05 18:36:50', 'admin', '2018-07-05 18:38:02', 'admin', null, null, 'Fry');
insert into CPESRE_ORDER
(ID, VERSION, CREATE_TS, CREATED_BY, UPDATE_TS, UPDATED_BY, DELETE_TS, DELETED_BY, ORDER_DATE, CUSTOMER)
values ('483f86b6-842c-7be3-4b7d-26f6bf9ac1bc', 1, '2018-07-05 18:36:51', 'admin', '2018-07-05 18:36:51', null, null, null, '2018-07-05', '7034a7c6-5211-2c42-ec54-e06226f5103a');
-- this is also wrong. It should be "cpesre$Customer-7034a7c6-5211-2c42-ec54-e06226f5103a" for ORDER.CUSTOMER
Do you have any idea what is the root cause of this behavior?
Bye
Mario