Skip to content

Commit

Permalink
work on issue #97
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmintz committed Jul 30, 2020
1 parent eb07dad commit fe70eae
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions module/Admin/src/Service/DefendantNameService.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public function update(Entity\Defendant $entity, array $data, array $options = [
$debug[] = __LINE__.": planning to remove duplicate entity {$duplicate['entity']->getId()}";
}
} else { // contextual update
$debug[] = "INEXACT duplicate, contextual update; duplicate resolution: " .$data['duplicate_resolution'];
$debug[] = __LINE__.": INEXACT duplicate, contextual update; duplicate resolution: " .$data['duplicate_resolution'];
if ($data['duplicate_resolution'] == self::UPDATE_EXISTING_DUPLICATE) {
// ...first update the name
$update = 'UPDATE defendant_names SET surnames = ?, given_names = ? WHERE id = ?';
Expand All @@ -200,7 +200,10 @@ public function update(Entity\Defendant $entity, array $data, array $options = [
//$event_ids = $this->getEventIdsForContexts($contexts_submitted,$entity);
// $result['deft_events_updated'] = $this->doDeftEventsUpdate($duplicate->getId(),$entity->getId(),$contexts_submitted);
$result = array_merge($result, $this->doRelatedTableUpdates($id, $entity->getId(), $contexts_submitted));
$result['entity'] = ['given_names' => $data['given_names'],'surnames' => $data['surnames'],'id' => $id];
// $result['entity'] = ['given_names' => $data['given_names'],'surnames' => $data['surnames'],'id' => $id];
$debug[] = __LINE__.": setting result[entity] = ".print_r($duplicate['entity']->toArray(),true);
$result['entity'] = $duplicate['entity']->toArray();
$result['deftname_replaced_by'] = $id;
}
break;
}
Expand Down

0 comments on commit fe70eae

Please sign in to comment.