Skip to content

Commit

Permalink
Merge pull request #50 from nyuhsl/hotfix/fix-dataset-creation
Browse files Browse the repository at this point in the history
Fix bug on dataset creation
  • Loading branch information
ianlamb77 authored Dec 6, 2017
2 parents d94b326 + cd9f15a commit 75b15a6
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/AppBundle/EventListener/DatasetEditListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,15 @@ public function recordEdit($dataset, $em, $uow, $entityAlreadyExists = false)
} elseif ($previousValue == true && $newValue != true) {
// this means we are unarchiving it
$edit->setEditType("unarchived");
} elseif (!$entityAlreadyExists) {
// if we're setting the 'archived' value on initial dataset entry
$edit->setEditType("created");
}
// if not archiving, check if this is an update to existing dataset
// if 'archived' isn't being set in this call, we're almost certainly updating an existing entry
} elseif ($entityAlreadyExists) {
$edit->setEditType("updated");
// if not, must be a brand new one
} else {
$edit->setEditType("created");
}
}

// record any notes on this edit
if (array_key_exists('archival_notes', $changeset)) {
Expand Down

0 comments on commit 75b15a6

Please sign in to comment.