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.
I was created the slider in my project. The slider images were created using field collection module.whenever I edit the slider image it show the following warning message.
(Warning: array_filter() expects parameter 1 to be array, string given in field_collection_item_is_empty() (line 591 of /var/www/html/multisite/docroot/sites/all/modules/contrib/field_collection/field_collection.module)).
Comment | File | Size | Author |
---|---|---|---|
#4 | field_collection.array_filter.patch | 605 bytes | brunoric |
#3 | field_collection.array_filter.patch | 809 bytes | brunoric |
Comments
Comment #2
RobertInOP CreditAttribution: RobertInOP commentedWe had received the same warning error in a similar use of 7.x-1.0-beta10. Making this change on line 591:
- $all_boolean = $instances && !(bool) array_filter('_field_collection_field_is_not_boolean');
+ $all_boolean = is_array($instances) && !((bool) array_filter($instances, '_field_collection_field_is_not_boolean'));
seems to have solved the issue. Give it a try.
Comment #3
brunoric CreditAttribution: brunoric at CI&T commentedCreated a very simple patch for the array_filter problem.
Comment #4
brunoric CreditAttribution: brunoric at CI&T commentedAdding relative patch.
Comment #5
bkat CreditAttribution: bkat commented#4 works for me.
Comment #6
MegaChriz CreditAttribution: MegaChriz as a volunteer commentedThis seemed to be already fixed in dev: #2599248: array_filter() issue after upgrading to 7.x-1.0-beta10
Comment #7
ybabel CreditAttribution: ybabel commented#4 worked for me