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.
This commit is contained in:
Michael Strong 2014-10-20 14:22:20 +13:00 committed by Ingo Schommer
parent 819954b8b4
commit 5ab15da8fe

View File

@ -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(
'<a href=\"' . $linkBase . '$ID\" title=\"%s\">$value</a>',
_t('BrokenLinksReport.HoverTitleEditPage', 'Edit page')
)
'formatting' => function($value, $item) use ($linkBase) {
return sprintf('<a href=\"%s\" title=\"%s\">%s</a>',
Controller::join_links($linkBase, $item->ID),
_t('BrokenLinksReport.HoverTitleEditPage', 'Edit page'),
$value
);
}
),
"LastEdited" => array(
"title" => $dateTitle,