Skip to content

Collection add generates invalid new name / keys when using subcollection #221

@joschi127

Description

@joschi127

First of all: thanks a lot for the awesome Bootstrap forms integration for Symfony. I started implementing the same thing, but much simpler, myself and then came across your bundle and I like it very much and it saved me a lot of time.

One problem tough when using collections:

As far as I can see there is a bug in bc-bootstrap-collection.js.

I can also reproduce it on the playground page: http://bootstrap.braincrafted.com/playground/forms.html

Steps to reproduce:

  • use 2 levels of collection (a collection with a subcollection)
  • remove all entries or start with an empty collection
  • add entry 1
  • add sub entry 1.1
  • add entry 2
  • add sub entry 2.1

=> entry 1 will have key [0] and entry 1.1 will have the keys [0] [0] - which is correct

=> entry 2 will have key [2] but entry 2.1 will have the keys [1] [1] - I think entry 2 should have the key [1] instead of [2]

Thanks!

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