Ajax not retrieving data

Hi,

I have a local Dolibarr instance v19.0.1 in XAMPP. I can reach it via https://dolibarr.localhost. What I have noticed though is that the AJAX calls are not handled correctly. For example, if I select a new service in a BOM (under MRP), an AJAX call is done to retrieve and change the unit. However, that call (in its original format) returns a 403. When I change the code to add the token the call does not return a 403, but nothing happens. I can see the unit is retrieved correctly from the database, but it seems the response is lost between the server and the client.

The underlying question is that I want to use the same mechanism to retrieve a subset of products based on a selected category. The user selects a category in dropdown 1, then dropdown 2 gets filtered to just the products of the category selected in dropdown 1. I have the same problem here: call reaches the server, sql is executed correctly, but response never reaches the client.

I must admit I’m quite new to the use of AJAX. For a couple of days I’ve searched a lot of forums (including the Dolibarr forum) but didn’t find a solution. Can someone point me in the right direction?

Thanks in advance!