Skip to content
Permalink
Browse files

BUGFIX: SSF-168 fixing bug in report admin where back button didn't work

  • Loading branch information...
Julian Seidenberg
Julian Seidenberg committed Apr 5, 2012
1 parent 4c76c85 commit b1e286cb23c3ea914b86dad9fa549a77ebb949f8
Showing with 14 additions and 7 deletions.
  1. +14 −7 code/controllers/ReportAdmin.php
@@ -22,10 +22,23 @@ class ReportAdmin extends LeftAndMain implements PermissionProvider {
static $template_path = null; // defaults to (project)/templates/email
static $tree_class = 'SS_Report';
/**
* Variable that describes which report we are currently viewing based on the URL (gets set in init method)
* @var String
*/
protected $reportClass;
protected $reportObject;
public function init() {
parent::init();
//set the report we are currently viewing from the URL
$this->reportClass = (isset($this->urlParams['ID'])) ? $this->urlParams['ID'] : null;
$allReports = SS_Report::get_reports();
$this->reportObject = (isset($allReports[$this->reportClass])) ? $allReports[$this->reportClass] : null;
Requirements::css(CMS_DIR . '/css/screen.css');
// Set custom options for TinyMCE specific to ReportAdmin
@@ -58,12 +71,6 @@ function canView($member = null) {
return false;
}
function currentReport() {
$id = parent::currentPageID();
$reports = SS_Report::get_reports();
return (isset($reports[$id])) ? $reports[$id] : null;
}
/**
* Return a SS_List of SS_Report subclasses
* that are available for use.
@@ -111,7 +118,7 @@ function providePermissions() {
public function getEditForm($id = null, $fields = null) {
$fields = new FieldList();
$report = $this->currentReport();
$report = $this->reportObject;
if($report) {
// List all reports

0 comments on commit b1e286c

Please sign in to comment.
You can’t perform that action at this time.