Skip to content

[Live] Error when emptying a LiveCollection because of PersistentCollection instead of array #568

Closed
@jcrombez

Description

@jcrombez

Hello, i'm having an issue with ComponentWithFormTrait + LiveCollectionTrait.

I don't know what i could have done wrong but when removing all the element from a collection, when the last element is removed, the code fail because the field contains an empty PersistentCollection instead of the usual array. Before the collection is empty it's an array, it becomes a PeristentCollection when it's empty.
So the LiveFormUtility::removePathsNotInData used during ComponentWithFormTrait::submitForm fails when trying to call array_key_exists.

Any idea what could explain for the collection field to get filled with an empty PersistentCollection ?
Maybe the entity side can be of help to understand the problem :

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugBug Fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions