Wrong datatype for second argument in ... bio_views.inc
olio - November 9, 2007 - 11:30
| Project: | Bio |
| Version: | 5.x-1.2 |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | active |
Description
Hi,
I just installed the actual dev version of bio, applied the patch "The first argument should be an array" and got another warning:
"Wrong datatype for second argument in ... bio_views.inc on line 111"
The fields mentioned further down in this warning are all cck text fields (2 x text, 1 x date). My modules are all up-to-date.
Thanks.

#1
I'm getting the same errors too.
#2
Me too in 1.1, not dev.
Michelle
#3
Well that's no good. ;P
#4
Also moving to a more specific version number.
#5
Some trouble shooting.
The first error is:
warning: array_keys() [function.array-keys]: The first argument should be an array in snip/sites/all/modules/bio/bio_views.inc on line 39. That's this bit:
<?php// Fetch some CCK info if CCK is installed
if (module_exists('content')) {
$content_type_info = content_types($bio_type);
$bio_fields = array_keys($content_type_info['fields']); <-- 39
}
?>
And that's called from here:
<?phpfunction bio_views_tables_alter(&$tables) {
require_once drupal_get_path('module', 'bio') . '/bio_views.inc';
return _bio_views_tables_alter($tables);
}
?>
If I'm understanding correctly, this will only happen if both views and cck are enabled before bio.
Michelle
#6
That's the case with me too. Is there any workaround?
Here are my errors:
#7
Same problem here.
#8
Hm. I can't duplicate this. :(
Could you try against the newly created as of tonight 5.x-1.2 release?
#9
And if it's still a problem, can you please give me explicit, step-by-step instructions on how to reproduce?
#10
Hi Angie
I've tried version 1.2 and I still get the barf... :(
I think these steps should reproduce:
1) Enable
- CCK 5.x-1.6-1
- Views 5.x-1.6
2) Make a view or two, not sure if that makes a difference.
3) Enable the Bio module
Error:
warning: in_array() [function.in-array]: Wrong datatype for second argument in bio_views.inc on line 137.
Sometimes there are many of these errors, sometimes just the one.
From looking at the code, I would say it's happening because $bio_fields has not been initialized to anything when it is passed to the in_array() function on line 137.
It's not being initialized because the CCK type for Bio is not created. This initialization happens on line 49.
Just a guess... ;)
Cheers
Mark
#11
I'm having the same issue and I plan on doing a clean install of advprofile later today, which will hit the error again. I'll put in some debugging code and see if I can figure it out for you. If you look at #5, you can see that content_types($bio_type) isn't returning what it should. I'll dig in a bit to find out why.
Michelle
#12
From Michelle on IRC:
My test results were the same.
So I say again, can someone post stupidly explicit instructions on how to reproduce in 5.x-1.2?
#13
Margh! Somehow in between uninstalling and trying a bunch of other things, I did manage to reproduce this once. But have no idea what I did and can't get it to do it again. :(
But could you try testing this patch, perhaps?
#14
And by "this patch," I actually meant this one. :P
#15
Hey Angie
I can confirm that the patch removes the error messages! No more barf..
Thanks for that
Mark
#16
The patch worked for me, too.
Thanks!
#17
Ok, great. Committed. Will be part of the 5.x-1.3 release. Thanks for the tests!
#18
Automatically closed -- issue fixed for two weeks with no activity.
#19
Can you go ahead and release 1.3.
This error still exists.
#20
I have got the same error.
#21
Okay -- completely bizarre -- I saw this exact same error with bio 5.x-1.2.
Uninstalled bio (inlcuding the uninstall step at admin/build/modules/uninstall ) and then cleared the cache tables. Then, when I reinstalled bio, I saw no errors.
Same codebase, same db. The only changes I made were to disable the module at admin/build/modules; uninstall the module at admin/build/modules/uninstall, clear the cache* tables in the db, and then re-install the module. Poof! error gone.
#22