Skip to content

[5.x]: Owner is not defined in a Seletable Entries Condition until after a block is saved #16945

@sgtpenguin

Description

@sgtpenguin

What happened?

Description

I have some entries fields that I want to prefilter to only show entries related to the current entry i.e. Articles related to a topic – I am editing the topic page and have various slots to feature articles. Since these entries fields are within matrix blocks in this context, I can accomplish this with twig by checking for owner and relating to the owner's id. Problem is, this doesn't work until after I save the entry with the new block added.

Image

Steps to reproduce

  1. Create an entries field inside a matrix block with related to {{ owner ? owner.id : id }}
  2. Try to select entries after adding that matrix block, before saving the parent entry.

Expected behavior

I would expect entries related to the owner id to show up in the entries picker

Actual behavior

No entries show up until the parent entry is saved

Craft CMS version

5.6.7

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