Skip to content

[5.x]: Invalid Configuration: Either sectionId or fieldId + ownerId must be set on the entry #16254

@jamiepittock

Description

@jamiepittock

What happened?

Description

I ran across this when attaching a behavior to our entries.

Event::on(
    Entry::class,
    Entry::EVENT_DEFINE_BEHAVIORS,
    function(DefineBehaviorsEvent $e) {
        if ($e->sender->getType()->handle === 'questionType') {
            $e->behaviors['questionTypeStats'] = QuestionTypeBehavior::class;
        }
    }
);

For nested matrix entries this seems to throw the error

Invalid Configuration – yii\base\InvalidConfigException
Either sectionId or fieldId + ownerId must be set on the entry.

These entries have a fieldId + primaryOwnerId, but no ownerId.

Image

Craft CMS version

5.5.3

PHP version

No response

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions