Skip to content

Commit

Permalink
fix contact creation view
Browse files Browse the repository at this point in the history
  • Loading branch information
KaydenLiss committed Aug 29, 2023
1 parent 52ebde9 commit 4389c31
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/Controller/KontaktController.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public function addKontakt(
'title' => $this->translator->trans(id: 'contact.create', domain: 'kontakt'),
'new' => true,
'isEditable' => true,
'currentTeam' => $team,
]);
}

Expand Down
10 changes: 8 additions & 2 deletions src/Service/InheritanceService.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,18 @@ public function checkTeamUsesPolicy(Team $team, Policies $policy): bool

public function checkContactIsInherited(Kontakte $contact): bool
{
return $this->contactRepository->findIsInheritedById($contact->getId());
if ($contact->getId()) {
return $this->contactRepository->findIsInheritedById($contact->getId());
}
return false;
}

public function checkTeamUsesContact(Team $team, Kontakte $contact): bool
{
return $this->contactRepository->findIsUsedByTeamAndId($team, $contact->getId());
if ($contact->getId()) {
return $this->contactRepository->findIsUsedByTeamAndId($team, $contact->getId());
}
return false;
}

public function checkTransferIsInherited(Datenweitergabe $transfer): bool
Expand Down

0 comments on commit 4389c31

Please sign in to comment.