From 22bc49baabca41364158334528603a122eee65a2 Mon Sep 17 00:00:00 2001 From: Corentin Huet Date: Mon, 24 Aug 2026 17:50:16 +0200 Subject: [PATCH 1/2] fix: :bug: update regex to match both issue and work items --- app/Traits/Controllers/HasGitlabIssue.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Traits/Controllers/HasGitlabIssue.php b/app/Traits/Controllers/HasGitlabIssue.php index a664f83..b334f3a 100644 --- a/app/Traits/Controllers/HasGitlabIssue.php +++ b/app/Traits/Controllers/HasGitlabIssue.php @@ -17,7 +17,7 @@ trait HasGitlabIssue */ public function getGitlabIssue(int $projectId, string $issueUrl): array { - if (!preg_match('/\/issues\/(\d+)/', $issueUrl, $matches)) { return []; } + if (!preg_match('/\/(?:issues|work_items)\/(\d+)/', $issueUrl, $matches)) { return []; } $gitlabIssue = GitLab::issues()->show($projectId, (int) $matches[1]); From 22d79cfb115fb82c09de1ea6c5d649a5168ad6d8 Mon Sep 17 00:00:00 2001 From: Corentin Huet Date: Tue, 25 Aug 2026 13:16:11 +0200 Subject: [PATCH 2/2] fix: :bug: add error message for archived project --- app/Http/Controllers/Bo/TicketController.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Bo/TicketController.php b/app/Http/Controllers/Bo/TicketController.php index 131bad4..827c39d 100644 --- a/app/Http/Controllers/Bo/TicketController.php +++ b/app/Http/Controllers/Bo/TicketController.php @@ -754,8 +754,13 @@ class TicketController extends Controller { $userGitlabId = auth()->user()->gitlab_id; $gitlabRepoId = $ticket->site->gitlab_project_id; - $description = \sprintf("%s
", $ticket->text); - $cLabel = match ($ticket->type) { + + if (GitLab::projects()->show($gitlabRepoId)['archived']) { + return back()->with('error', \trans("Ce projet GitLab est archivé et ne peut pas être utilisé.")); + } + + $description = \sprintf("%s
", $ticket->text); + $cLabel = match ($ticket->type) { TicketTypeEnum::bug => 'c-bug,g-to-dispatch', TicketTypeEnum::evolution => 'c-feature', TicketTypeEnum::newsletter => 'c-feature,g-to-estimate',