Permalink
Browse files

MINOR "New <record title>" breadcrumb for GridFieldPopupForm

  • Loading branch information...
1 parent 0117b32 commit e2c21cce8e6a2ae0c87e0b23f89fece91c03d2fe @chillu chillu committed Mar 5, 2012
Showing with 6 additions and 1 deletion.
  1. +6 −1 forms/gridfield/GridFieldPopupForms.php
View
7 forms/gridfield/GridFieldPopupForms.php
@@ -329,11 +329,16 @@ function Breadcrumbs($unlinked = false) {
if(!($this->popupController instanceof LeftAndMain)) return false;
$items = $this->popupController->Breadcrumbs($unlinked);
- if($this->record) {
+ if($this->record && $this->record->ID) {
$items->push(new ArrayData(array(
'Title' => $this->record->Title,
'Link' => false
)));
+ } else {
+ $items->push(new ArrayData(array(
+ 'Title' => sprintf(_t('GridField.NewRecord', 'New %s'), $this->record->singular_name()),
+ 'Link' => false
+ )));
}
// TODO Remove once ViewableData->First()/Last() is fixed

0 comments on commit e2c21cc

Please sign in to comment.