From 5ab15da8feefb5425ec575bde422b9e9ac09b50d Mon Sep 17 00:00:00 2001 From: Michael Strong Date: Mon, 20 Oct 2014 14:22:20 +1300 Subject: [PATCH] Concat links in "broken links" report (fixes #1117) Fixes operation with any modules that add GET parameters to CMS links, such as the Translatable module. Pull request by @micmania1, see https://github.com/silverstripe/silverstripe-cms/pull/1118. Modified by @chillu based on peer review feedback. --- code/reports/BrokenLinksReport.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/code/reports/BrokenLinksReport.php b/code/reports/BrokenLinksReport.php index 2a46dd22..f030bc30 100644 --- a/code/reports/BrokenLinksReport.php +++ b/code/reports/BrokenLinksReport.php @@ -79,14 +79,17 @@ class BrokenLinksReport extends SS_Report { $dateTitle = _t('BrokenLinksReport.ColumnDateLastPublished', 'Date last published'); } - $linkBase = singleton('CMSPageEditController')->Link('show') . '/'; + $linkBase = singleton('CMSPageEditController')->Link('show'); $fields = array( "Title" => array( "title" => _t('BrokenLinksReport.PageName', 'Page name'), - 'formatting' => sprintf( - '$value', - _t('BrokenLinksReport.HoverTitleEditPage', 'Edit page') - ) + 'formatting' => function($value, $item) use ($linkBase) { + return sprintf('%s', + Controller::join_links($linkBase, $item->ID), + _t('BrokenLinksReport.HoverTitleEditPage', 'Edit page'), + $value + ); + } ), "LastEdited" => array( "title" => $dateTitle,