in:
hierarchical_select.module

find:

// Retrieve and process the form.
  $form = call_user_func_array('drupal_retrieve_form', $storage['parameters']);

add before:

  module_load_include('inc', 'node', 'node.pages');
CommentFileSizeAuthor
#4 hierarchical_select.module.patch710 byteshavran

Comments

wim leers’s picture

Assigned: Alexander Matveev » Unassigned
Category: bug » support
Priority: Critical » Minor
Status: Active » Postponed (maintainer needs more info)

This is caused by a bug in another module.

You won't be able to reproduce this on a vanilla site. Please try to do so and then keep adding modules until you can reproduce the problem, to track down the module that causes this.

Alexander Matveev’s picture

Title: [solved] Form rebuilding crushes when using in block » call_user_func_array(): First argument is expected to be a valid callback, 'node_form' was given (node form in block)
Status: Postponed (maintainer needs more info) » Active

Still getting

    * warning: call_user_func_array(): First argument is expected to be a valid callback, 'node_form' was given in /home/mbschool/data/www/mti.wtu.ru/html/includes/form.inc on line 378.
    * warning: uasort(): The argument should be an array in /home/mbschool/data/www/mti.wtu.ru/html/includes/common.inc on line 2944.

this still solves (hierarchical_select.module):

<?php
// @fix
  if( !function_exists("node_form")) {
    module_load_include('inc', 'node', 'node.pages');
  }
  // @/fix

// Retrieve and process the form.
  $form = call_user_func_array('drupal_retrieve_form', $storage['parameters']);
?>

havran’s picture

I have same issue if i want use node_form on my own page (or block). I use this function for create form on my page:

/**
 * $arg can be node object (object) or content type name (string)
 */
function get_node_form($arg) {
  global $user;
  
  module_load_include('inc', 'node', 'node.pages');
  
  // node object
  // return prefilled node edit form
  if (is_object($arg)) {
    node_object_prepare($arg);
    return drupal_get_form($arg->type . '_node_form', $arg);
  // content type name
  // return empty node edit form
  } else if (is_string($arg)) {
    $node = new StdClass();
    $node->uid = $user->uid;
    $node->name = $user->name;
    $node->type = $arg;
    node_object_prepare($node);
    return drupal_get_form($node->type . '_node_form', $node);
  }
  
  return FALSE;
}
havran’s picture

StatusFileSize
new710 bytes

Here is patch.

hobo’s picture

I think im seeing this..
I get this error
First argument is expected to be a valid callback, '_node_form' was given in /home/dm6/includes/form.inc on line 378

and i can't edit nodes.. does not display the form.

stacysimpson’s picture

We get this error when using node_clone. The suggested patch in #4 seems to work.

stacysimpson’s picture

Version: 6.x-3.7 » 6.x-3.8
Category: support » bug
Status: Active » Needs review
jlbellido’s picture

I couldn't apply #4 ,but it code works for me. Thanks!

gold’s picture

Issue summary: View changes
Status: Needs review » Closed (won't fix)

Tidying up the issue queue. The 6.x version is no longer supported. Only reopen this if it also applies to the 7.x.