Merge pull request #1422 from dhensby/pulls/report-links

FIX Use `Controller::join_links()` in Reports
This commit is contained in:
Damian Mooyman 2016-03-14 09:23:28 +13:00
commit 5dc30bc79b
2 changed files with 3 additions and 3 deletions

View File

@ -104,7 +104,7 @@ class BrokenLinksReport extends SS_Report {
$stageLink = $item->AbsoluteLink(); $stageLink = $item->AbsoluteLink();
return sprintf('%s <a href="%s">%s</a>', return sprintf('%s <a href="%s">%s</a>',
$stageLink, $stageLink,
$liveLink ? $liveLink : $stageLink . '?stage=Stage', $liveLink ? $liveLink : Controller::join_links($stageLink, '?stage=Stage'),
$liveLink ? '(live)' : '(draft)' $liveLink ? '(live)' : '(draft)'
); );
} }

View File

@ -92,8 +92,8 @@ class SideReportView extends ViewableData {
} }
if(isset($info['link']) && $info['link']) { if(isset($info['link']) && $info['link']) {
$linkBase = singleton('CMSPageEditController')->Link('show') . '/'; $linkBase = singleton('CMSPageEditController')->Link('show');
$link = ($info['link'] === true) ? $linkBase . $record->ID : $info['link']; $link = ($info['link'] === true) ? Controller::join_links($linkBase, $record->ID) : $info['link'];
return $prefix . "<a $classClause href=\"$link\">$val</a>"; return $prefix . "<a $classClause href=\"$link\">$val</a>";
} else { } else {
return $prefix . "<span $classClause>$val</span>"; return $prefix . "<span $classClause>$val</span>";