fix file saving path for issue attachments

hunmonk - February 20, 2009 - 01:42
Project:Project issue tracking
Version:6.x-1.x-dev
Component:Miscellaneous
Category:bug report
Priority:normal
Assigned:hunmonk
Status:closed
Description

unfortunately, the new file API doesn't provide a way for outside modules to change the filepath prior to it saving a file, so in order to get issues into project issue's 'issues' directory, we have to catch the code right when it is actually inserting the comment or node, and move the file from files to files/issues, in both the file system and the {files} table.

after talking with one of the file API gurus, this seems like the only viable solution for 6.x, albeit a bit hackish. the attached patch has been running on d.o for a day now with no issues, so it's now been officially committed as the fix.

the only really wonky thing about this is that since the file gets saved then moved, the munging code gets run twice, and it can funkify the final filename a bit (ie, foo_0_0.patch) in certain circumstances.

AttachmentSize
pi_rewrite_issue_filepath_hack.patch3.53 KB

#1

System Message - March 6, 2009 - 01:50
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.