mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX: Ensure $items isn't null in GridFieldDetailForm_ItemRequest->Breadcrumbs() prior to performing operations on it.
This commit is contained in:
parent
64688dbc10
commit
824b5e0b67
@ -786,17 +786,19 @@ class GridFieldDetailForm_ItemRequest extends RequestHandler
|
|||||||
/** @var ArrayList $items */
|
/** @var ArrayList $items */
|
||||||
$items = $this->popupController->Breadcrumbs($unlinked);
|
$items = $this->popupController->Breadcrumbs($unlinked);
|
||||||
|
|
||||||
if ($this->record && $this->record->ID) {
|
if ($items) {
|
||||||
$title = ($this->record->Title) ? $this->record->Title : "#{$this->record->ID}";
|
if ($this->record && $this->record->ID) {
|
||||||
$items->push(new ArrayData([
|
$title = ($this->record->Title) ? $this->record->Title : "#{$this->record->ID}";
|
||||||
'Title' => $title,
|
$items->push(new ArrayData([
|
||||||
'Link' => $this->Link()
|
'Title' => $title,
|
||||||
]));
|
'Link' => $this->Link()
|
||||||
} else {
|
]));
|
||||||
$items->push(new ArrayData([
|
} else {
|
||||||
'Title' => _t('SilverStripe\\Forms\\GridField\\GridField.NewRecord', 'New {type}', ['type' => $this->record->i18n_singular_name()]),
|
$items->push(new ArrayData([
|
||||||
'Link' => false
|
'Title' => _t('SilverStripe\\Forms\\GridField\\GridField.NewRecord', 'New {type}', ['type' => $this->record->i18n_singular_name()]),
|
||||||
]));
|
'Link' => false
|
||||||
|
]));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->extend('updateBreadcrumbs', $items);
|
$this->extend('updateBreadcrumbs', $items);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user