mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
BUGFIX: re-enable broken link notification using BackLinkTracking() (this was broken since r101127
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@106360 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
2845529234
commit
0fe83d2264
@ -421,7 +421,9 @@ HTML;
|
||||
if($fileList != "''") {
|
||||
$files = DataObject::get("File", "\"File\".\"ID\" IN ($fileList)");
|
||||
if($files) {
|
||||
$brokenPages = array();
|
||||
foreach($files as $file) {
|
||||
$brokenPages = array_merge($brokenPages, $file->BackLinkTracking()->toArray());
|
||||
if($file instanceof Image) {
|
||||
$file->deleteFormattedImages();
|
||||
}
|
||||
@ -431,13 +433,12 @@ HTML;
|
||||
$file->delete();
|
||||
$numFiles++;
|
||||
}
|
||||
if($brokenPages = Notifications::getItems('BrokenLink')) {
|
||||
if($brokenPages) {
|
||||
$brokenPageList = " ". _t('AssetAdmin.NOWBROKEN', 'These pages now have broken links:') . '</ul>';
|
||||
foreach($brokenPages as $brokenPage) {
|
||||
$brokenPageList .= "<li style="font-size: 65%">" . $brokenPage->Breadcrumbs(3, true) . '</li>';
|
||||
}
|
||||
$brokenPageList .= '</ul>';
|
||||
Notifications::notifyByEmail("BrokenLink", "Page_BrokenLinkEmail");
|
||||
} else {
|
||||
$brokenPageList = '';
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user