From 46b0f0c959d9467e390de12b4b164449bdb124ee Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Sat, 21 Nov 2009 02:32:43 +0000 Subject: [PATCH] ENHANCEMENT Deleting formatted images in Image->onBeforeDelete() git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@92556 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/model/Image.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/model/Image.php b/core/model/Image.php index f606d5d70..4ba1d7979 100755 --- a/core/model/Image.php +++ b/core/model/Image.php @@ -80,6 +80,13 @@ class Image extends File { return true; } } + + function onBeforeDelete() { + parent::onBeforeDelete(); + + // Delete the temp verions of this file in assets/_resampled + $this->deleteFormattedImages(); + } /** * Get the relative URL for this Image.