View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0034578 | mantisbt | api rest | public | 2024-08-13 09:00 | 2026-11-21 10:44 |
| Reporter | ctabin | Assigned To | community | ||
| Priority | normal | Severity | minor | Reproducibility | always |
| Status | resolved | Resolution | fixed | ||
| Product Version | 2.26.2 | ||||
| Target Version | 2.29.0 | Fixed in Version | 2.29.0 | ||
| Summary | 0034578: API - allow access to obsolete/inherited versions | ||||
| Description | Hello, Currently, once a version has been marked as Obsolete, it is not possible to access it through the REST-JSON API, since only the active versions are returned. | ||||
| Additional Information | A first basic proposal was made in this PR without parameters. | ||||
| Tags | No tags attached. | ||||
|
As mentioned in the PR review, the proposed basic fix is not acceptable as it would break backwards compatibility. A revised version of the code including a parameter is required. Feel free to ask if you need guidance. |
|
|
Unassigning, as PR author does not have time to finalize it |
|
|
I picked this up and submitted a revised fix addressing the review comments from PR 2019: https://github.com/mantisbt/mantisbt/pull/2313 The released, obsolete and inherit query parameters are only passed on when present, so the default behavior of GET /projects/{id}/versions is unchanged (released stays ternary when omitted). VersionGetCommand is untouched. The parameters are also documented in the OpenAPI definition. |
|
|
Thanks for taking over @dombn. I'll review the PR as soon as I can (I'm quite busy these days and the backlog of things to do keeps growing...) |
|
|
MantisBT: master 84c82397 2026-11-21 10:44 Committer: community Details Diff |
Allow filtering project versions in REST API GET /projects/{id}/versions ignored the released, obsolete and inherit query parameters, although VersionGetCommand supports them. Obsolete versions could therefore not be retrieved via the REST API at all. Parameters are only passed on to the command when present, so the default behavior is unchanged and released keeps its "all versions" state when omitted. Values are converted with gpc_string_to_bool(), since version_get_all_rows() checks obsolete with === false and a raw "0" string would otherwise include obsolete versions. Non-scalar values are rejected with HTTP 400. Also documents the parameters in the OpenAPI definition and adds REST tests for the obsolete and released filters. Fixes 0034578, PR https://github.com/mantisbt/mantisbt/pull/2313 |
Affected Issues 0034578 |
|
| mod - api/rest/mantisbt_openapi.yaml | Diff File | ||
| mod - api/rest/restcore/projects_rest.php | Diff File | ||
| mod - tests/rest/RestProjectVersionTest.php | Diff File | ||