diff --git a/modules/node.module b/modules/node.module
index 4c99294b5ec..3a0a7634be9 100644
--- a/modules/node.module
+++ b/modules/node.module
@@ -1127,6 +1127,7 @@ function node_form($edit) {
// Get the node-specific bits.
// We can't use node_invoke() because $param must be passed by reference.
$function = node_get_module_name($edit) .'_form';
+ $param = array();
if (function_exists($function)) {
$form .= $function($edit, $param);
}
@@ -1139,7 +1140,7 @@ function node_form($edit) {
// Add hidden 'op' variable, which specifies the default operation (Preview).
$output .= '\n";
- // Add the admin-specific parts/
+ // Add the admin-specific parts.
if (user_access('administer nodes')) {
$output .= '
';
@@ -1218,7 +1219,12 @@ function node_form($edit) {
$extra = node_invoke_nodeapi($edit, 'form param');
foreach ($extra as $key => $value) {
if (is_array($value)) {
- $param[$key] = array_merge($param[$key], $value);
+ if (isset($param[$key])) {
+ $param[$key] = array_merge($param[$key], $value);
+ }
+ else {
+ $param[$key] = $value;
+ }
}
else {
$param[$key] = $value;
diff --git a/modules/node/node.module b/modules/node/node.module
index 4c99294b5ec..3a0a7634be9 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -1127,6 +1127,7 @@ function node_form($edit) {
// Get the node-specific bits.
// We can't use node_invoke() because $param must be passed by reference.
$function = node_get_module_name($edit) .'_form';
+ $param = array();
if (function_exists($function)) {
$form .= $function($edit, $param);
}
@@ -1139,7 +1140,7 @@ function node_form($edit) {
// Add hidden 'op' variable, which specifies the default operation (Preview).
$output .= '
\n";
- // Add the admin-specific parts/
+ // Add the admin-specific parts.
if (user_access('administer nodes')) {
$output .= '
';
@@ -1218,7 +1219,12 @@ function node_form($edit) {
$extra = node_invoke_nodeapi($edit, 'form param');
foreach ($extra as $key => $value) {
if (is_array($value)) {
- $param[$key] = array_merge($param[$key], $value);
+ if (isset($param[$key])) {
+ $param[$key] = array_merge($param[$key], $value);
+ }
+ else {
+ $param[$key] = $value;
+ }
}
else {
$param[$key] = $value;