I find that the directory names get too unweildy, and if i browse them on the file server they don't make sense. An example where this is confusing is where two fileshares have the same name, which happens when pages are nested in the menu system. An example might be breadcrumbed menus like:
home » members » file share
home » public » file share
To the user it is logical that these are different file share pages. However, the site admin sees something like
/files/file_share234
/files/file_share246
which is not very clear at all.
I'd propose adding a new field where the actual directory name can be specified on creation of the the fileshare. That way I could create member_file_share & pulic_file_share directories, but let both pages have the name 'file share'.
Obviously some rules are required.
You could require each file shares' directory to be unique.
OR, if the same directory is specified, they are in essence the same fileshare but with a different page context.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | fileshare-4.7.x-2.1.patch | 15.92 KB | Craig Gardner |
| #1 | fileshare_0.patch | 3.27 KB | Craig Gardner |
Comments
Comment #1
Craig Gardner commentedI thought I'd give it a try. We'll see how it works.
Comment #2
cboshuizen commentedThanks for the patch. This is a patch against 5.x, right? I'm using 4.7.6 on both my production and development servers, so I couldn't test it. Do you think it'd work if I tried to modify the 4.7.6 version file in the same way?
Chris
Comment #3
Craig Gardner commentedI'll see what I can do for you.
Comment #4
Craig Gardner commentedGive this one a try.
Go easy on me though, I'm new.
Comment #5
cboshuizen commentedThanks, I'm sure you are way ahead of me when it comes to patching modules.
Did you upload the right file though? This looks more like a release patch than the one you posted yesterday.
Chris
Comment #6
Craig Gardner commentedShould be pretty much the same. I did the same things when I created this one.
Comment #7
lvadillo commentedI've been testing the new feature with the 5.1 dev version.
I can change the name of the real directory instead of the defaulted "node name" + "node number", this is what we wanted.
I found the following:
1) The option to change the name becomes available after the node has been created, it's below the "Upload and New folder Options" when (I think/hope only when the "admin" is accesssing it). Can you please confirm that only the admin can change the name?
2) The name cannot be changed to one that is already being used. This I understand is a feature to be maintained and seems logical.
To have 2 fileshare nodes pointing to the same directory I still can resort to changing the path name in the node_fileshare table. CARE must be taken, as if one of those nodes is deleted the directory "is also" deleted!
---
Congratulations, this was the module I was hoping to have at hand a long time ago. Now I can do all type of file availability/exchange within Drupal.
Comment #8
Craig Gardner commented1) I can confirm that the only people that can change the filepath are those that you give "set file paths" permission.
2) That is correct and I really don't see any reason to have that any other way. I don't see why you would want to have multiple fileshares pointing to the same directory when you can have just one.
Comment #9
cboshuizen commentedSorry, now I am totally confused.
The 4.7 version patch you have supplied is 15 KB versus the 3 KB for the 5.0 version patch. When I run the patch 16 of the 20 hunks fail because they are already in the fileshare.module file that I am patching. With the 4 hunks that do get patched, I see no extra functionality at all.
Are you sure you uploaded the right file, or ran the diff against the two correct versions?
I'm using fileshare-4.7.x-2.1 with release date 2007-Jan-16:
I'm really looking forward to trying out your updates, and I hope I'm not being totally stupid here. Thanks!
Chris
Comment #10
cboshuizen commentedI worked it out. The patch creates the v4.7 module when run against the v5.0 module. That wasn't quite what I expected, but it's all fine now I worked that out. I hadn't realised that was how drupal releases worked, so sorry for the hassle.
I'm pleased to say I have it working now! It provides the essential functionality I was looking for, thank you!
I do have a couple of suggestions, if I may.
but, I'd like to also create a page with private access for privileged users to upload files. That page may need to say something like
This is something I've wanted to do quite often.
Another case is that where there is a pre-existing directory of files on the server, perhaps even unrelated to drupal. If user X decides to create a fileshare pointing to this directory for their own purposes, there is no reason why user Y cannot then make one, given that they might not even know of the existence of this other directory.
This latter example of course opens up the entire conundrum of fine-grained user permissions. For the site I administer we would never allow users to create their own fileshares anyway so the problem is avoided in my case, but I can see us hitting the first use case quite often.
Anyway, this patch is already great for cleaning up the fileshares I have, so I'll definitely be using it. Thank you again.
- Chris
Comment #11
lvadillo commentedAnswer to cgardner "I don't see why you would want to have multiple fileshares pointing to the same directory when you can have just one."
I let registered users to see the fileshare directory, but I need a smaller set of users to being able to add/delete files in the same directory, so, one group has the "Allow files to be uploaded to and deleted from this directory" set, and the other hasn't. Thus the need for dual nodes pointing to the same place. I have several instances of this, and not always the same users are allowed to modify. I use the module "node Privacy by Role" to modulate this.
Regards, Luis
Comment #12
Andrei Toutoukine commentedI tried to apply the patch but it did not worked for me (Drupal 4.7.x) until I've changed
$orig = node_load($node->nid);to$orig = node_load($node->nid, null, true);inside the
fileshare_update()function. This disables a cache of loaded nodes.PS. Thanks to cgardner for the patch!
Comment #13
Andrei Toutoukine commentedAnother bug is found. Maybe I should post it somewhere else... but still:
fileshare.module, line 459 must be: if(user_access('set file paths')) {