When an admin uploads a new logo for a community, the file is placed in that community's public file folder. Currently it has a few problems; it isn't viewable because it has no live revision (and causes a server error if you try to view details) and it has a lovely name like this: logo-comm.gif-C:\Documents and Settings\bergfeld_2\My Documents\docs\dotlrn\graphics\logo-comm.gif-3615
I tried a few things to improve the situation:
- changed the file's title to the friendlier Community Icon
- set the live revision properly
However, setting the live revision just moves us on to the next problem, which is that there is no template for an item of type "image". And on, and on.... each problem I fix just reveals another.
I finally decided to try approaching the problem from a different angle. There's really no reason for these files to show up in file storage at all; they really should just reside in the CR. The reason the file is in file-storage is simple; the file upload code deliberately sets the parent_id to that of the shared community folder when it calls cr_import_content.
I looked at other code which uses cr_import_content and saw that is is possible to set the parent_id to "", which I tried and that seemed to work fine. Now, before I go on and modify the upload and revert code for the logo to delete the existing item in the CR (as they will end up being orphaned otherwise), I wanted to ask the collective wisdom of the community if this is the best way to fix the problem? Perhaps there was some good reason for having this file in file storage that I'm just overlooking at the moment....