Closed (fixed)
Project:
Viewfield
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 Jun 2009 at 03:43 UTC
Updated:
18 Jun 2010 at 01:45 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
highvoltage commentedI also receive this error with my drupal 6 site and everything is also up to date.
Comment #2
hadsie commentedThe code where that's happening looks like:
274: $field['allowed_views'] = array_filter($field['allowed_views']);
275: $field['allowed_views'] = empty($field['allowed_views']) ? array_keys(views_get_all_views()) : $field['allowed_views'];
The first line looks to be left over and should probably be removed, since anything there is just going to be overwritten by 275 anyway. Deleting line 274 will make that error go away, and won't break anything either.
Comment #3
jjalocha commentedSubscribing.
Same warning here with clean Drupal 6.12 install.
Does anyone know if this is critical, or it can be ignored? I am using this on a prototype, and I hope the Viewfield D6 becomes stable in the meantime.
Comment #4
aren cambre commentedI noticed that the viewfield appears to get created despite this, but I still wonder whether this could leave certain data in an inconsistent state. Marking as critical until someone knowledgeable says otherwise due to possible data corruption issues.
Comment #5
hadsie commentedAs I mentioned with my previous post I don't believe this is critical, just a line of code that got left behind by the developer. Line 274 triggers the error, but line 275 fixes anything that could have been a mistake and/or cause data corruption issues. The patch is to simply delete line 274.
Comment #6
aren cambre commentedIf line 274 causes an error, will 275 ever be executed?
Comment #7
scottrigbyAssuming line 274 is really unnecessary (it's definitely being overwritten currently by line 275 like hadsie said), here's a patch
Edit: I just noticed deleting that line causes another error, so best not to use this patch till a better solution is found :p
Comment #8
scottrigbyComment #9
darren ohThat line is not being overwritten. array_filter removes all keys whose value is 0. The error is real, and should be fixed by re-saving the allowed views.
Comment #10
jerdavisFixed in commit http://drupal.org/cvs?commit=226092
Jer
Comment #11
jvieille commentedStill getting the error using the last dev dated June 17th:
warning: array_filter() [function.array-filter]: The first argument should be an array in /home/controlc/www/sites/all/modules/viewfield/viewfield.module on line 274
Even worse:
When creating a new field for a given content type, all nodes of this type get a view, by default the first in the list.
No way to get ride of it: you can only chose another view - none is not en option.
I created an empty view to handle that in the meantime
Comment #12
TC44 commentedSame error here also with June 17 dev.
Comment #13
asb commentedalso confirming for Viewfield 6.x-1.x-dev from 17-Jun-2009.
Greetings, -asb
Comment #14
rwd commentedThe commit mentioned in #10 is not the final change to viewfield.module that made it into the 2009-Jun-17 dev snapshot.
The later commit http://drupal.org/cvs?commit=226106 also changed viewfield.module to the version that's in the snapshot, but this commit reintroduces the error mentioned by the OP for new viewfields.
Comment #15
drupalfo commentedJust Downloaded and installed fresh version of Drupal 6.13.
also downloaded latest Viewfield 6.x dev. and got the same exact error.
warning: array_filter() [function.array-filter]: The first argument should be an array in drupal6/sites/all/modules/viewfield/viewfield.module on line 274
Comment #16
tomsherlock commentedI would like to confirm that i have the same exact error with the 2009-Jun-17 dev snapshot. I just downloaded it.
I also have Drupal 6.13.
Comment #17
jvieille commentedThe error is still there
The line 274 had actually gone in the last dev of June 17th, but the error appear at the same pace.
As mentionned, this is not critical. Just save the content type ignoring the error. the next time, it is clean.
Comment #18
missym commentedSubscribe
Comment #19
dig1 commentedSubscribing
Yes, I just upgraded from 6.12-6.13 and upgraded to Viewfield 6.x-1.x-dev (2009-Jun-17). I added a second viewfield to a content type and got this error:
warning: array_filter() [function.array-filter]: The first argument should be an array in ...sites/all/modules/viewfield/viewfield.module on line 274.
The content type subsequently seems to display my two views ok.
Digby
Comment #20
bartezz commentedJust downloaded the latest .dev and encountered the same error.
Comment #21
tchronister commentedSubscribe
Comment #22
seanberto commentedsubscribe.
Comment #23
Anonymous (not verified) commentedWhen I debug the code with a breakpoint on line 274, when entering the page, $field('allowed_views') is set as an array of the available views which is correct. With none of the views in the checkbox list selected and just a view from the combo box selected, the code stops again at the breakpoint but this time $field('allowed_views') is set as a string value which is what causes the error. I haven't had time to backtrace where the string value is being set.
Roger.
Comment #24
protoplasm commentedThis appears to be a critical problem on my website that is breaking some of my view generated front pages.
Comment #25
rampage commentedjust change line 274 from v1.20
to this:
$field['allowed_views'] = is_array($field['allowed_views']) ? array_filter($field['allowed_views']) : array();
cheers
Comment #26
timaholt commentedI still get this error as well even with the change in #25. Any solutions?
Comment #27
leon85321 commentedThank you for the patch.
After applying #25, it works now, it does not display any errors now :)
Comment #28
darren ohFixed in CVS commit 226106.
Comment #30
ablewave commentedIs this fixed in the latest dev? I am getting this error, but for line 270, and only on nodes where there is no View selected. It is a book page node if that makes any difference.
warning: array_filter() [function.array-filter]: The first argument should be an array in /home/monti/public_html/sites/all/modules/viewfield/viewfield.module on line 270.
Comment #31
acb commentedI see it too
Comment #32
guillefar commentedWhen I'm creating editing or just viewing content, this message appears:
warning: array_filter() [function.array-filter]: The first argument should be an array in /var/www/d/sites/all/modules/viewfield/viewfield.module on line 275.
I suppose is related with the previous errors.
Any idea or what it could be?