I'm getting an internal server error when I attempt to alias an entries field to the identifier author.
{
"errors": [
{
"debugMessage": "Cannot assign craft\\elements\\Entry to property craft\\elements\\Entry::$_author of type craft\\elements\\User|false|null",
"message": "Internal server error",
"extensions": {
"category": "internal"
},
"file": "/my-path/vendor/craftcms/cms/src/elements/Entry.php",
"line": 1576,
"trace": [
{
"file": "/my-path/vendor/craftcms/cms/src/services/Elements.php",
"line": 3061,
"call": "craft\\elements\\Entry::setEagerLoadedElements('author', array(1))"
},
{
"file": "/my-path/vendor/craftcms/cms/src/services/Elements.php",
"line": 2874,
"call": "craft\\services\\Elements::_eagerLoadElementsInternal('craft\\elements\\Entry', array(1), array(1))"
},
{
"file": "/my-path/vendor/craftcms/cms/src/elements/db/ElementQuery.php",
"line": 3111,
"call": "craft\\services\\Elements::eagerLoadElements('craft\\elements\\Entry', array(1), array(1))"
},
{
"file": "/my-path/vendor/craftcms/cms/src/elements/db/ElementQuery.php",
"line": 1542,
"call": "craft\\elements\\db\\ElementQuery::_createElements(array(1))"
},
{
"file": "/my-path/vendor/yiisoft/yii2/db/Query.php",
"line": 251,
"call": "craft\\elements\\db\\ElementQuery::populate(array(1))"
},
{
"file": "/my-path/vendor/craftcms/cms/src/db/Query.php",
"line": 247,
"call": "yii\\db\\Query::all(null)"
},
{
"file": "/my-path/vendor/craftcms/cms/src/elements/db/ElementQuery.php",
"line": 1581,
"call": "craft\\db\\Query::all(null)"
},
{
"file": "/my-path/vendor/craftcms/cms/src/gql/base/ElementResolver.php",
"line": 51,
"call": "craft\\elements\\db\\ElementQuery::all()"
},
{
"file": "/my-path/vendor/craftcms/cms/src/gql/queries/Entry.php",
"line": 110,
"call": "craft\\gql\\base\\ElementResolver::resolve(null, array(2), array(2), instance of GraphQL\\Type\\Definition\\ResolveInfo)"
},
{
"file": "/my-path/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php",
"line": 623,
"call": "craft\\gql\\queries\\Entry::craft\\gql\\queries\\{closure}(null, array(2), array(2), instance of GraphQL\\Type\\Definition\\ResolveInfo)"
},
{
"file": "/my-path/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php",
"line": 549,
"call": "GraphQL\\Executor\\ReferenceExecutor::resolveFieldValueOrError(instance of GraphQL\\Type\\Definition\\FieldDefinition, instance of GraphQL\\Language\\AST\\FieldNode, instance of Closure, null, instance of GraphQL\\Type\\Definition\\ResolveInfo)"
},
{
"file": "/my-path/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php",
"line": 1195,
"call": "GraphQL\\Executor\\ReferenceExecutor::resolveField(GraphQLType: Query, null, instance of ArrayObject(1), array(1))"
},
{
"file": "/my-path/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php",
"line": 264,
"call": "GraphQL\\Executor\\ReferenceExecutor::executeFields(GraphQLType: Query, null, array(0), instance of ArrayObject(1))"
},
{
"file": "/my-path/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php",
"line": 215,
"call": "GraphQL\\Executor\\ReferenceExecutor::executeOperation(instance of GraphQL\\Language\\AST\\OperationDefinitionNode, null)"
},
{
"file": "/my-path/vendor/webonyx/graphql-php/src/Executor/Executor.php",
"line": 156,
"call": "GraphQL\\Executor\\ReferenceExecutor::doExecute()"
},
{
"file": "/my-path/vendor/webonyx/graphql-php/src/GraphQL.php",
"line": 161,
"call": "GraphQL\\Executor\\Executor::promiseToExecute(instance of GraphQL\\Executor\\Promise\\Adapter\\SyncPromiseAdapter, instance of GraphQL\\Type\\Schema, instance of GraphQL\\Language\\AST\\DocumentNode, null, array(2), null, 'MyQuery', null)"
},
{
"file": "/my-path/vendor/webonyx/graphql-php/src/GraphQL.php",
"line": 93,
"call": "GraphQL\\GraphQL::promiseToExecute(instance of GraphQL\\Executor\\Promise\\Adapter\\SyncPromiseAdapter, instance of GraphQL\\Type\\Schema, 'query MyQuery {\n recipesEntries(slug: \"the-last-word\") {\n ... on recipes_default_Entry {\n author: authorEntry {\n title\n }\n }\n }\n}\n', null, array(2), null, 'MyQuery', null, array(26))"
},
{
"file": "/my-path/vendor/craftcms/cms/src/services/Gql.php",
"line": 506,
"call": "GraphQL\\GraphQL::executeQuery(instance of GraphQL\\Type\\Schema, 'query MyQuery {\n recipesEntries(slug: \"the-last-word\") {\n ... on recipes_default_Entry {\n author: authorEntry {\n title\n }\n }\n }\n}\n', null, array(2), null, 'MyQuery', null, array(26))"
},
{
"file": "/my-path/vendor/craftcms/cms/src/controllers/GraphqlController.php",
"line": 195,
"call": "craft\\services\\Gql::executeQuery(instance of craft\\models\\GqlSchema, 'query MyQuery {\n recipesEntries(slug: \"the-last-word\") {\n ... on recipes_default_Entry {\n author: authorEntry {\n title\n }\n }\n }\n}\n', null, 'MyQuery', true)"
},
{
"call": "craft\\controllers\\GraphqlController::actionApi()"
},
{
"file": "/my-path/vendor/yiisoft/yii2/base/InlineAction.php",
"line": 57,
"function": "call_user_func_array(array(2), array(0))"
},
{
"file": "/my-path/vendor/yiisoft/yii2/base/Controller.php",
"line": 178,
"call": "yii\\base\\InlineAction::runWithParams(array(2))"
},
{
"file": "/my-path/vendor/yiisoft/yii2/base/Module.php",
"line": 552,
"call": "yii\\base\\Controller::runAction('api', array(2))"
},
{
"file": "/my-path/vendor/craftcms/cms/src/web/Application.php",
"line": 305,
"call": "yii\\base\\Module::runAction('graphql/api', array(2))"
},
{
"file": "/my-path/vendor/craftcms/cms/src/web/Application.php",
"line": 606,
"call": "craft\\web\\Application::runAction('graphql/api', array(2))"
},
{
"file": "/my-path/vendor/craftcms/cms/src/web/Application.php",
"line": 284,
"call": "craft\\web\\Application::_processActionRequest(instance of craft\\web\\Request)"
},
{
"file": "/my-path/vendor/yiisoft/yii2/base/Application.php",
"line": 384,
"call": "craft\\web\\Application::handleRequest(instance of craft\\web\\Request)"
},
{
"file": "/my-path/web/index.php",
"line": 12,
"call": "yii\\base\\Application::run()"
}
]
}
],
"data": {
"recipesEntries": null
}
}
Not sure exactly other than that it's linux, but it's running in a docker container based on php:8.2-fpm
What happened?
Description
I'm getting an internal server error when I attempt to alias an entries field to the identifier
author.Steps to reproduce
authors. Fields don't matter.recipesauthorEntry) so the content author can choose anauthorsentry.authorsentry and arecipesentry (mine has slugthe-last-word), in which the author is selected.Expected behavior
Getting the author entry's title back, looking something like
Actual behavior
Notes:
authorfield?Also:
Craft CMS version
4.5.11.1
PHP version
8.2.7
Operating system and version
Not sure exactly other than that it's linux, but it's running in a docker container based on
php:8.2-fpmDatabase type and version
Postgres 14
Image driver and version
Imagick
Installed plugins and versions