Skip to content

Instantly share code, notes, and snippets.

@patches-76431
Last active August 29, 2015 13:57
Show Gist options
  • Select an option

  • Save patches-76431/9604486 to your computer and use it in GitHub Desktop.

Select an option

Save patches-76431/9604486 to your computer and use it in GitHub Desktop.
Fixes attach_form for field_collections
diff --git a/field_collection.module b/field_collection.module
index 3a08d04..a6af5de 100644
--- a/field_collection.module
+++ b/field_collection.module
@@ -1256,7 +1256,7 @@ function field_collection_field_attach_form($entity_type, $entity, &$form, &$for
if ($field_info['type'] == 'field_collection' && $field_settings['hide_blank_items']
&& field_access('edit', $field_info, $entity_type)
&& $form_state['field'][$field_name][$lang]['instance']['widget']['type'] != 'field_collection_hidden'
- && $form[$field_name][$lang]['#max_delta'] >= 0) {
+ && $form[$field_name][$lang]['#max_delta'] > 0) {
// Check for hide blank item(s) exceptions.
$exceptions = array_filter($field_settings['hide_blank_items_exceptions']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment