View Issue Details

IDProjectCategoryView StatusLast Update
0037315mantisbtcode cleanuppublic2026-07-18 12:44
Reporterdregad Assigned Todregad  
PrioritynormalSeveritytweakReproducibilityN/A
Status resolvedResolutionfixed 
Target Version2.29.0Fixed in Version2.29.0 
Summary0037315: Avoid SQL query duplication in bugnote API
Description

Nearly identical SQL query is used both in bugnote_get_all_bugnotes() and in bugnote_exists(). It should be factored out.

TagsNo tags attached.

Activities

There are no notes attached to this issue.

Related Changesets

MantisBT: master 70c90e79

2026-06-03 12:01

dregad


Details Diff
Avoid duplicating SQL statement

Nearly identical SQL query is used both in bugnote_get_all_bugnotes()
and in bugnote_exists().

Define a constant to extract the common part, and use DbQuery to build
the differing WHERE clause and ORDER BY.

Add type declarations to bugnote_get_all_bugnotes(), so we don't need to
cast $p_bug_id to int all the time.

Fixes 0037315
Affected Issues
0037315
mod - core/bugnote_api.php Diff File