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
197f516a
Commit
197f516a
authored
Oct 22, 2015
by
Joel Muzzerall
Browse files
Issue #2598926 by jmuzz: Fix for PHP versions < 5.3
parent
4869c3e7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
field_collection.module
field_collection.module
+9
-4
No files found.
field_collection.module
View file @
197f516a
...
...
@@ -588,10 +588,7 @@ function field_collection_item_is_empty(FieldCollectionItemEntity $item) {
$is_empty
=
TRUE
;
// Check whether all fields are booleans.
$all_boolean
=
$instances
&&
!
(
bool
)
array_filter
(
$instances
,
function
(
$instance
)
{
$field
=
field_info_field
(
$instance
[
'field_name'
]);
return
$field
[
'type'
]
!=
'list_boolean'
;
});
$all_boolean
=
$instances
&&
!
(
bool
)
array_filter
(
'_field_collection_field_is_not_boolean'
);
foreach
(
$instances
as
$instance
)
{
$field_name
=
$instance
[
'field_name'
];
...
...
@@ -624,6 +621,14 @@ function field_collection_item_is_empty(FieldCollectionItemEntity $item) {
return
$is_empty
;
}
/**
* Callback used by array_filter in field_collection_is_empty.
*/
function
_field_collection_field_is_not_boolean
(
$instance
)
{
$field
=
field_info_field
(
$instance
[
'field_name'
]);
return
$field
[
'type'
]
!=
'list_boolean'
;
}
/**
* Implements hook_field_formatter_info().
*/
...
...
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