elofgren: BUGFIX: Fix issue with deleting pictures with 'X' delete link not removing thumbs in _resampled folder. Thanks to Mateusz for reporting this.

(merged from branches/gsoc)


git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@41964 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2007-09-15 21:57:11 +00:00
parent c3dc22e7b8
commit f7a1b199db
2 changed files with 5 additions and 1 deletions

View File

@ -628,6 +628,10 @@ if(!$record)
public function removefile(){
if($fileID = $this->urlParams['ID']){
$file = DataObject::get_by_id('File', $fileID);
// Delete the temp verions of this file in assets/_resampled
if($file instanceof Image) {
$file->deleteFormattedImages();
}
$file->delete();
$file->destroy();

View File

@ -23,7 +23,7 @@
</td>
<% if Can(delete) %>
<td width="18">
<a class="deletelink" href="$DeleteLink" title="Delete this file"><img src="cms/images/delete.gif" alt="delete" /></a>
<a class="deletelink" href="admin/assets/removefile/$ID" title="Delete this file"><img src="cms/images/delete.gif" alt="delete" /></a>
</td>
<% end_if %>
</tr>