Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.x]: Type error trying to export entries #11127

Closed
wsydney76 opened this issue May 6, 2022 · 2 comments
Closed

[4.x]: Type error trying to export entries #11127

wsydney76 opened this issue May 6, 2022 · 2 comments

Comments

@wsydney76
Copy link

wsydney76 commented May 6, 2022

What happened?

Description

Export throws error:

2022-05-06 15:39:42 [web.ERROR] [TypeError] TypeError: craft\fields\BaseRelationField::_all(): Argument #1 ($query) must be of type craft\elements\db\ElementQueryInterface, Illuminate\Support\Collection given, called in E:\craft\filmdb\vendor\craftcms\cms\src\fields\BaseRelationField.php on line 509 and defined in E:\craft\filmdb\vendor\craftcms\cms\src\fields\BaseRelationField.php:1223
Stack trace:
#0 E:\craft\filmdb\vendor\craftcms\cms\src\fields\BaseRelationField.php(509): craft\fields\BaseRelationField->_all(Object(Illuminate\Support\Collection), Object(craft\elements\Entry))
#1 E:\craft\filmdb\vendor\craftcms\cms\src\elements\exporters\Expanded.php(65): craft\fields\BaseRelationField->serializeValue(Object(Illuminate\Support\Collection), Object(craft\elements\Entry))
#2 E:\craft\filmdb\vendor\craftcms\cms\src\controllers\ElementIndexesController.php(320): craft\elements\exporters\Expanded->export(Object(craft\elements\db\EntryQuery))
#3 [internal function]: craft\controllers\ElementIndexesController->actionExport()
#4 E:\craft\filmdb\vendor\yiisoft\yii2\base\InlineAction.php(57): call_user_func_array(Array, Array)
#5 E:\craft\filmdb\vendor\yiisoft\yii2\base\Controller.php(178): yii\base\InlineAction->runWithParams(Array)
#6 E:\craft\filmdb\vendor\yiisoft\yii2\base\Module.php(552): yii\base\Controller->runAction('export', Array)
#7 E:\craft\filmdb\vendor\craftcms\cms\src\web\Application.php(301): yii\base\Module->runAction('element-indexes...', Array)
#8 E:\craft\filmdb\vendor\craftcms\cms\src\web\Application.php(625): craft\web\Application->runAction('element-indexes...', Array)
#9 E:\craft\filmdb\vendor\craftcms\cms\src\web\Application.php(280): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#10 E:\craft\filmdb\vendor\yiisoft\yii2\base\Application.php(384): craft\web\Application->handleRequest(Object(craft\web\Request))
#11 E:\craft\filmdb\web\index.php(19): yii\base\Application->run()
#12 {main} {"memory":10953888,"exception":"[object] (TypeError(code: 0): craft\\fields\\BaseRelationField::_all(): Argument #1 ($query) must be of type craft\\elements\\db\\ElementQueryInterface, Illuminate\\Support\\Collection given, called in E:\\craft\\filmdb\\vendor\\craftcms\\cms\\src\\fields\\BaseRelationField.php on line 509 at E:\\craft\\filmdb\\vendor\\craftcms\\cms\\src\\fields\\BaseRelationField.php:1223)"} 

Steps to reproduce

  1. Entries index, Export -> Type: Expanded, Format: JSON

Expected behavior

Export file gets created

Actual behavior

see above

/Mel

Craft CMS version

4.0,1

PHP version

8.0.15

Operating system and version

Windows 10

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

brandonkelly added a commit that referenced this issue May 7, 2022
@brandonkelly
Copy link
Member

Thanks for reporting that! Fixed for the next release.

@brandonkelly
Copy link
Member

Craft 4.0.2 is out now with the fix for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants