Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
drupal.org
field_collection
Commits
8b31b3f9
Commit
8b31b3f9
authored
Mar 01, 2019
by
egorlaw
Committed by
Ra Mänd
Mar 01, 2019
Browse files
Issue #2852783 by eglaw, dkrcni: 'Hide initial item' setting is broken
parent
d638900d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
field_collection.module
field_collection.module
+3
-2
No files found.
field_collection.module
View file @
8b31b3f9
...
...
@@ -1310,8 +1310,9 @@ function field_collection_field_attach_form($entity_type, $entity, &$form, &$for
// Remove blank form elements and force user to explicitly add a field
// collection if both 'hide_initial_item' and 'hide_blank_items' are TRUE.
if
(
$field
[
'settings'
][
'hide_initial_item'
]
&&
$field
[
'settings'
][
'hide_blank_items'
]
&&
field_collection_item_is_empty
(
$form
[
$field_name
][
$element_langcode
][
0
][
'#entity'
]))
{
&&
$field
[
'settings'
][
'hide_blank_items'
]
&&
$form
[
$field_name
][
$element_langcode
][
0
][
'#entity'
]
instanceof
FieldCollectionItemEntity
&&
field_collection_item_is_empty
(
$form
[
$field_name
][
$element_langcode
][
0
][
'#entity'
]))
{
_field_collection_process_children_attached
(
$form
[
$field_name
][
$element_langcode
][
0
]);
unset
(
$form
[
$field_name
][
$element_langcode
][
0
]);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment