Merge pull request #9565 from tom890180/check_items_exist

This commit is contained in:
Guy Marriott 2020-06-29 12:09:10 -07:00 committed by GitHub
commit 161e0a0b4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 2 deletions

View File

@ -464,8 +464,10 @@ class GridFieldDetailForm_ItemRequest extends RequestHandler
if ($toplevelController->hasMethod('Backlink')) {
$backlink = $toplevelController->Backlink();
} elseif ($this->popupController->hasMethod('Breadcrumbs')) {
$parents = $this->popupController->Breadcrumbs(false)->items;
$backlink = array_pop($parents)->Link;
$parents = $this->popupController->Breadcrumbs(false);
if ($parents && $parents = $parents->items) {
$backlink = array_pop($parents)->Link;
}
}
}
if (!$backlink) {
@ -786,6 +788,10 @@ class GridFieldDetailForm_ItemRequest extends RequestHandler
/** @var ArrayList $items */
$items = $this->popupController->Breadcrumbs($unlinked);
if (!$items) {
$items = new ArrayList();
}
if ($this->record && $this->record->ID) {
$title = ($this->record->Title) ? $this->record->Title : "#{$this->record->ID}";
$items->push(new ArrayData([