When you configure a content type, for example:

/admin/node/configure/types/forum

you must al least select one checkbox among the default options:

  • Published
  • In moderation queue
  • Promoted to front page
  • Sticky at top of lists
  • Create new revision

If you leave all of them unchecked, you'll get the following errors when you try to add content of that type:

warning: in_array(): Wrong datatype for second argument in [path-to-site]/modules/node.module on line 1296.
warning: in_array(): Wrong datatype for second argument in [path-to-site]/modules/node.module on line 1297.
warning: in_array(): Wrong datatype for second argument in [path-to-site]/modules/node.module on line 1298.
warning: in_array(): Wrong datatype for second argument in [path-to-site]/modules/node.module on line 1299.
warning: in_array(): Wrong datatype for second argument in [path-to-site]/modules/node.module on line 1300.

I think you can easily duplicate the issue…

Comments

Uwe Hermann’s picture

I cannot reproduce this in HEAD. Can you please check again?

jvandyk’s picture

Status: Active » Closed (fixed)

I cannot reproduce in 4.6.3. Tried with story and forum types.

dekkeh’s picture

Version: 4.6.1 » 4.6.3

I appear to be having the same problem. Node type = image, uploaded with img_assist.

Samat Jain’s picture

Status: Closed (fixed) » Active

I begun to get this error too. If by default a content-type does not have one of the "Options" set (Published, Sticky, etc), all these errors come up.

The errors look as if it has something to do with PHP5? I'm using:

  • Apache 2.0.54
  • PHP 5.0.4
  • Drupal 4.6.3
Samat Jain’s picture

Steps for me to reproduce on stock Drupal 4.6.3 (with Apache 2 and PHP 5, see previous follow-up) installation:

  1. administer > content > configure tab > content types secondary tab
  2. Pick a node type, such as story, choose configure
  3. Uncheck all of the "Default options," and save
  4. create content > story (or whatever you picked)

The errors come up:

warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/httpd/global/drupal/modules/node.module on line 1303.

warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/httpd/global/drupal/modules/node.module on line 1304.

warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/httpd/global/drupal/modules/node.module on line 1305.

warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/httpd/global/drupal/modules/node.module on line 1306.

warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/httpd/global/drupal/modules/node.module on line 1307.
Péter Cseke’s picture

It happens to mee too.

I'm using Drupal 4.6.3 on Apache2 / PHP5 / MySQL 4.x on Windows.

I also use node privacy byrole module, though I'm not sure if it has something to do with this issue.

If I uncheck all 5 options from the content type configuration settings for a node type, I will get those errors when creating a new node of that specific type. But I get different lines ...

in_array() [function.in-array]: Wrong datatype for second argument in C:\Program Files\Apache Group\Apache2\htdocs\home\modules\node.module on line 1249.
in_array() [function.in-array]: Wrong datatype for second argument in C:\Program Files\Apache Group\Apache2\htdocs\home\modules\node.module on line 1250.
in_array() [function.in-array]: Wrong datatype for second argument in C:\Program Files\Apache Group\Apache2\htdocs\home\modules\node.module on line 1251.
in_array() [function.in-array]: Wrong datatype for second argument in C:\Program Files\Apache Group\Apache2\htdocs\home\modules\node.module on line 1252.
in_array() [function.in-array]: Wrong datatype for second argument in C:\Program Files\Apache Group\Apache2\htdocs\home\modules\node.module on line 1253.

chx’s picture

Status: Active » Fixed

This is a well known problem. If you do not tick any checkbox, then HTML does not post anything and a NULL is saved instead of an array. While this is fixed in 4.7 you can fix it In 4.6 by writing the following to settings.php


$conf = array('node_options_story' => array(), 'node_options_page' => array());

and so on for various node types.

Anonymous’s picture

Status: Fixed » Closed (fixed)