mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
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:
parent
819954b8b4
commit
5ab15da8fe
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user