Skip to content

Commit

Permalink
"list" route check
Browse files Browse the repository at this point in the history
  • Loading branch information
pulzarraider committed Aug 18, 2012
1 parent dffc769 commit f762165
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions Admin/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -1844,10 +1844,12 @@ public function buildBreadcrumbs($action, MenuItemInterface $menu = null)
array('uri' => $this->routeGenerator->generate('sonata_admin_dashboard'))
);

$child = $child->addChild(
$this->trans($this->getLabelTranslatorStrategy()->getLabel(sprintf('%s_list', $this->getClassnameLabel()), 'breadcrumb', 'link')),
array('uri' => $this->generateUrl('list'))
);
if ($this->hasRoute('list')) {
$child = $child->addChild(
$this->trans($this->getLabelTranslatorStrategy()->getLabel(sprintf('%s_list', $this->getClassnameLabel()), 'breadcrumb', 'link')),
array('uri' => $this->generateUrl('list'))
);
}

$childAdmin = $this->getCurrentChildAdmin();

Expand All @@ -1862,7 +1864,7 @@ public function buildBreadcrumbs($action, MenuItemInterface $menu = null)
return $childAdmin->buildBreadcrumbs($action, $child);

} elseif ($this->isChild()) {
if ($action != 'list') {
if ($action != 'list' && $this->hasRoute('list')) {
$menu = $menu->addChild(
$this->trans($this->getLabelTranslatorStrategy()->getLabel(sprintf('%s_list', $this->getClassnameLabel()), 'breadcrumb', 'link')),
array('uri' => $this->generateUrl('list'))
Expand Down

0 comments on commit f762165

Please sign in to comment.