An API call using format=php does not work in 12.1.0.
/ws.php?method=pwg.categories.getImages&format=php&per_page=2&recursive=true&order=random%20DESC
Error:
Got error 'PHP message: PHP Fatal error: Uncaught TypeError: get_class(): Argument #1 ($object) must be of type object, array given in /include/ws_protocols/php_encoder.php:13
Explictly converting to object fixes the problem temporarily.
13: $respClass = strtolower( @get_class((object) $response) );
Offline
PHP 8.1, no workie. An array is passed, but definition requires object:
https://www.php.net/manual/en/function.get-class
get_class(object $object = ?): string
Last edited by Zentalquabula (2021-12-04 13:28:34)
Offline
Casting anything to object isn't correct either. This pull request https://github.com/Piwigo/Piwigo/pull/1575 should fix things.
Until merged and released it should be applicable with
cd YourPiwigoDirectory curl https://github.com/Piwigo/Piwigo/commit/fa6575d9d4ae08b26853dde036bcd5b6ae5bd13c.patch | patch -p1
Offline