U4-3154 - Deleting single media item in recycle bin does not use the FileSystemProvider

Created by Dirk 15 Oct 2013, 18:54:23 Updated by Dirk 28 Jun 2014, 15:37:19

Delete in tree context menu of a media item in the recycle bin triggers at least the PersistDeletedItem() function in file Umbraco-CMS\src\Umbraco.Core\Persistence\Repositories\MediaRepository.cs

A possible solution might be: replace

fs.FileExists(IOHelper.MapPath(property.Value.ToString()))

by

fs.FileExists(fs.GetRelativePath(property.Value.ToString()))

in the leading if clause.

Btw.: Later on there is this line of code: var parentDirectory = System.IO.Path.GetDirectoryName(relativeFilePath); The function GetDirectoryName(string relativeFilePathOrUrl) should be a member of IFileSystem I suggest;-)

Yours Dirk

Comments

Sebastiaan Janssen 27 Jun 2014, 14:34:12

Thanks, fixed in c53d812742824b446f4595b831fbfa2a5d1cb5d8 You're right, GetDirectoryName should've been included in that interface but changing it now would be a breaking change :(


Dirk 28 Jun 2014, 15:37:19

Works :-) H5YR


Priority: Normal

Type: Bug

State: Fixed

Assignee:

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted: Inline code

Affected versions:

Due in version: 7.1.5

Sprint:

Story Points:

Cycle: