From 8c0441b1f7917d874afc0c25e911a51f789fe271 Mon Sep 17 00:00:00 2001 From: Pauline Date: Tue, 5 Sep 2023 08:48:25 +0200 Subject: [PATCH] fix: variable request attribute --- src/Fields/HandlesCustomPropertiesTrait.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Fields/HandlesCustomPropertiesTrait.php b/src/Fields/HandlesCustomPropertiesTrait.php index e0234fe6..c3b443fe 100644 --- a/src/Fields/HandlesCustomPropertiesTrait.php +++ b/src/Fields/HandlesCustomPropertiesTrait.php @@ -82,9 +82,9 @@ private function fillMediaCustomPropertiesFromRequest(NovaRequest $request, Medi // If we are dealing with nested resources or multiple panels, custom property fields are prefixed. $key = str_replace($collection, '__media-custom-properties__.'.$collection, $requestAttribute); $targetAttribute = "custom_properties->{$field->attribute}"; - $requestAttribute = "{$key}.{$index}.{$field->attribute}"; + $newRequestAttribute = "{$key}.{$index}.{$field->attribute}"; - $field->fillInto($request, $media, $targetAttribute, $requestAttribute); + $field->fillInto($request, $media, $targetAttribute, $newRequestAttribute); } $media->save();