Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: API get member or contact categories resets after n+1 categories and just shows the same over and over again #29425

Open
JonBendtsen opened this issue Apr 20, 2024 · 2 comments
Labels
Bug This is a bug (something does not work as expected)

Comments

@JonBendtsen
Copy link
Contributor

JonBendtsen commented Apr 20, 2024

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

get_member_categories_resets_after_n+1

@JonBendtsen JonBendtsen added the Bug This is a bug (something does not work as expected) label Apr 20, 2024
@JonBendtsen JonBendtsen changed the title BUG: API get member categories resets after n+1 categories and just shows the same over and over again BUG: API get member or contact categories resets after n+1 categories and just shows the same over and over again Apr 21, 2024
@JonBendtsen
Copy link
Contributor Author

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

@JonBendtsen
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This is a bug (something does not work as expected)
Projects
None yet
Development

No branches or pull requests

1 participant