I have Dolibarr 20.0.2, running on PHP 7.4. Everything is fine. I use REST API quite much. Works like a charm.
However, Dolibarr is the last thing still in PHP 7.4. All other company software is running PHP 8.3, and I would like to get Dolibarr working there also. Well, interactively it works on 8.3 just fine. But there is a problem with the API.
I have a tester code to send a reequest using curl like this:
and if my Dolibarr is running on PHP 7.4, it returns rather nicely
array(1) {
[0] =>
class stdClass#1 (155) {
public $module =>
string(7) "societe"
public $SupplierCategories =>
array(0) {
}
public $prefixCustomerIsRequired =>
NULL
public $entity =>
string(1) "1"
public $name =>
string(18) "Jari-Matti"
... and so on ...
but if Dolibarr is running on anyting above PHP 8.0, I get only NULL back!
The error coming back is
string(977) "<br />
<b>Fatal error</b>: Uncaught TypeError: realpath(): Argument #1 ($path) must be of type string, array given in /home/jardes/www/dolibarr/includes/restler/framework/Luracast/Restler/AutoLoader.php:163
Stack trace:
#0 /home/jardes/www/dolibarr/includes/restler/framework/Luracast/Restler/AutoLoader.php(163): realpath(Array)
#1 [internal function]: Luracast\Restler\AutoLoader->Luracast\Restler\{closure}(Array)
#2 /home/jardes/www/dolibarr/includes/restler/framework/Luracast/Restler/AutoLoader.php(161"...