mein erstes Posting hier im Forum
Ich habe folgendes Anliegen: in meiner Konfiguration ist der Parameter „g_absolute_path_default_upload_folder“ wie folgt definiert:
Code: Select all
# config/config_inc.php
$g_absolute_path_default_upload_folder = '/mnt/mantis.attachments/' . date( 'Y/m/d/' );
if( !is_dir( $g_absolute_path_default_upload_folder ) ) {
mkdir( $g_absolute_path_default_upload_folder, 0770, true );
}
Jedoch ist die Lösung nicht optimal, da beim jedem Update von Mantis (zur Zeit die Version 2.19.0) die Datei file_api.php angepasst werden muss:
Code: Select all
+++ file_api.php 2019-02-21 11:37:35.705041403 +0100
@@ -305,6 +305,18 @@
}
}
+ if( is_blank( $t_path ) ) {
+ $t_bug_file_table = db_get_table( 'bug_file' . 'table' );
+ db_param_push();
+ $t_query = 'SELECT folder FROM {bug_file} WHERE diskfile=' . db_param();
+ $t_result = db_query( $t_query, array( $t_basename));
+ $t_row = db_fetch_array( $t_result );
+ $t_diskfile = file_path_combine( $t_row['folder'], $t_basename );
+ if( file_exists( $t_diskfile ) ) {
+ return $t_diskfile;
+ }
+ }
+
$t_path = config_get_global( 'absolute_path_default_upload_folder' );
if( !is_blank( $t_path ) ) {
$t_diskfile = file_path_combine( $t_path, $t_basename );
Kennt Jemand vielleicht eine Lösung, die grundsätzlich ohne Anpassung gehen würde und die Anhänge nicht flach abgelegt werden müssen?
Vielen Dank
Jacek