mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
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:
parent
c3dc22e7b8
commit
f7a1b199db
@ -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();
|
||||
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user