Skip to content

Commit

Permalink
BUGFIX Re-added session-based ID setting in LeftAndMain, it was neces…
Browse files Browse the repository at this point in the history
…sary 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
  • Loading branch information
chillu committed Nov 21, 2009
1 parent 97ece94 commit 45c31da
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion code/LeftAndMain.php
Expand Up @@ -332,6 +332,9 @@ static function menu_title_for_class($class) {
} }


public function show($request) { 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')); $form = $this->getEditForm($request->param('ID'));


if(Director::is_ajax()) { if(Director::is_ajax()) {
Expand Down Expand Up @@ -864,7 +867,7 @@ public function printable() {
public function currentPageID() { public function currentPageID() {
if($this->request->getVar('ID')) { if($this->request->getVar('ID')) {
return $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'); return $this->request->param('ID');
} elseif(Session::get("{$this->class}.currentPage")) { } elseif(Session::get("{$this->class}.currentPage")) {
return Session::get("{$this->class}.currentPage"); return Session::get("{$this->class}.currentPage");
Expand Down

0 comments on commit 45c31da

Please sign in to comment.