Насколько я понял к сабжу относятся
вот эти изменения
Применил.
в первый раз выдало
Code: Select all
SYSTEM WARNING: 'copy(/usr/local/www/helpdesk/attachments/d6c3f266821fc2df691a9103e3e0642c) [function.copy]: failed to open stream: Permission denied' in '/usr/local/www/helpdesk/core/file_api.php' line 894
SYSTEM WARNING: 'chmod() [function.chmod]: No such file or directory' in '/usr/local/www/helpdesk/core/file_api.php' line 895
SYSTEM WARNING: 'copy(/usr/local/www/helpdesk/attachments/ee399a7514f6d8b58c937552f420cdd3) [function.copy]: failed to open stream: Permission denied' in '/usr/local/www/helpdesk/core/file_api.php' line 894
SYSTEM WARNING: 'chmod() [function.chmod]: No such file or directory' in '/usr/local/www/helpdesk/core/file_api.php' line 895
дал права на 660 на файлики в папке /usr/local/www/helpdesk/attachments/ и попытался еще раз.
выдало
Code: Select all
SYSTEM WARNING: 'copy() [function.copy]: Filename cannot be empty' in '/usr/local/www/helpdesk/core/file_api.php' line 894
SYSTEM WARNING: 'chmod() [function.chmod]: No such file or directory' in '/usr/local/www/helpdesk/core/file_api.php' line 895
SYSTEM WARNING: 'copy() [function.copy]: Filename cannot be empty' in '/usr/local/www/helpdesk/core/file_api.php' line 894
SYSTEM WARNING: 'chmod() [function.chmod]: No such file or directory' in '/usr/local/www/helpdesk/core/file_api.php' line 895
core/file_api.php строки с 860 по 914
Code: Select all
function file_copy_attachments( $p_source_bug_id, $p_dest_bug_id ) {
$t_mantis_bug_file_table = db_get_table( 'mantis_bug_file_table' );
$query = 'SELECT * FROM ' . $t_mantis_bug_file_table . ' WHERE bug_id = ' . db_param();
$result = db_query_bound( $query, Array( $p_source_bug_id ) );
$t_count = db_num_rows( $result );
$t_project_id = bug_get_field( $p_source_bug_id, 'project_id' );
$t_bug_file = array();
for( $i = 0;$i < $t_count;$i++ ) {
$t_bug_file = db_fetch_array( $result );
# prepare the new diskfile name and then copy the file
//$t_file_path = $t_bug_file['folder'];
$t_source_file = $t_bug_file['folder'] . $t_bug_file['diskfile'];
if(( config_get( 'file_upload_method' ) == DISK ) ) {
$t_source_file = file_normalize_attachment_path( $t_source_file, $t_project_id );
$t_file_path = dirname( $t_source_file ) . DIRECTORY_SEPARATOR;
} else {
$t_file_path = $t_bug_file['folder'];
}
$t_new_diskfile_name = $t_file_path . file_generate_unique_name( 'bug-' . $t_bug_file['filename'], $t_file_path );
$t_new_file_name = file_get_display_name( $t_bug_file['filename'] );
if(( config_get( 'file_upload_method' ) == DISK ) ) {
//copy( $t_file_path.$t_bug_file['diskfile'], $t_new_diskfile_name );
//chmod( $t_new_diskfile_name, config_get( 'attachments_file_permissions' ) );
# Skip copy operation if file does not exist (i.e. target bug will have missing attachment)
# @todo maybe we should trigger an error instead in this case ?
if( file_exists( $t_source_file ) ) {
copy( $t_source_file, $t_new_diskfile_location );
chmod( $t_new_diskfile_location, config_get( 'attachments_file_permissions' ) );
}
}
$query = "INSERT INTO $t_mantis_bug_file_table
( bug_id, title, description, diskfile, filename, folder, filesize, file_type, date_added, content )
VALUES ( " . db_param() . ",
" . db_param() . ",
" . db_param() . ",
" . db_param() . ",
" . db_param() . ",
" . db_param() . ",
" . db_param() . ",
" . db_param() . ",
" . db_param() . ",
" . db_param() . ");";
//db_query_bound( $query, Array( $p_dest_bug_id, $t_bug_file['title'], $t_bug_file['description'], $t_new_diskfile_name, $t_new_file_name, $t_bug_file['folder'], $t_bug_file['filesize'], $t_bug_file['file_type'], $t_bug_file['date_added'], $t_bug_file['content'] ) );
db_query_bound( $query, Array( $p_dest_bug_id, $t_bug_file['title'], $t_bug_file['description'], $t_new_diskfile_name, $t_new_file_name, $t_file_path, $t_bug_file['filesize'], $t_bug_file['file_type'], $t_bug_file['date_added'], $t_bug_file['content'] ) );
}
}
Или еще где-то что-то надо поменять?
п.с. заявки новые создаются, но файлики в них - "Вложение отсутствует"