View Issue Details

IDProjectCategoryView StatusLast Update
0006534mantisbtadministrationpublic2009-12-15 04:48
ReporterManhuntMarkAssigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status acknowledgedResolutionopen 
Product Version1.0.0rc4 
Target VersionFixed in Version 
Summary0006534: move_db2disk does not use $g_absolute_path_default_upload_folder
Description

I've use the $g_absolute_path_default_upload_folder value to set my site's default upload folder to something other than my Mantis install location. I have about 95 files that got stored in the database before I setup DISK based storage, and I would like to move them to the disk.

All newly uploaded attachments are being stored just fine, so I know the directories are setup correctly. When I use the move_db2disk page, it keeps trying to write the files to my Mantis instal's root, which is of course read only.

I couldn't find any mention of the global default upload folder in the move_db2disk code.

TagsNo tags attached.

Activities

ManhuntMark

ManhuntMark

2005-12-25 12:00

reporter   ~0011845

I added the following to the get_prefix() function, just before the line that returns the dirname(FILE) value. It worked for me, although I had to follow up and manually correct the values in the database. The absolute path wasn't prepended to the diskfile values, but that was easy to identify and fix.

$t_default_upload_folder = config_get_global( 'absolute_path_default_upload_folder' );
if ( !empty($t_default_upload_folder) ) {
return $t_default_upload_folder;
}

2006-06-05 16:58

 

upload_path.patch (538 bytes)
--- mantis-1.0.3/admin/move_db2disk.php.orig	2006-06-05 15:55:27.000000000 -0400
+++ mantis-1.0.3/admin/move_db2disk.php	2006-06-05 15:55:13.000000000 -0400
@@ -98,6 +98,9 @@
 				$t_bug_id = $t_project_id;
 			}
 			$t_file_path = project_get_field( $t_project_id, 'file_path' );
+			if ($t_file_path == '') {
+			    $t_file_path = config_get_global( 'absolute_path_default_upload_folder' );
+			}
 			$prefix = get_prefix( $t_file_path );
 			$t_real_file_path = $prefix . $t_file_path;
 			$c_filename = file_clean_name($v_filename);
upload_path.patch (538 bytes)
urkle

urkle

2006-06-05 16:59

reporter   ~0012942

I've attached a cleaner patch that checks $t_file_path == '' for the project file path and fetches the global if it is empty.

Issue History

Date Modified Username Field Change
2005-12-25 11:04 ManhuntMark New Issue
2005-12-25 12:00 ManhuntMark Note Added: 0011845
2006-06-05 16:58 urkle File Added: upload_path.patch
2006-06-05 16:59 urkle Note Added: 0012942
2006-09-29 02:05 vboctor Status new => acknowledged
2006-09-29 02:05 vboctor Category upgrade => administration