Skip to content

Commit

Permalink
Fix for wonder-89: Don't attempt to save the parent EC of a new EO as…
Browse files Browse the repository at this point in the history
… none exists.
  • Loading branch information
Fabian Peters authored and fbarthez committed Oct 11, 2013
1 parent 6c85da9 commit d0ee79f
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,15 @@ public WOActionResults deleteObjectWithFinalCommit(boolean finalCommit) {
dataSource().deleteObject(object());
EOEnterpriseObject obj = (EOEnterpriseObject)d2wContext().valueForKey(Keys.objectPendingDeletion);
obj.editingContext().deleteObject(obj);

try {
obj.editingContext().saveChanges();
if (displayGroup() != null && displayGroup().displayedObjects().count() == 0) {
displayGroup().displayPreviousBatch();
}
if (finalCommit) { // if we are editing, then don't save the parent ec.
object().editingContext().saveChanges();
if (finalCommit && !ERXEOControlUtilities.isNewObject(object())) {
// if we are editing a new object, then don't save
object().editingContext().saveChanges();
}
d2wContext().takeValueForKey(null, Keys.objectPendingDeletion);
postDeleteNotification();
Expand Down

0 comments on commit d0ee79f

Please sign in to comment.