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.

Comments

kriskd’s picture

I'm getting the same errors too.

michelle’s picture

Me too in 1.1, not dev.

Michelle

webchick’s picture

Priority: Normal » Critical

Well that's no good. ;P

webchick’s picture

Version: 5.x-1.x-dev » 5.x-1.1

Also moving to a more specific version number.

michelle’s picture

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:

  // 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:

function 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

grantkruger’s picture

That's the case with me too. Is there any workaround?

Here are my errors:

  • warning: array_keys() [function.array-keys]: The first argument should be an array in /mywebsitepath/drupal/sites/all/modules/bio/bio_views.inc on line 39.
  • warning: in_array() [function.in-array]: Wrong datatype for second argument in /mywebsitepath/drupal/sites/all/modules/bio/bio_views.inc on line 109.
  • warning: in_array() [function.in-array]: Wrong datatype for second argument in /mywebsitepath/drupal/sites/all/modules/bio/bio_views.inc on line 109.
Mark Theunissen’s picture

Same problem here.

webchick’s picture

Hm. I can't duplicate this. :(

Could you try against the newly created as of tonight 5.x-1.2 release?

webchick’s picture

Version: 5.x-1.1 » 5.x-1.2

And if it's still a problem, can you please give me explicit, step-by-step instructions on how to reproduce?

Mark Theunissen’s picture

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

michelle’s picture

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

webchick’s picture

From Michelle on IRC:

webchick - Ok, I did a clean install, and installed cck, views, and panels like I always do. This time I added devel into the mix so I could turn the backtrace on. Then I enabled bio. No errors. So either it was fixed in the latest dev (just grabbed a fresh tarball) or it's being a stinker. I'll let you know if the error pops up again as I'm sure I'll be repeating this process a lot.
Other than devel, this is the same process that has triggered the error the last 3 times I did it, so I'm thinking it's fixed

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?

webchick’s picture

Status: Active » Needs review
StatusFileSize
new1.54 KB

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?

webchick’s picture

StatusFileSize
new607 bytes
new1.54 KB

And by "this patch," I actually meant this one. :P

Mark Theunissen’s picture

Hey Angie

I can confirm that the patch removes the error messages! No more barf..

Thanks for that
Mark

ryo’s picture

The patch worked for me, too.

Thanks!

webchick’s picture

Status: Needs review » Fixed

Ok, great. Committed. Will be part of the 5.x-1.3 release. Thanks for the tests!

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

dugh’s picture

Can you go ahead and release 1.3.
This error still exists.

darkpollo’s picture

I have got the same error.

bonobo’s picture

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.

dugh’s picture

Status: Closed (fixed) » Active
Sven_S’s picture

# 22 :

Good idea! I did the same ... and it works ...

henrrrik’s picture

# 22 :

So did I.

bonobo’s picture

Status: Active » Fixed

Setting to fixed as this has been dormant for a while, and a documented workaround exists.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

radyaweb’s picture

Thanks the first patch worked for me.

The second patch is the same as the first patch, so if you already patch with the first one, you don't need to use the second one.