mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX Count() call on a non-object in File::BackLinkTrackingCount() (from r109079)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112773 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
db8035e1a1
commit
e6976a8458
@ -169,7 +169,12 @@ class File extends DataObject {
|
||||
* @return Integer
|
||||
*/
|
||||
function BackLinkTrackingCount() {
|
||||
return $this->BackLinkTracking()->Count();
|
||||
$pages = $this->BackLinkTracking();
|
||||
if($pages) {
|
||||
return $pages->Count();
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -194,7 +199,8 @@ class File extends DataObject {
|
||||
protected function onAfterDelete() {
|
||||
parent::onAfterDelete();
|
||||
|
||||
if($brokenPages = $this->BackLinkTracking()) {
|
||||
$brokenPages = $this->BackLinkTracking();
|
||||
if($brokenPages) {
|
||||
$origStage = Versioned::current_stage();
|
||||
|
||||
// This will syncLinkTracking on draft
|
||||
|
Loading…
Reference in New Issue
Block a user