Shared Files - History files do not delete

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
7/2/2012 7:28:06 PM
Gravatar
Total Posts 63
Jerry McCreary
SureFire Studios, Inc.

Shared Files - History files do not delete

If "Keep File History" is checked in the Shared Files Settings, I've notice the following:

1) When a Shared File is deleted, that file's corresponding history uploads do not also also delete from the Shared Files history folder on the server.

2) When deleting a Shared File folder, files inside that folder do not get deleted from the server (only the DB records).

Looking at the source code, I see that files only delete from the server if "Keep File History" is not checked.

Example:

if (!config.EnableVersioning)
                {
                    fileSystem.DeleteFile(VirtualPathUtility.Combine(fileVirtualBasePath, sharedFile.ServerFileName));
                }

Is that the expected behavior? or am I'm missing something?

Thanks.

7/5/2012 10:57:33 AM
Gravatar
Total Posts 18439

Re: Shared Files - History files do not delete

Hi Jerry,

Yes I'm aware of this but haven't had time to think of a better solution. To me the keeping of version history is contrary to deleting a file, it should ideally be possible to recover a deleted file when version history is enabled. I'm not sure when I will get to a better solution but it seemed prudent to at least not physically delete the file in case someone really needed to recover it.

Ultimately I guess we will need to just flag a file as deleted when this is enabled and ad a page to find and recover deleted files. But its fairly low priority in the grand scheme of things in my plans. I may at some point make a pro version of Shared Files that would be more elaborate.

Best,

Joe

7/5/2012 11:27:51 AM
Gravatar
Total Posts 63
Jerry McCreary
SureFire Studios, Inc.

Re: Shared Files - History files do not delete

Joe,

Thanks for the reply. I decided to make a copy of the Shared Files solution to alter.
In doing so, I began to understand the dilemma.

The solution I've come up with does a couple of things.

1) Folders:  If a folder contains other folders or files, then hide/disable the delete function for that folder until its contents are deleted.

2) Files:  If a file has history, then either:
                        a)  hide/disable its delete function until its history is deleted; or
                        b)  allow only specified role to delete files with history and/or create extra confirmation steps to delete. 

Though, I may take your suggestion to just flag a file as deleted and create a recovery page.
 

-- Jerry

You must sign in to post in the forums. This thread is closed to new posts.