When I try to export a csv from of orders using the Expanded type I get a server error. Raw data and Line Items works as expected.
Steps to reproduce
Select orders from the list
Click Export and select Expanded export type
Click Export
Expected behavior
Get a CSV file
Actual behavior
Server error
Output from PHP error log
`[29-Aug-2022 11:38:09 Europe/Copenhagen] An Error occurred while handling another error:
TypeError: array_keys(): Argument #1 ($array) must be of type array, string given in /var/www/project/cms/vendor/craftcms/cms/src/web/CsvResponseFormatter.php:88
Stack trace:
What happened?
Description
When I try to export a csv from of orders using the Expanded type I get a server error. Raw data and Line Items works as expected.
Steps to reproduce
Expected behavior
Get a CSV file
Actual behavior
Server error
Output from PHP error log
`[29-Aug-2022 11:38:09 Europe/Copenhagen] An Error occurred while handling another error: TypeError: array_keys(): Argument #1 ($array) must be of type array, string given in /var/www/project/cms/vendor/craftcms/cms/src/web/CsvResponseFormatter.php:88 Stack trace:
0 /var/www/project/cms/vendor/craftcms/cms/src/web/CsvResponseFormatter.php(88): array_keys('Exception')
1 /var/www/project/cms/vendor/yiisoft/yii2/web/Response.php(1095): craft\web\CsvResponseFormatter->format(Object(craft\web\Response))
2 /var/www/project/cms/vendor/craftcms/cms/src/web/Response.php(286): yii\web\Response->prepare()
3 /var/www/project/cms/vendor/yiisoft/yii2/web/Response.php(339): craft\web\Response->prepare()
4 /var/www/project/cms/vendor/yiisoft/yii2/web/ErrorHandler.php(136): yii\web\Response->send()
5 /var/www/project/cms/vendor/craftcms/cms/src/web/ErrorHandler.php(192): yii\web\ErrorHandler->renderException(Object(yii\base\UnknownMethodException))
6 /var/www/project/cms/vendor/yiisoft/yii2/base/ErrorHandler.php(135): craft\web\ErrorHandler->renderException(Object(yii\base\UnknownMethodException))
7 /var/www/project/cms/vendor/craftcms/cms/src/web/ErrorHandler.php(66): yii\base\ErrorHandler->handleException(Object(yii\base\UnknownMethodException))
8 [internal function]: craft\web\ErrorHandler->handleException(Object(yii\base\UnknownMethodException))
9 {main}
Previous exception: yii\base\UnknownMethodException: Calling unknown method: craft\models\FieldLayout::getFields() in /var/www/project/cms/vendor/yiisoft/yii2/base/Component.php:300 Stack trace:
0 /var/www/project/cms/vendor/craftcms/commerce/src/exports/Expanded.php(50): yii\base\Component->__call('getFields', Array)
1 /var/www/project/cms/vendor/craftcms/cms/src/controllers/ElementIndexesController.php(324): craft\commerce\exports\Expanded->export(Object(craft\commerce\elements\db\OrderQuery))
2 [internal function]: craft\controllers\ElementIndexesController->actionExport()
3 /var/www/project/cms/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
4 /var/www/project/cms/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array)
5 /var/www/project/cms/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction('export', Array)
6 /var/www/project/cms/vendor/craftcms/cms/src/web/Application.php(301): yii\base\Module->runAction('element-indexes...', Array)
7 /var/www/project/cms/vendor/craftcms/cms/src/web/Application.php(625): craft\web\Application->runAction('element-indexes...', Array)
8 /var/www/project/cms/vendor/craftcms/cms/src/web/Application.php(280): craft\web\Application->_processActionRequest(Object(craft\web\Request))
9 /var/www/project/cms/vendor/yiisoft/yii2/base/Application.php(384): craft\web\Application->handleRequest(Object(craft\web\Request))
10 /var/www/project/cms/web/index.php(12): yii\base\Application->run()
11 {main}`
Craft CMS version
4.2.3
Craft Commerce version
4.1.0
PHP version
8.1
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions