EntityLog isn't registered for objects that are modified in EntityChangedEvent
andreysubbotin opened this issue · 0 comments
andreysubbotin commented
Environment
- Platform version: 7.2.*
Description of the bug or enhancement
Minimal reproducible example
- Create
Company
entity withname
anddescription
attributes. - Create listener for
EntityChangedEvent
@EventListener(phase = TransactionPhase.BEFORE_COMMIT)
public void beforeCommit(EntityChangedEvent<Company, UUID> event) {
Company company = transactionalDataManager.load(event.getEntityId())
.view(View.BASE)
.optional()
.orElse(null);
if (event.getType() == EntityChangedEvent.Type.CREATED) {
if (company != null) {
company.setDescription(company.getName());
transactionalDataManager.save(company, companyLog);
}
}
}
- Enable entity log for
Company
entity. - Try to create
Company
entity. Fill onlyname
attribute. - Check entity log for created entity.
- Expected behavior
The change log should containname
anddescription
attributes. - Actual behavior
The change log contain onlyname
attribute. Thedescription
attribute that was changed by listener, was not registered in EntityLog.