From e577eef3244835decae9155e8822f4cc09640e78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Munsch?= Date: Wed, 12 Oct 2022 14:19:37 +0200 Subject: [PATCH 1/2] Ticket 1112: StoreTicket Labels presence check validation preventing regular user from creating tickets --- app/Http/Requests/StoreTicket.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/Http/Requests/StoreTicket.php b/app/Http/Requests/StoreTicket.php index 96b2ead..76c2966 100644 --- a/app/Http/Requests/StoreTicket.php +++ b/app/Http/Requests/StoreTicket.php @@ -97,15 +97,14 @@ class StoreTicket extends FormRequest 'file_ticket' => 'mimes:jpeg,jpg,png,pdf|max:2048', 'file_ticket2' => 'mimes:jpeg,jpg,png,pdf|max:2048', 'is_internal' => 'required|boolean', - 'labels' => [ - // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassBeforeLastUsed - 'sometimes', 'array', function ($attribute, $value, $fail) use ($user) { + 'labels' => 'sometimes|array', + 'labels.*' => [ + 'required', 'exists:labels,id', function ($attribute, $value, $fail) use ($user) { if (!$user->can('assignLabels', Ticket::class)) { $fail(trans('Vous n\'êtes pas autorisé à modifier cette valeur')); } } - ], - 'labels.*' => 'required|exists:labels,id' + ] ]; } } From 96f2c98925a53e6943a76be9b884e424875c1836 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Munsch?= Date: Wed, 12 Oct 2022 14:21:36 +0200 Subject: [PATCH 2/2] bump version 1.2.3 --- CHANGELOG.md | 3 +++ composer.json | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 17abe1d..3f42ef5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +### 12.10.2022 -> 1.2.3 +- Hotfixed regular users could not create tickets anymore + ### 01.07.2022 -> 1.2.2 - Fixed CSP directives - Fixed multiples bugs diff --git a/composer.json b/composer.json index 338f720..b2aa4f7 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "ldcweb/supportweb", - "version": "1.2.2", + "version": "1.2.3", "type": "project", "description": "The Laravel Framework.", "keywords": [