cuba
cuba copied to clipboard
EntityLog isn't registered for objects that are modified in EntityChangedEvent
Environment
- Platform version: 7.2.*
Description of the bug or enhancement
Minimal reproducible example
- Create
Companyentity withnameanddescriptionattributes. - 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
Companyentity. - Try to create
Companyentity. Fill onlynameattribute. - Check entity log for created entity.
- Expected behavior
The change log should contain
nameanddescriptionattributes. - Actual behavior
The change log contain only
nameattribute. Thedescriptionattribute that was changed by listener, was not registered in EntityLog.