From ca0f309c2701dc5d55110f38d6fc78b598911da2 Mon Sep 17 00:00:00 2001 From: edalzell Date: Fri, 7 Mar 2025 13:40:01 -0800 Subject: [PATCH] =?UTF-8?q?comment=20so=20I=20know=20what=E2=80=99s=20goin?= =?UTF-8?q?g=20on?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Fieldtypes/Review.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Fieldtypes/Review.php b/src/Fieldtypes/Review.php index e970b31..674159b 100644 --- a/src/Fieldtypes/Review.php +++ b/src/Fieldtypes/Review.php @@ -22,12 +22,18 @@ public function preload() return []; } - // when it's a new entry the "parent" is the collection + // when it's a new entry the "parent" might be a collection // in this case, we can't show it anyway so return empty if ($entry instanceof Collection) { return []; } + // if there's a computed field in the entry's collection that uses augmentation, + // this maybe be an empty entry, without an id + if (is_null($entry->id())) { + return []; + } + return ['site_url' => URL::reviewUrl($entry)]; } }