View Issue Details

IDProjectCategoryView StatusLast Update
0037457mantisbtapi soappublic2026-10-26 07:43
ReporterSL-Gundam Assigned To 
PrioritylowSeveritytweakReproducibilityalways
Status confirmedResolutionopen 
Product Version2.23.0 
Target Version2.29.0 
Summary0037457: mci_file_add does not apply proper value for bugnote_id
Description

In the /admin/schema.php it says the following.

# 0 - file was added pre-2.23.0 and not explicitly linked to an issue or a note.
# null - file was added by 2.23.0 release or newer and associated with the issue.
# otherwise - file was added or linked by 2.23.0 release or newer and associated with an issue note.
$g_upgrade[210] = array( 'AddColumnSQL', array( db_get_table( 'bug_file' ), "
    bugnote_id          I       UNSIGNED DEFAULT '0' " ) );

mci_file_add does not respect this and always sets the bugnote_id to 0
I think this has to do with the default value being 0 and NULL not being specifically provided when adding the attachment.

TagsNo tags attached.

Relationships

related to 0021733 closedvboctor Attachments should be linkable to notes in db 

Activities

dregad

dregad

2026-10-26 07:43

developer   ~0071536

Thanks for the report, I believe your assessment is correct, in the context of calling mci_file_add () for issues, after implementation of 0021733 in 2.23.0, bugnote_id field should indeed be set to null.

This was covered in MantisBT master c9fafd4a, but only for file_add() function and IssueAddCommand - mc_issue_attachment_add() code path was forgotten.