View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0026439 | mantisbt | ui | public | 2019-12-08 20:52 | 2020-03-15 15:23 |
Reporter | xandros_darkstorm | Assigned To | dregad | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Target Version | 2.24.0 | Fixed in Version | 2.24.0 | ||
Summary | 0026439: Issue list throws warning on every issue without bug notes. | ||||
Description | When user opens issue list, the following warnings appear for each issue without bug notes: If issue gets a comment (bug note) two warnings disappear. | ||||
Steps To Reproduce |
| ||||
Additional Information | Server configuration: I have done some research and found that function "print_column_bugnotes_count" in "columns_api.php" causes the problem -- first if condition checks if "$t_bugnote_stats" is null, but never checks if it is "false". $t_bugnote_stats receives boolean value "false" from "bug_api.php" on line 1687 in foreach loop, which assigns that value for all issues without bug notes. | ||||
Tags | PHP 7.4 | ||||
Attached Files | |||||
Thanks for the detailed bug report. This problem is specific to PHP 7.4, due to implementation of https://wiki.php.net/rfc/notice-for-non-valid-array-container. In earlier versions, Array dereferencing a scalar value which is not a string silently yields NULL, i.e. without issuing an error message. (source: PHP manual, see note under example 7). |
|
MantisBT: master 8dc5ead4 2019-12-09 05:48 Details Diff |
bug_get_bugnote_stats() returns array|false, not NULL In PHP 7.3 and earlier, dereferencing a non-array variable simply returns NULL; starting with 7.4, a SYSTEM NOTICE is triggered. Adjusting the code to make sure the stats have indeed been returned (i.e. we got an array) instead of relying on a `!== null` check, which in any case wrong since bug_get_bugnote_stats() returns false, not NULL. Also update PHPDoc for bug_get_bugnote_stats() to reflect that. Fixes 0026439 |
Affected Issues 0026439 |
|
mod - core/bug_api.php | Diff File | ||
mod - core/columns_api.php | Diff File |