diff --git a/app/Http/Controllers/PublicationController.php b/app/Http/Controllers/PublicationController.php index f48e1b30..81b052f1 100644 --- a/app/Http/Controllers/PublicationController.php +++ b/app/Http/Controllers/PublicationController.php @@ -56,7 +56,7 @@ public function store(Request $request): JsonResource 'is_open_access' => 'boolean', ]); - if ($validated['is_open_access']) { + if (isset($validated['is_open_access']) && $validated['is_open_access']) { $validated['embargoed_until'] = null; } @@ -114,7 +114,7 @@ public function update(Request $request, Publication $publication): JsonResource 'is_open_access' => 'boolean', ]); - if ($validated['is_open_access']) { + if (isset($validated['is_open_access']) && $validated['is_open_access']) { $validated['embargoed_until'] = null; }