In PHP 7.4 we are using this code when saving some data to a MySQL database with F3's database functions:
$product->copyFrom('POST');
However, with the same code in PHP 8+ it complains about 'Array to string conversion':
AH01071: Got error 'PHP message: Array to string conversion; PHP message: [lib/db/sql.php:137] ; PHP message: [lib/db/sql.php:137] Base->{closure}(); PHP message: [lib/db/sql/mapper.php:101] DB\\SQL->value(); PHP message: [lib/db/sql/mapper.php:688] DB\\SQL\\Mapper->set();
This is only an issue when the POST data is a multidimensional array. If the POST data is a simple array (non-multidimensional) it works fine.
Is there any way to make the copyFrom function work the same as before without erroring in PHP8 or do we need to prepare/filter the POST data so it's not multidimensional with a callback function?
For reference we are using F3 version 3.8.
Thanks,
Chris