From f84180813f6ec7bd0548990432f751593e054cc8 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Thu, 15 Oct 2009 22:19:25 +0000 Subject: [PATCH] #150 - Pages with similar content #148 - Stable against restructures (from r87251) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@89174 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/model/SiteTree.php | 4 ++-- filesystem/File.php | 5 +++++ filesystem/Folder.php | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/core/model/SiteTree.php b/core/model/SiteTree.php index d533bb3c2..d653b8f1a 100755 --- a/core/model/SiteTree.php +++ b/core/model/SiteTree.php @@ -1321,10 +1321,10 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid } else { $this->HasBrokenLink = true; } - } else if($link == '' || $link[0] == '/') { - $this->HasBrokenLink = true; } else if($candidateFile = File::find(Convert::raw2sql(urldecode($link)))) { $linkedFiles[] = $candidateFile->ID; + } else if($link == '' || $link[0] == '/') { + $this->HasBrokenLink = true; } } diff --git a/filesystem/File.php b/filesystem/File.php index b91c71056..9f3dabd45 100755 --- a/filesystem/File.php +++ b/filesystem/File.php @@ -90,6 +90,11 @@ class File extends DataObject { function TreeTitle() { return $this->Name; } + + // Used by AssetTableField + function BackLinkTrackingCount() { + return $this->BackLinkTracking()->Count(); + } /** * Event handler called before deleting from the database. diff --git a/filesystem/Folder.php b/filesystem/Folder.php index d1bd0541f..9b75d42b2 100755 --- a/filesystem/Folder.php +++ b/filesystem/Folder.php @@ -328,7 +328,7 @@ class Folder extends File { $this, "Files", "File", - array("Title" => _t('Folder.TITLE', "Title"), "Filename" => _t('Folder.FILENAME', "Filename")), + array("Title" => _t('Folder.TITLE', "Title"), "Filename" => _t('Folder.FILENAME', "Filename")), "" ); $fileList->setFolder($this); @@ -498,4 +498,4 @@ class Folder_UnusedAssetsField extends CompositeField { return $assetList; } } -?> \ No newline at end of file +?>