Skip to content

Commit

Permalink
Fix a SOE that would occur when using audit trails with self-referenc…
Browse files Browse the repository at this point in the history
…ing relationships.
  • Loading branch information
fbarthez committed May 26, 2016
1 parent adf5a81 commit 42b5890
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,14 @@ protected Configuration configureEntity(EOEntity entity) {
}
if (rel.isToMany()) {
EOEntity destinationEntity = rel.destinationEntity();
Configuration destinationConfiguration = configureEntity(destinationEntity);
String inverseName = rel.anyInverseRelationship().name();
destinationConfiguration.notificationKeys.addObject(inverseName);
source = rel.destinationEntity();
// skip for self-referencing relationships, i.e. when
// the destination entity has already been configured
if (configuration.objectForKey(destinationEntity.name()) == null) {
Configuration destinationConfiguration = configureEntity(destinationEntity);
String inverseName = rel.anyInverseRelationship().name();
destinationConfiguration.notificationKeys.addObject(inverseName);
source = rel.destinationEntity();
}
} else {
config.keys.addObject(rel.name());
}
Expand Down

0 comments on commit 42b5890

Please sign in to comment.