Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
An additional input for the collection is shown whenever I'm editing a node with a collection in it, which also will get added to the node whenever not removing it myself. However, editing a node doesn't mean I have to add something in the collection, so I wouldn't need the additional field. Also on creating a node I get the input for two collections, while I want to start with just one (users could add more using the link/button).
Has someone already addressed this issue?
Comments
Comment #1
LoyC CreditAttribution: LoyC commentedI can confirm this problem. It's very annoying on node edit page.
Comment #2
dinhthinh CreditAttribution: dinhthinh commentedWe can organize the node edit page with field group. Grouping some fields into a group, and field collection into a different group. that make me easy to manage the content in edit page.
Comment #3
LoyC CreditAttribution: LoyC commentedBut that don't solve the problem. Why is there an extra new field collection on every node edit?
Comment #4
dboeije CreditAttribution: dboeije commentedStill no response from any of the maintainers.
Comment #5
jmeyerson CreditAttribution: jmeyerson commentedSame issue here. Hoping for some advice. Patch, maybe?
Comment #6
RobW CreditAttribution: RobW commentedI believe this is a duplicate of #1239946: Embedded field collection items with a default value result in new items on save. There's a ton of discussion on how to fix it there, summed up by "it is very hard to decide when someone means to add a field with default values and when those default values are just added by Drupal."
Comment #7
dboeije CreditAttribution: dboeije commentedSorry, but I still think this should be fixed instead of having patches.
It's the choice of the user editing the note to add entries, in this way it ain't a choice and requires the user delete the additional entry on every edit of the node.
Comment #8
RobW CreditAttribution: RobW commentedAdding a new/empty field by default is behavior from core, not field collection. Pretty sure on that other issue there is a link to a core issue to change this.
All activity to fix this problem specifically for field collection is going on in the other issue. There's no difference between patches and fixing an issue -- they're two steps of the same process. First patches are submitted, then tested (which you can help with!) and when everyone agrees they solve the problem a maintainer commits them.
Because the problem described in both issues is the same, this one is a duplicate.