Skip to content

Commit

Permalink
fixes a bug where draft items would not be found
Browse files Browse the repository at this point in the history
those unfound items would then throw an error in the panel
see getkirby/kirby#6339
  • Loading branch information
therephil committed Jul 8, 2024
1 parent 0b4c703 commit 8554eb7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Services/ReferenceService.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ function ($child, $key) use ($uuid) {

$references = [];
foreach ($usedItems as $item) {
$refPage = site()->findPageOrDraft($item['uri']);
$refPage = site()->findPageOrDraft($item['uri']) ?? site()->draft($item['uri']);

$references[] = [
'title' => $refPage->title()->value,
'title' => $refPage->title()->value ?? '',
'url' => $refPage->url(),
'slug' => $refPage->slug(),
'breadcrumb' => $refPage->panel()->breadcrumb(),
Expand Down

0 comments on commit 8554eb7

Please sign in to comment.