When I set all the default options for a page or other content type to false (uncheck "Published", "In moderation queue", "Promoted to front page", "Sticky at top of lists", and "Create new revision" in admin/node/configure/types/page) and then go to any node editing, I get the following error:

Location
/?q=node/110/edit&destination=admin%2Fnode
Message
in_array(): Wrong datatype for second argument in /Applications/MAMP/htdocs/hyperlocal/modules/node.module on line 1319.
Severity
error

As I noticed the global variable node_options_page is a serialized string instead of serialized empty array in the database, when the default page options are unchecked.

This error appears in Drupal 4.6.3 as well.

Comments

archatas’s picture

Version: 4.6.4 » 4.6.5

This error appears in 4.6.5 - 4.6.3. If you are missing some information just let me know.

archatas’s picture

Status: Active » Fixed

As nobody fixes this error, I have to fix it myself. Use the fix if the error bothers you too.

In the file modules/node.module insert some new lines (the fix starts at line number 1314)

    $node_options = variable_get('node_options_'. $edit->type, array('status', 'promote'));
    if (!is_array($node_options)) { // <-- INSERTED
      $node_options = array();       // <-- INSERTED
    }                                             // <-- INSERTED
    $options .= form_checkbox(t('Published'), 'status', 1, isset($edit->status) ? $edit->status : in_array('status', $node_options));

You can delete the comments.

Good luck.

Anonymous’s picture

Status: Fixed » Closed (fixed)