From b41c401223393b33ef8d7b1745b8fe74670de570 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Tue, 16 Feb 2010 04:07:30 +0000 Subject: [PATCH] BUGFIX: Fix not being able to print/export reports (from r98684) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@99128 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- code/ReportAdmin.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/ReportAdmin.php b/code/ReportAdmin.php index e4d913fa..dd3619f9 100755 --- a/code/ReportAdmin.php +++ b/code/ReportAdmin.php @@ -116,7 +116,8 @@ class ReportAdmin extends LeftAndMain { * @return Form */ public function EditForm() { - $id = isset($_REQUEST['ID']) ? $_REQUEST['ID'] : null; + // Return the report if the ID is sent by request, or we're specifically asking for the edit form + $id = isset($_REQUEST['ID']) ? $_REQUEST['ID'] : ($this->getRequest()->latestParam('Action') == 'EditForm') ? Session::get('currentReport') : null; if($id) { foreach($this->Reports() as $report) { @@ -132,7 +133,7 @@ class ReportAdmin extends LeftAndMain { * @return SS_Report */ public function CurrentReport() { - $id = isset($_REQUEST['ID']) ? $_REQUEST['ID'] : null; + $id = isset($_REQUEST['ID']) ? $_REQUEST['ID'] : ($this->getRequest()->latestParam('Action') == 'EditForm') ? Session::get('currentReport') : null; if($id) { foreach($this->Reports() as $report) {