mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 09:05:53 +00: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');
|
$dateTitle = _t('BrokenLinksReport.ColumnDateLastPublished', 'Date last published');
|
||||||
}
|
}
|
||||||
|
|
||||||
$linkBase = singleton('CMSPageEditController')->Link('show') . '/';
|
$linkBase = singleton('CMSPageEditController')->Link('show');
|
||||||
$fields = array(
|
$fields = array(
|
||||||
"Title" => array(
|
"Title" => array(
|
||||||
"title" => _t('BrokenLinksReport.PageName', 'Page name'),
|
"title" => _t('BrokenLinksReport.PageName', 'Page name'),
|
||||||
'formatting' => sprintf(
|
'formatting' => function($value, $item) use ($linkBase) {
|
||||||
'<a href=\"' . $linkBase . '$ID\" title=\"%s\">$value</a>',
|
return sprintf('<a href=\"%s\" title=\"%s\">%s</a>',
|
||||||
_t('BrokenLinksReport.HoverTitleEditPage', 'Edit page')
|
Controller::join_links($linkBase, $item->ID),
|
||||||
)
|
_t('BrokenLinksReport.HoverTitleEditPage', 'Edit page'),
|
||||||
|
$value
|
||||||
|
);
|
||||||
|
}
|
||||||
),
|
),
|
||||||
"LastEdited" => array(
|
"LastEdited" => array(
|
||||||
"title" => $dateTitle,
|
"title" => $dateTitle,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user