View Issue Details

IDProjectCategoryView StatusLast Update
0037491mantisbtapi restpublic2026-11-06 07:29
Reporterkhushal Assigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
Status newResolutionopen 
Summary0037491: GET /api/rest/filters returns 500 when a saved filter has a category
Description

Problem
GET /api/rest/filters returns 500 when any saved filter the user can see (including public ones) filters on a category. One such filter breaks the whole list for every user on the instance.

Cause
Saved filters store the category name (e.g. "Desarrollo de Software"), but FilterConverter::convertCategoryArrayToJson() looks it up as a category id. The name is cast to 0, the category isn't found, and category_api.php:384 throws ERROR_CATEGORY_NOT_FOUND.
Names that start with a number (e.g. "1. Numbered") are cast to that number, so the API can silently return the wrong category.

Fix needed
Return the stored category name as is ({ "name": "..." }) instead of looking it up by id. Add REST tests for a filter with categories, including a number-prefixed name.

Steps To Reproduce
  1. Save a filter (public) with a category, e.g. "Desarrollo de Software".
  2. Call GET /api/rest/filters.
  3. Expected 200; actual 500.
TagsNo tags attached.

Activities