From a6b914f194a2a0ef63c4e184ea69b9e20264ca93 Mon Sep 17 00:00:00 2001 From: Duncan McClean <19637309+duncanmcclean@users.noreply.github.com> Date: Thu, 16 Nov 2023 20:00:30 +0000 Subject: [PATCH] Fix `AddFieldsToProductBlueprint` when no variant option fields are configured (#134) --- src/Listeners/AddFieldsToProductBlueprint.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Listeners/AddFieldsToProductBlueprint.php b/src/Listeners/AddFieldsToProductBlueprint.php index 0e2e83e..3ea6ff1 100644 --- a/src/Listeners/AddFieldsToProductBlueprint.php +++ b/src/Listeners/AddFieldsToProductBlueprint.php @@ -28,7 +28,7 @@ public function handle(EntryBlueprintFound $event) if ($event->blueprint->hasField('product_variants')) { $productVariantsField = $event->blueprint->field('product_variants'); - $hasDigitalProductFields = collect($productVariantsField->config()['option_fields']) + $hasDigitalProductFields = collect($productVariantsField->config()['option_fields'] ?? []) ->filter(function ($value, $key) { return $value['handle'] === 'download_limit' || $value['handle'] === 'downloadable_asset'; })