View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0035668 | mantisbt | api rest | public | 2025-03-27 09:11 | 2025-05-03 19:31 |
Reporter | pikachurus | Assigned To | dregad | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 2.26.4 | ||||
Target Version | 2.27.2 | Fixed in Version | 2.27.2 | ||
Summary | 0035668: can't change issue category to "no category" via rest api | ||||
Description | Hi! trying to change issue category to "(no category)" via api by setting id to 0, but returns "Category not found": Invoke-RestMethod : {"message":"Category '{\"id\":\"0\"}' not found.","code": | ||||
Tags | No tags attached. | ||||
@pikachurus do you have set |
|
yes, $g_allow_no_category = ON; I'll be able to check with 2.26.3 in a few days. btw, in web interface i can change category to 'no category' with no problem. |
|
The reported behavior is reproducible in 2.26.4 and the latest master branch with the request below. It appears to be a regression introduced by the fix for 0034683 - in 2.26.3 the same request does clear the category.
Response code: 404 (Category '{"id":0}' not found.); Time: 71ms (71 ms); Content length: 92 bytes (92 B) For the record, with MantisBT 2.26.4 and later it is currently possible to unset the category with the following payload. At this time I am not sure whether this is actually correct or even intentional, but at least for now you can use that as a workaround. |
|
MantisBT: master f97ee460 2025-03-28 20:54 Details Diff |
Fix regression in mci_get_category_id() REST API was not allowing to unset the Category when updating an Issue with $g_allow_no_category = ON with a payload `{"category": {"id": 0}}`. Regression in mci_get_category_id() function, introduced by commit 656f93eebaf033f4b5bf34f17487db6346f12d8a (Issue 0034683). Fixes 0035668 |
Affected Issues 0034683, 0035668 |
|
mod - api/soap/mc_api.php | Diff File | ||
MantisBT: master e66c63e5 2025-04-20 12:16 Details Diff |
Add tests for REST API update issue Category Issue 0035668 |
Affected Issues 0035668 |
|
add - tests/rest/RestIssueUpdateCategory.php | Diff File | ||
MantisBT: master 1ccc4205 2025-04-20 12:20 Details Diff |
Fix incorrect behavior in mci_get_category_id() Now properly throws a ClientException when the given Category Id is not an integer. Fixes 0035668 |
Affected Issues 0035668 |
|
mod - api/soap/mc_api.php | Diff File | ||
MantisBT: master-2.27 01f3d24e 2025-04-20 12:20 Details Diff |
Fix regression in mci_get_category_id() REST API was not allowing to unset the Category when updating an Issue with $g_allow_no_category = ON with a payload `{"category": {"id": 0}}`. Regression in mci_get_category_id() function, introduced by commit 656f93eebaf033f4b5bf34f17487db6346f12d8a (Issue 0034683). Fixes 0035668 Backported from master branch (cherry picked commits f97ee460815ff14b31462d1da0a48405d0acb363 and 1ccc4205e50c23d47009073d85423d29c4cae449). |
Affected Issues 0034683, 0035668 |
|
mod - api/soap/mc_api.php | Diff File |