Commit cdb6aa72 authored by Steven Wittens's avatar Steven Wittens
Browse files

- #10342: PHP5 fix with undefined array.

parent 674e2f49
...@@ -1127,6 +1127,7 @@ function node_form($edit) { ...@@ -1127,6 +1127,7 @@ function node_form($edit) {
// Get the node-specific bits. // Get the node-specific bits.
// We can't use node_invoke() because $param must be passed by reference. // We can't use node_invoke() because $param must be passed by reference.
$function = node_get_module_name($edit) .'_form'; $function = node_get_module_name($edit) .'_form';
$param = array();
if (function_exists($function)) { if (function_exists($function)) {
$form .= $function($edit, $param); $form .= $function($edit, $param);
} }
...@@ -1139,7 +1140,7 @@ function node_form($edit) { ...@@ -1139,7 +1140,7 @@ function node_form($edit) {
// Add hidden 'op' variable, which specifies the default operation (Preview). // Add hidden 'op' variable, which specifies the default operation (Preview).
$output .= '<input type="hidden" name="op" value="'. check_form(t('Preview')) ."\" />\n"; $output .= '<input type="hidden" name="op" value="'. check_form(t('Preview')) ."\" />\n";
// Add the admin-specific parts/ // Add the admin-specific parts.
if (user_access('administer nodes')) { if (user_access('administer nodes')) {
$output .= '<div class="admin">'; $output .= '<div class="admin">';
...@@ -1218,12 +1219,17 @@ function node_form($edit) { ...@@ -1218,12 +1219,17 @@ function node_form($edit) {
$extra = node_invoke_nodeapi($edit, 'form param'); $extra = node_invoke_nodeapi($edit, 'form param');
foreach ($extra as $key => $value) { foreach ($extra as $key => $value) {
if (is_array($value)) { if (is_array($value)) {
if (isset($param[$key])) {
$param[$key] = array_merge($param[$key], $value); $param[$key] = array_merge($param[$key], $value);
} }
else { else {
$param[$key] = $value; $param[$key] = $value;
} }
} }
else {
$param[$key] = $value;
}
}
$attributes = array('id' => 'node-form'); $attributes = array('id' => 'node-form');
if (is_array($param['options'])) { if (is_array($param['options'])) {
......
...@@ -1127,6 +1127,7 @@ function node_form($edit) { ...@@ -1127,6 +1127,7 @@ function node_form($edit) {
// Get the node-specific bits. // Get the node-specific bits.
// We can't use node_invoke() because $param must be passed by reference. // We can't use node_invoke() because $param must be passed by reference.
$function = node_get_module_name($edit) .'_form'; $function = node_get_module_name($edit) .'_form';
$param = array();
if (function_exists($function)) { if (function_exists($function)) {
$form .= $function($edit, $param); $form .= $function($edit, $param);
} }
...@@ -1139,7 +1140,7 @@ function node_form($edit) { ...@@ -1139,7 +1140,7 @@ function node_form($edit) {
// Add hidden 'op' variable, which specifies the default operation (Preview). // Add hidden 'op' variable, which specifies the default operation (Preview).
$output .= '<input type="hidden" name="op" value="'. check_form(t('Preview')) ."\" />\n"; $output .= '<input type="hidden" name="op" value="'. check_form(t('Preview')) ."\" />\n";
// Add the admin-specific parts/ // Add the admin-specific parts.
if (user_access('administer nodes')) { if (user_access('administer nodes')) {
$output .= '<div class="admin">'; $output .= '<div class="admin">';
...@@ -1218,12 +1219,17 @@ function node_form($edit) { ...@@ -1218,12 +1219,17 @@ function node_form($edit) {
$extra = node_invoke_nodeapi($edit, 'form param'); $extra = node_invoke_nodeapi($edit, 'form param');
foreach ($extra as $key => $value) { foreach ($extra as $key => $value) {
if (is_array($value)) { if (is_array($value)) {
if (isset($param[$key])) {
$param[$key] = array_merge($param[$key], $value); $param[$key] = array_merge($param[$key], $value);
} }
else { else {
$param[$key] = $value; $param[$key] = $value;
} }
} }
else {
$param[$key] = $value;
}
}
$attributes = array('id' => 'node-form'); $attributes = array('id' => 'node-form');
if (is_array($param['options'])) { if (is_array($param['options'])) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment