Skip to content

Owner of collection is not set on collection items by collection form field #4184

Closed
@gzankevich

Description

@gzankevich

Essentially the issue outlined here: http://stackoverflow.com/questions/8748785/symfony2-collection-form-does-not-fill-join-column

Expected outcome:

When adding new collection items using a collection form field, the owner of the collection items is set.

Actual outcome:

The owner of the collection items is not set.

Steps to reproduce:

  1. Create two entities with a one-to-many association (i.e. Office(id) ----< Contact(id)) - enable cascading persists on office.contact.
  2. Create form types for the two entities, setting office.contact as a collection form field and the necessary actions & template.
  3. Add a Contact using the form and save it in the action.
  4. The resulting Contact will have a NULL office_id.

The workaround is to manually iterate over office.contacts and set the office on them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions