Permalink
Browse files

Breadcrumb/back nav in ModelAdmin now retains search params

  • Loading branch information...
1 parent 8717dec commit f7c87784661cd0f9c448040c9a695f168dbf9c57 @chillu chillu committed Jan 21, 2013
Showing with 7 additions and 1 deletion.
  1. +7 −1 admin/code/ModelAdmin.php
@@ -445,8 +445,14 @@ public function Breadcrumbs($unlinked = false) {
// Show the class name rather than ModelAdmin title as root node
$models = $this->getManagedModels();
+ $params = $this->request->getVars();
+ if(isset($params['url'])) unset($params['url']);
+
$items[0]->Title = $models[$this->modelClass]['title'];
- $items[0]->Link = $this->Link($this->sanitiseClassName($this->modelClass));
+ $items[0]->Link = Controller::join_links(
+ $this->Link($this->sanitiseClassName($this->modelClass)),
+ '?' . http_build_query($params)
+ );
return $items;
}

0 comments on commit f7c8778

Please sign in to comment.