Project

General

Profile

Actions

Defect #40099

closed

User api filtering by status=* broke on upgrade from 5.0 to 5.1

Added by Joan J 4 months ago. Updated 3 months ago.

Status:
Closed
Priority:
Normal
Category:
REST API
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

I am testing the migration path from 5.0.5 to 5.1.1, we use an api call to get all users (active or not), since the user api shows only the active accounts we where using "status=" or "status=*" as a modifier to get all the fields

I've got the "status=" from this issue https://www.redmine.org/issues/32090

On 5.1.1, for any call with "status=" we get with the http code 422:
{
"errors": [
"Status cannot be blank"
]
}

When I am using the filter "status=*" the exit code is 500, and on the logs i see:

I, [2024-01-23T13:20:22.820689 #2787502] INFO -- : [0a29895f-ece3-4229-9e91-eeee48cdc573] Completed 500 Internal Server Error in 21ms (ActiveRecord: 5.1ms | Allocations: 3061)
F, [2024-01-23T13:20:22.822546 #2787502] FATAL -- : [0a29895f-ece3-4229-9e91-eeee48cdc573]
[0a29895f-ece3-4229-9e91-eeee48cdc573] ActiveRecord::StatementInvalid (PG::InvalidTextRepresentation: ERROR: invalid input syntax for type integer: "*"
LINE 1: ...1, $2) AND (users.status <> 0) AND ((users.status IN ('*')))
^
):
[0a29895f-ece3-4229-9e91-eeee48cdc573]
[0a29895f-ece3-4229-9e91-eeee48cdc573] app/controllers/users_controller.rb:64:in `index'


Related issues

Related to Redmine - Patch #40124: Remove deprecated empty status param to get all users from APIClosedMarius BĂLTEANU

Actions
Has duplicate Redmine - Feature #32090: REST API: users: add support for status=*Closed

Actions
Actions

Also available in: Atom PDF