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/app/Http/Requests/StoreTicket.php b/app/Http/Requests/StoreTicket.php index 79c895c..a82969f 100644 --- a/app/Http/Requests/StoreTicket.php +++ b/app/Http/Requests/StoreTicket.php @@ -100,15 +100,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' + ] ]; } } 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": [