I remember this used to be possible: set a default value for the field collection's fields for each entity the field collection is added to. I believe this was removed in favour of a single set of default values per field collection, and that this was largely a result of the per-instance "default value" form causing difficulties if there were also required fields which should not have default values. See #1239946: Embedded field collection items with a default value result in new items on save, comment #5 by fago.

I now have a project where I need a trusted admin to be able to set different default values per-instance. The field collection in this case does not contain any required fields. Perhaps this could be restored as a configurable option:

(•) Use the global default values
( ) Set default values for this [entity-type]

If no solution is possible for the required fields issue(s), the second option above could perhaps include some help text to explain the potential problems for required fields. Alternately, perhaps the options above should only be presented if the field collection does not contain any required fields.

Comments

John Pitcairn’s picture

The "new items on save" problem can possibly be avoided if an initial empty field collection is not added by default, and the user is explicitly required to add one - ie there is just an "add" button.

See #1788222: Allow "add another" button instead of empty field collection item form when using the embedded widget

John Pitcairn’s picture

Issue summary: View changes

removed accidental html

bunthorne’s picture

Issue summary: View changes

I could use this feature, or something like it. I have pages for Theatrical Productions which have as a Field collection the listing of individual Performance Dates/Times and their respective Venue, Tickets URL, Phone, etc. For most Productions, only the date/time changes for each new FC item, while the Venue and Tickets URL is typically the same as the one listed on the Production page itself.

So what I'm looking for is the ability to either (1) default a value from the parent Page that the FC is attached to, or (2) copy the item for each new FC item from the last one entered in that collection.

Any chances someone can help with that?