diff --git a/code/reports/BrokenLinksReport.php b/code/reports/BrokenLinksReport.php index 57051859..ffd56457 100644 --- a/code/reports/BrokenLinksReport.php +++ b/code/reports/BrokenLinksReport.php @@ -80,11 +80,12 @@ class BrokenLinksReport extends SS_Report { $dateTitle = _t('BrokenLinksReport.ColumnDateLastPublished', 'Date last published'); } + $linkBase = singleton('CMSPageEditController')->Link('show') . '/'; $fields = array( "Title" => array( "title" => _t('BrokenLinksReport.PageName', 'Page name'), 'formatting' => sprintf( - '$value', + '$value', _t('BrokenLinksReport.HoverTitleEditPage', 'Edit page') ) ), @@ -97,7 +98,15 @@ class BrokenLinksReport extends SS_Report { ), 'AbsoluteLink' => array( 'title' => _t('BrokenLinksReport.ColumnURL', 'URL'), - 'formatting' => '$value " . ($AbsoluteLiveLink ? "(live)" : "") . " (draft)' + 'formatting' => function($value, $item) { + $liveLink = $item->AbsoluteLiveLink; + $stageLink = $item->AbsoluteLink(); + return sprintf('%s %s', + $stageLink, + $liveLink ? $liveLink : $stageLink . '?stage=Stage', + $liveLink ? '(live)' : '(draft)' + ); + } ) ); diff --git a/code/reports/Report.php b/code/reports/Report.php index 5714d346..91998604 100644 --- a/code/reports/Report.php +++ b/code/reports/Report.php @@ -238,7 +238,7 @@ class SS_Report extends ViewableData { } // Add search fields is available - if($fields = $this->parameterFields()) { + if($this->hasMethod('parameterFields') && $fields = $this->parameterFields()) { foreach($fields as $field) { // Namespace fields for easier handling in form submissions $field->setName(sprintf('filters[%s]', $field->getName())); diff --git a/code/reports/SideReport.php b/code/reports/SideReport.php index c08c231a..93f84eb8 100644 --- a/code/reports/SideReport.php +++ b/code/reports/SideReport.php @@ -92,7 +92,8 @@ class SideReportView extends ViewableData { } if(isset($info['link']) && $info['link']) { - $link = ($info['link'] === true) ? "admin/show/$record->ID" : $info['link']; + $linkBase = singleton('CMSPageEditController')->Link('show') . '/'; + $link = ($info['link'] === true) ? $linkBase . $record->ID : $info['link']; return $prefix . "$val"; } else { return $prefix . "$val";