Using CCK I have created a custom content type and added a imagefield.
When I try to create content using that content type I get
warning: in_array() [function.in-array]: Wrong datatype for second argument in /var/www/drupal/modules/filefield/filefield.module on line 289.
Comments
Comment #1
Matt Townsend commentedI second this. There's a thread about this in the imagefield section, but I this seems to come up for all filefield attachments, not just images. I'm on 6.4 with the latest modules. I removed the imagefield module and it's still doing it.
I get this with the alpha and the 6x3x dev release.
Any ideas here?
Comment #2
Matt Townsend commentedNevermind on the critical. This doesn't seem to be affecting the function of filefield. But a fix would be nice.
When I comment lines 289 to 292:
/* if (!in_array('filefield_node_form_submit', $form['#submit'])) {
$form['#submit'][] = 'filefield_node_form_submit';
}
*/
The error message goes away, and files seem to upload fine. I'm sure this is a terrible idea, but I thought it might be useful to know.
Comment #3
acase commentedHello all,
I am having the same problem...except my error continues to show with the provided code commented out. Anyone know of a quick fix for this one? Thanks!
ps I upgraded to Drupal 6.4 if that makes a difference...
Comment #4
rc2020 commentedI too am having this issue. Any thoughts?
Comment #5
pingvinen commentedSame here!
Comment #6
Michael Mikx commentedI've replaced line 289
if (!in_array('filefield_node_form_submit', $form['#submit'])) {with
if (is_array($form['#submit']) && !in_array('filefield_node_form_submit', $form['#submit'])) {and that made an error go away.
Comment #7
drewish commentedmake sure you're running the latest versions of CCK and the filefield module.
Comment #8
mavos commentedI still see this with filefield alpha4 and the latest of everything (downloaded today).
On node/add with an image field:
warning: in_array() [function.in-array]: Wrong datatype for second argument in /srv/www/grus/htdocs/modules/filefield/filefield.module on line 289.
Comment #9
philippsimon.de commentedi also have the same problem ... install 6.x-1.0-beta2 again
Comment #10
ComputerWolf commentedAlright, this issue and #297395: warning: in_array() [function.in-array]: seem to be the same thing... but i'm not sure if one is a duplicate of the other, 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:
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.
Comment #11
saltcod commentedworked for me too - though for anyone new following this, i kept the php tags in when i copied and pasted from above and got a white screen. Remove the beginning and ending php tag and all will go well.
This isn't likely necessary, but may help for anyone new.
Comment #12
pingvinen commentedFinaly, no warning message. Thank you ComputerWolf
Comment #13
drewish commentedmarked #305905: warning: in_array() in filefield.module as a duplicate of this. marking this as a duplicate of #308832: Wrong datatype for second argument filefield.module on line 289. since it has a patch.
Comment #14
AndriaD commentedI followed what was shown above in #10 and #11, ComputerWolf and saltcod, and it worked, got rid of the error, so, thank you very VERY much!
Dre wish, I saw the post about the patch but could not figure out what to do with it; a lot of you folks need to realize that a lot of us folks AREN'T programmers, and don't have one clue what the heck you're all talking about.
Clear-cut instructions about what to remove/change/add are a great deal more helpful than a page of code with code-geek-type comments.
Oh, and this error cropped up with filefield-6.x-3.0-alpha4, but I found the posts referring to this error by simply searching for "filefield.module on line 289".
Again, many thanks,
Andria