Permalink
Browse files

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
  • Loading branch information...
1 parent 2845529 commit 0fe83d226489eaa936ed939e0b6d5688e1e7724c @lingo lingo committed with sminnee Jun 10, 2010
Showing with 3 additions and 2 deletions.
  1. +3 −2 code/AssetAdmin.php
View
@@ -421,7 +421,9 @@ public function deletemarked($urlParams, $form) {
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 @@ public function deletemarked($urlParams, $form) {
$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=&quot;font-size: 65%&quot;>" . $brokenPage->Breadcrumbs(3, true) . '</li>';
}
$brokenPageList .= '</ul>';
- Notifications::notifyByEmail("BrokenLink", "Page_BrokenLinkEmail");
} else {
$brokenPageList = '';
}

0 comments on commit 0fe83d2

Please sign in to comment.