Help text passed back from the _form hook using the &$help argument is not displayed on the edit form as it is supposed to. The node_invoke call does not pass its arguments in by reference.

Comments

dries’s picture

Priority: Normal » Critical

I just rewrote node_invoke():

function node_invoke() {

  $args = func_get_args();
  
  $node = array_shift($args);
  $hook = array_shift($args);
  array_unshift($args, $node);

  if (is_array($node)) {
    $function = $node["type"] ."_$hook";
  }
  else if (is_object($node)) {
    $function = $node->type ."_$hook";
  }
  else if (is_string($node)) {
    $function = $node ."_$hook";
  }

  if (function_exists($function)) {
    return call_user_func_array($function, $args);
  }
}

This is much nicer as node_invoke() can now take an arbitrary number of arguments (instead of four), yet it obviously doesn't solve the reference problem either.

jonbob’s picture

A patch for this bug is in for_review.

dries’s picture

The patch has been commited. Marking this "fixed".

Anonymous’s picture

Automatically closed due to inactivity (marked fixed for 14 days).