From 0df0a2965bfef465493bd2bd297df3d0ed00309d Mon Sep 17 00:00:00 2001 From: Roland Becker Date: Mon, 30 Mar 2020 22:11:06 +0200 Subject: [PATCH] Fix regression when adding files to project documentation Fixes #26835 --- core/file_api.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/file_api.php b/core/file_api.php index 06ebc5a1a4..9756001deb 100644 --- a/core/file_api.php +++ b/core/file_api.php @@ -893,10 +893,11 @@ function file_add( $p_bug_id, array $p_file, $p_table = 'bug', $p_title = '', $p 'filesize' => $t_file_size, 'file_type' => $p_file['type'], 'date_added' => $p_date_added, - 'user_id' => (int)$p_user_id, - 'bugnote_id' => is_null( $p_bugnote_id ) ? null : (int)$p_bugnote_id + 'user_id' => (int)$p_user_id ); - + if( 'bug' == $p_table ) { + $t_param['bugnote_id'] = is_null( $p_bugnote_id ) ? null : (int)$p_bugnote_id; + } # Oracle has to update BLOBs separately if( !db_is_oracle() ) { $t_param['content'] = $c_content;