fix: make project template inheritance granular and safe
linter / quality (pull_request) Successful in 2m52s
tests / ci (8.4) (pull_request) Successful in 3m15s

This commit is contained in:
Nico Schröder
2026-09-08 12:03:07 +02:00
parent 0f125f17a3
commit 3122e00ed8
50 changed files with 1504 additions and 624 deletions
+1 -5
View File
@@ -47,11 +47,7 @@ class CreateProjectTicket
$nextSequenceNumber = (int) Ticket::query()
->where('project_id', $project->id)
->max('sequence_number') + 1;
$ticketStatusQuery = TicketStatus::query()
->where(
$project->project_template_id === null ? 'project_id' : 'project_template_id',
$project->project_template_id ?? $project->id,
);
$ticketStatusQuery = TicketStatus::query()->where('project_id', $project->id);
$ticketStatus = $ticketStatusQuery->findOrFail(Arr::get($attributes, 'ticket_status_id'));