After upgrading to 7.x-1.0-beta10, I ran into the following error when saving any content that used a content type that had the field_collection type utilized.
Warning: array_filter() expects parameter 1 to be array, string given in field_collection_item_is_empty()
The server for the website I noticed the issue on is using PHP 5.6 (also is running on Windows Server if that makes any difference). For right now I reverted to the prior versions code for that particular block and it seems to be working as expected.
Even with the error, it didn't see to cause any issues with saving and updating the data though, from what I could see.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | field-collection-2599248-2.patch | 605 bytes | donutdan4114 |
Comments
Comment #2
donutdan4114 commentedThe issue is in field_collection.module:591....
$all_boolean = $instances && !(bool) array_filter('_field_collection_field_is_not_boolean');Should actually be:
$all_boolean = $instances && !(bool) array_filter($instances, '_field_collection_field_is_not_boolean');Comment #3
donutdan4114 commentedPatch attached.
Comment #4
donutdan4114 commentedComment #6
jmuzz commentedThanks for the correction!
Comment #7
Mistah7 commentedThanks for quick reply!
Comment #8
thfalvar commentedThanks you for your rapidity
Comment #9
timme77 commentedThanks!
Comment #10
joshuautley commentedThank you.
Comment #11
computerbarry commentedJust ran into this issue.
Patch works great and fixed everything :)
Thanks!
Comment #12
caw67 commentedpatch works for me
Comment #13
joachim commentedDoes this maybe warrant a new beta release?
Comment #14
computerbarry commentedI think that is a good idea.
Barry
Comment #15
raprieto commented#3 worked for me also. Thank you donutdan4114
Comment #16
dfish17 commentedYikes, I just tried to apply this patch manually and am getting the following error. I tried to do a full restore of home directory and database and am still getting the error. What did I do wrong?
Parse error: syntax error, unexpected end of file in /home/karenl12/public_html/sites/all/modules/field_collection/field_collection.module on line 1510
Comment #17
derherrberger commented#3 fixed the issue for me.
Thank you donutdan4114!
Comment #18
amaisano commented@dfish17 - try disabling the module (manually in the DB > system table if you have to). Kind of sounds like a rogue quote mark somewhere in the code. You may need to manually clear the caches in the DB too.
Comment #19
niklp commentedThis appeared to work for me for a day or so, but the problem recurred today. I've re-applied the patch but I get a slew of errors identical to those mentioned when I save anything with a _collection on it. :/
Comment #20
i15 commentedCan you please make a new version 7.x-1.0-beta11 with path?
Please :)
Thank you!
Comment #21
jimmynash commentedPatch in #3 worked for me.
Comment #22
vensiresThis issue is actually fixed in 7.x-1.x-dev only and not in 7.x-1.0-beta10.
By they way, patch in #3 also worked for me.
Comment #23
jens78 commentedThanks for the patch!
Comment #24
didier misson commentedPatch #3 is OK.
Thanks.
Comment #25
jurriaanroelofs commentedA new beta release would be great, then I dont have to hack my product to pin beta9 in the build scripts.
Comment #26
timme77 commentedComment #27
Amad Tababa commentedUpdating to the latest dev sort the issue for me.
Thanks
Comment #28
func0der commentedCan we please have a new release of this immediately? With this bug the module is unusable in "stable" state.
Comment #29
mulderjoe commentedThank you for the patch #3, seems to work well. I have beta10, and it seems the patch fix was not included in that beta.
Comment #30
xturgorex commentedThanks for the patch. #3 worked.
Comment #31
boinx2516 commentedThanks! Patch on #3 worked well.
Comment #32
Andre-Bthis commit requires a new release. module is unusable without it.
Comment #33
yugi commentedPatch #3 works well. A new beta release would be great, it is not really stable with this issue in it.
Comment #34
edward.peters commentedI am having the same problem. A fresh release asap would be highly appreciated! Thanks for all the work.
Comment #35
dolcaer commentedHas this been released yet? If not, is it advisable to manually install this patch now, or wait a bit longer?
Comment #36
vensiresFeel free to use the patch to patch the stable version on your installation or use the -dev version.
Comment #37
mrupsidownPlease release a new version asap.
Comment #38
joshuautley commentedFor those looking for a new release:
Typically, modules receive multiple "patches" before a new release is created.
If you do not know how to apply a patch... A patch is simply new code showing which line items are to be deleted and added. Advanced developers can apply patche's programmatically.
I'm guessing those requesting a new release are not "advanced developers" and in an attempt to assist you please read how to apply patches manually > https://www.drupal.org/node/534548.
I hope this helps.
Comment #39
Andre-Bwhy the rant? the issue is plain simple, the latest release does not work anymore and will require a lot admins to apply this patch manually. For me it doesn't matter that much to do that, for others it does, and since field_collection is used by 125k+ installations with a variety of knowledge, releasing a hot fix for this is the least that can be done. rather than pointing them to a manual in the issue queue to apply a patch themselves.
Comment #40
joshuautley commentedI'm not ranting, I'm trying to help. I am not the maintainer. I'm simply a fellow community member.
I understand your point. Please don't misunderstand mine.
Comment #41
Andre-Bsorry for that, I must have misread your comment.
Comment #42
mrupsidownI know how to apply a patch and #3 works... still I think this should be released in a new version asap.
Comment #43
computerbarry commentedLook on the bright side, we have a patch :)
The maintainer could be busy, frustrating I know, at least things work now.
For anybody not familiar applying patches, like myself, still only use patches to change the code manually.
Check out my reply for a user who wanted to update this module with this current patch.
A single line of code is all that needs changing.
www.drupal.org/node/2607968
Barry
Comment #44
vensiresWell, this patch isn't something so difficult to apply manually. For anyone not familiar with patches or scared of all this terminology, just...
array_filter('_field_collection_field_is_not_boolean');witharray_filter($instances, '_field_collection_field_is_not_boolean');Comment #45
glynster commentedConfirmed patch resolves the issue.
Comment #46
glynster commented+1 RTBC
Comment #47
maxplus commentedHi,
thanks, patch #3 solves this issue for me:
"error Warning: array_filter() expects parameter 1 to be array, string given in field_collection_item_is_empty() (line 591"
Comment #48
mengi commentedpatch #3 solved it for me.
Comment #49
deggertsen commentedIt would be nice to have a new release that includes this patch. Thanks for the fix!
Comment #50
maximpodorov commented+1 for the new release!
Comment #51
ssoulless commentedPlease commit this, and add it to the new stable release.
Comment #52
Richard15 commentedpatch #3 solved it for me.
Comment #53
belaustegui commentedThe patch is working perfectly.
+1 for the new release.
Comment #54
ladybug_3777 commentedpatch in #3 works for me as well.
Another vote for the new release PLEASE!!!!
Comment #55
Anonymous (not verified) commented+1 for a new release which includes this. Even if the module is technically still a beta, it is so heavily used that it really shouldn't come with such easily-seen error messages, given that a patch to fix it has already been created.
Comment #56
baltazarz3 commentedThanks guys, the patch saved my life during a live deployment. You rock
Comment #57
yoran scholiers commentedI'll be just another +1. Patch #3 works.
Comment #58
Toraih commented+1 ! Patch should be moved to the stable release long ago...
Comment #59
madelyncruz commentedPatch #3 worked for me too. Thank you.
Comment #60
mlanning commentedPatch #3 worked for me as well. Thank you.
Comment #61
DrCord commentedThis solved my problem! Thanks.
Comment #62
knalstaaf commentedI believe this was set on "closed" too early. I guess this should be regarded as RTBC.
Comment #63
jmuzz commentedThanks for the feedback all.
I released 7.x-1.0-beta11 with this fix.
Comment #64
ladybug_3777 commentedSlightly unrelated, but I'm curious... the Field Collection module has existed since 2010 (I went back and looked through the commit history). It's been almost SIX years of life and it's still considered a beta? This module seems to be widely used and has decent support... why has it never officially moved out of the beta stage??
Comment #66
jmuzz commentedPath to stable 1.0 release: https://www.drupal.org/node/1821320
Also see: https://www.drupal.org/node/2339023
Summary: It doesn't support all core features yet. There are still problems with revision support and content translation in particular.
Comment #67
shobhit_juyal commented#3 worked for me. Thanks for the patch.