Open JonBendtsen opened 3 months ago
SAME issues applies for getting categories of contacts
http://localhost/api/index.php/contacts/1/categories?sortfield=s.rowid&sortorder=ASC&limit=2&page=3
IF member and contact categories had pagination like explained here #29402, then I would not have to keep trying until it fails - which in case of member and contact categories it never fails, just loops forever. If I had pagination I could ask if that was present and if so I could just ask for that.
Bug
BUG: API get member or contact categories resets after n+1 categories and just shows the same over and over again.
Dolibarr Version
20.0.0-alpha + 18.0.5
Environment PHP
8.2.7
Environment Database
1:11.0.3+maria~ubu2204
Steps to reproduce the behavior and expected behavior
create 3 categories for members. Use the API to get all categories, you get 3 as expected. set limit to 1 and page to 0, 1, 2 and you get what you expect. page 3 is an error, page 4 and up shows page 0 result.
now, set limit to 2, and page to 0, 1, 2, 3, ... and you keep getting the same result over and over and over.
Attached files