mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 06:05:56 +00: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(){
|
public function removefile(){
|
||||||
if($fileID = $this->urlParams['ID']){
|
if($fileID = $this->urlParams['ID']){
|
||||||
$file = DataObject::get_by_id('File', $fileID);
|
$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->delete();
|
||||||
$file->destroy();
|
$file->destroy();
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
</td>
|
</td>
|
||||||
<% if Can(delete) %>
|
<% if Can(delete) %>
|
||||||
<td width="18">
|
<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>
|
</td>
|
||||||
<% end_if %>
|
<% end_if %>
|
||||||
</tr>
|
</tr>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user