From 83e37c86b4c0a541245a4cecdd7220e401a76719 Mon Sep 17 00:00:00 2001 From: Bertrand Kintanar Date: Thu, 9 Jan 2025 09:36:18 +1300 Subject: [PATCH] Update all custom properties instead of the first one only --- 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..fa0087b4 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}"; + $targetRequestAttribute = "{$key}.{$index}.{$field->attribute}"; - $field->fillInto($request, $media, $targetAttribute, $requestAttribute); + $field->fillInto($request, $media, $targetAttribute, $targetRequestAttribute); } $media->save();