[mp_file] Renaming

Korchkidu - October 3, 2009 - 15:33
Project:Ubercart Marketplace
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs review
Description

Hi,

When a file is uploaded, it is renamed after the title of the node. If a name clash occurs, then it suffixed with the ID of the node. I believe it would be great to add a form where we could change this behavior. In my case for example, I prefer renaming the files directly after the ID of the node and avoid using the title.

Best regards.
K.

#1

Korchkidu - October 3, 2009 - 17:03

Hi,

I made some small changes to allow users to choose between different file renaming patterns (none, NodeTitle[_NodeId] or NodeId only). However, I am only a Drupal beginner so I am far from being sure that my changes are ok. So, if someone is ok to check if everthing is ok and merge them is the official version, it would be cool. My changes are easy to locate because they are surrounded by:
// BEGIN CHANGES: K. 2009.10.03
[code]
// END CHANGES: K. 2009.10.03

See modified files in attachments

Best regards.
K.

AttachmentSize
modified_files.zip 5.39 KB

#2

jbrodbeck - October 6, 2009 - 01:35
Status:active» needs review

I'll try to review in the next couple days.

#3

syndicateStorm - October 8, 2009 - 05:44

Looks great Korchkidu. I tried each of the cases and they seemed to work. This is definitely better than what was in there previously. I'm adding your changes to my version of mp_file. I'll let you know if I run into any problems. Thanks.

#4

Korchkidu - October 8, 2009 - 09:46

Thanks for your review.

K.

#5

keereel - October 20, 2009 - 19:36

syndicateStorm, where is "your version of mp_file"?

#6

syndicateStorm - October 25, 2009 - 15:55

Hi keereel,

The last mp_file I posted was on the Ubercart Marketplace 6.x thread. I saw you on there so I'm sure you've already found that.

The one posted there doesn't include this fix. You should have all the source code at your fingertips to make the change though.

mp_file is pending inclusion in the Ubercart Marketplace 6.x module, so we should probably wait for the maintainers to put this all together. Besides I have other changes in "my version" which are in progress. If you have problems integrating the code let me know, I'm happy to help.

#7

keereel - October 26, 2009 - 08:50

There is one thing that it is desirable that when renaming. The fact is that the renaming only supports the English language. Right, that the files should be called only in Latin letters, but the node may be called and in Russian, as well as the node author. (in my case; in general, I am thinking of other languages). It is highly desirable, when you rename the file, convert the string (for example, using the module http://drupal.org/project/transliteration, which is used to pathauto).

 
 

Drupal is a registered trademark of Dries Buytaert.