(not sure whether this is actually an imagefield bug or a filefield bug; I encounter it while using imagefield, so thought I'd start by posting it here)

When I create a content type that has an image field, I see the following error when I "Create content" of that type:

warning: in_array() [function.in-array]: Wrong datatype for second argument in C:\domains\gjyp.nl\wwwroot\interventiondesign\modules\filefield\filefield.module on line 289.

I could not find any mention of this yet in the list with bugs. My Drupal is up-to-date (6.4; already had this error in 6.3 though), and according to the Modules list there are no required modules missing. All modules are up-to-date:

Content Construction Kit (CCK) 6.x-2.0-rc5
FileField 6.x-3.0-alpha3
ImageField 6.x-3.0-alpha1
Token 6.x-1.11
Views 6.x-2.0-rc1

I have no clue what goes wrong (I'm new to Drupal . . .) . . . Any hints? :-)

Thank you in advance, kind regards,

Gjalt-Jorn

Comments

pingvinen’s picture

Assigned: Unassigned » pingvinen
Priority: Normal » Critical

Im having the same problem!

stellarvisions’s picture

Title: warning: in_array() [function.in-array]: Wrong datatype for second argument in C:\path\filefield\filefield.module on line 289. » may be of help - set configuration options for the field in the content type

I was also having this problem -- the error occurs when I go to manage fields of the content type.

Just upgraded to 6.4 and latest imagefield filefield, and all my image fields were GONE from my nodes.

When I went to make a new node, the field is not there. So I was looking to manage it to see if there was a new setting or something and got this error when I hit "configure". When I saw the list of fields, the image field was listed. However, when I went to export the content type, the image field did not appear on the list.

So I went ahead and made a bunch of choices in configuration that were not present before and the error went away! And the fields appeared again both in the nodes and in the export list.

(now I have an error about something else . . . First argument is expected to be a valid callback, 'file_validate_image_resolution_help' so trying to track that down :)

stellarvisions’s picture

FYI found patch for the image_resolution_help, thanks!

stellarvisions’s picture

Title: may be of help - set configuration options for the field in the content type » warning: in_array() [function.in-array]: Wrong datatype for second argument in . . . modules\filefield\filefield.module on line

sorry for temporarily changing the title of this bug. . . mea culpa

drewish’s picture

Status: Active » Closed (duplicate)

okay that filefield bit is a clue that it's a bug with the filefield module. see: #297395: warning: in_array() [function.in-array]:

cratos’s picture

I got the following errors after upgrading to filefield-6.x-3.0-alpha3.tar.gz:

1.warning: in_array() [function.in-array]: Wrong datatype for second argument in modules\cck\modules\filefield\filefield.module on line 289.

2.warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'file_validate_image_resolution_help' was given in \modules\cck\modules\filefield\filefield_widget.inc on line 223.

3.warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'file_validate_image_resolution_help' was given in modules\cck\modules\filefield\filefield_widget.inc on line 223.

I'm using Drupal 6.4

Nibor-1’s picture

Yep I'm also suffering from this. Got this in 6.x-3.0-alpha1.

warning: in_array() [function.in-array]: Wrong datatype for second argument in F:\roots\website2\public_html\modules\filefield\filefield.module on line 289.

ImageField was a fresh install when i upgraded to D6.4 as i had been using FileField Image with D6.3.

defconjuan’s picture

i'm having exact same issue, any resolutions yet?

disconnect’s picture

I've seached on internet about this bug but i couldnt find any answer. Is there any new version or new patch? Please help.

eric.chenchao’s picture

Try to change following code for temporary use

find following code in the filefield/filefield.module

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

to

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