From f7c87784661cd0f9c448040c9a695f168dbf9c57 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Mon, 21 Jan 2013 12:04:20 +0100 Subject: [PATCH] Breadcrumb/back nav in ModelAdmin now retains search params --- admin/code/ModelAdmin.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/admin/code/ModelAdmin.php b/admin/code/ModelAdmin.php index aaeee5506..a08ab53d0 100644 --- a/admin/code/ModelAdmin.php +++ b/admin/code/ModelAdmin.php @@ -445,8 +445,14 @@ abstract class ModelAdmin extends LeftAndMain { // 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; }