Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/Fieldtypes/Review.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)];
}
}