From 45c31da8632b975e2e1db15a58f80a3ec0221fa2 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Sat, 21 Nov 2009 03:19:37 +0000 Subject: [PATCH] BUGFIX Re-added session-based ID setting in LeftAndMain, it was necessary to for nested controllers like TableListField form fields git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@92816 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- code/LeftAndMain.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/code/LeftAndMain.php b/code/LeftAndMain.php index aa2bfc4e..a63f265b 100644 --- a/code/LeftAndMain.php +++ b/code/LeftAndMain.php @@ -332,6 +332,9 @@ class LeftAndMain extends Controller { } public function show($request) { + // TODO Necessary for TableListField URLs to work properly + if($request->param('ID')) $this->setCurrentPageID($request->param('ID')); + $form = $this->getEditForm($request->param('ID')); if(Director::is_ajax()) { @@ -864,7 +867,7 @@ JS; public function currentPageID() { if($this->request->getVar('ID')) { return $this->request->getVar('ID'); - } elseif ($this->request->param('ID')) { + } elseif ($this->request->param('ID') && is_numeric($this->request->param('ID'))) { return $this->request->param('ID'); } elseif(Session::get("{$this->class}.currentPage")) { return Session::get("{$this->class}.currentPage");