View Issue Details

IDProjectCategoryView StatusLast Update
0033422mantisbtapi restpublic2024-02-20 16:58
Reporterdregad Assigned Todregad  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Target Version2.26.1Fixed in Version2.26.1 
Summary0033422: Updating an issue with bugnote having empty text causes PHP errors
Description
  1. REST API fails with HTTP 500 : Unhandled deprecation warning in .../mantis/core/database_api.php line 1158: 'preg_replace(): Passing null to parameter 0000003 ($subject) of type array|string is deprecated'

  2. Response body contains HTML with PHP warning : Undefined array key "text" in .../mantis/api/soap/mc_issue_api.php on line 1160

Steps To Reproduce

Example payload for PATCH /api/rest/issues/1 request

{
  "id": 1,
  "description": "updating bugnote",
  "notes": [
    {
      "id": 1033
    }
  ]
}

Note the missing text entry in bugnote 1033

TagsNo tags attached.

Activities

Related Changesets

MantisBT: master-2.26 89b538ab

2023-12-10 08:45

dregad


Details Diff
Fix exception when updating bugnote without text

REST API fails with HTTP 500 : Unhandled deprecation warning in
.../mantis/core/database_api.php line 1158: 'preg_replace(): Passing
null to parameter 0000003 ($subject) of type array|string is deprecated'

Fixes 0033422
Affected Issues
0033422
mod - core/database_api.php Diff File

MantisBT: master-2.26 4ed66fce

2023-12-10 08:46

dregad


Details Diff
Fix PHP warning in mc_issue_update()

Undefined array key "text" in .../mantis/api/soap/mc_issue_api.php on
line 1160

Fixes 0033422
Affected Issues
0033422
mod - api/soap/mc_issue_api.php Diff File