[code]warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/site/public_html/mysite/modules/filefield/filefield.module on line 289.[/code]

This warning showed up after upgrading from alpha2 to alpha3.

I am using Drupal 6.4.

Comments

B.P.B’s picture

UPDATE:

After reverting back to Alpha2, the warning disappeared. I would prefer to use the most up to date version. Please help.

mschneider’s picture

I also got the same message and had to revert back to Alpha2 - do you already have an news about how to resolve this!

B.P.B’s picture

No, not yet, but its comforting to know that I'm not the only one :)

Sometimes when you post a bug, there is no reply for awhile, and you begin to wonder if you saw bigfoot.

Moonshine’s picture

Have you guys tried HEAD? It is about a week newer... I'm not seeing this error using it.
http://drupal.org/node/96616

drewish’s picture

marked #297816: Error in node form as a duplicate

craig.bloodworth’s picture

I'm experiencing this problem and tried upgrading to the development version however the error still appears. Does a rollback seem like the only option right now?

Moonshine’s picture

Did you run update.php after putting the new version in place? Sort of a longshot, but worth a try if you haven't.

B.P.B’s picture

Yes, I ran update.php, but it did not help.

marvix’s picture

any hope ?

defconjuan’s picture

i'm having the same problem and nothing on this site (as of this posting) fixes it (i've searched for about 3 hours)

UPDATE: I rolled back to Alpha 2 and the error message disappears. I think this relates to CCK FileField with CCK Image because everything was fine until I installed CCK Image. I also use IMCE and Lightbox but those all were working fine until CCK Image.

What about others? Do you also have IMCE or Lightbox?

B.P.B’s picture

I was funning Filefield + CCK + Views + Imagefield + Imagecache + Lightbox to create an image thumbnail gallery.

ComputerWolf’s picture

Alright, this issue and #296350: Wrong datatype seem to be the same thing... this one may be a duplicate, but other issues have already been marked as dupes of this one, so i'll post my findings in both.

It seems that even with the latest modules, this warning is still appearing. I found an easy fix by making line #289 of filefield.module look like this:

  if (isset($form['#submit']))
  {
    if (!in_array('filefield_node_form_submit', $form['#submit'])) {
      $form['#submit'][] = 'filefield_node_form_submit';
    }
  }

This works for me, but I don't know why $form['#submit'] is being referenced when for some reason it doesn't exist. I guess that would be an issue for the filefield/CCK developers.

defconjuan’s picture

tried ComputerWolf's code (#13) and works for me

B.P.B’s picture

Upgrading to alpha4 fixed the problem for me.

drewish’s picture