Skip to content

[BC] Collections with references to entities in __toString() are broken. #7628

@KDederichs

Description

@KDederichs

Describe the bug
When you have an entity in a collection field with a __toString() function that accesses an entity, you'll get an error.

I think that was introduces by 3f979b6 since now if you add entities it'll always add the same Name for the collection entry as well, prompting me to believe it'll generate the name once when rendering the template and using that as default name then.

I think the easiest solution here would be to just not try to render the name of the collection item when it's being added.

To Reproduce
Edit a Crud page with a collection of items that access an associated (or other) non initiated entity.

(OPTIONAL) Additional context
Error:
Image

It rendering the same name multiple times when adding entities without a __toString() function (first one was already there)
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions