Commit bf801458 authored by Nathan Haug's avatar Nathan Haug
Browse files

Prevents "prepare" operation on link data twice when editing the node form. #141594.

parent 9bbec529
......@@ -232,19 +232,16 @@ function link_widget_info() {
function link_widget($op, &$node, $field, &$node_field) {
switch ($op) {
case 'prepare form values':
if ($_POST[$field['field_name']]) {
$node_field = $_POST[$field['field_name']];
unset($node_field['count']);
unset($node_field['more-url']);
unset($node_field['more']);
}
case 'form':
foreach($node_field as $delta => $value) {
if (is_numeric($delta)) {
_link_widget_prepare($node_field[$delta],$delta);
_link_widget_prepare($node_field[$delta], $delta);
}
}
if ($_POST[$field['field_name']]) {
$node_field = $_POST[$field['field_name']];
unset($node_field['count'], $node_field['more-url'], $node_field['more']);
}
case 'form':
$form = array();
$form[$field['field_name']] = array(
'#tree' => TRUE,
......@@ -272,7 +269,7 @@ function link_widget($op, &$node, $field, &$node_field) {
}
// Render two additional new link fields
foreach (range($delta, $delta + 1) as $delta) {
_link_widget_form($form[$field['field_name']][$delta], $field, $node_field, $delta);
_link_widget_form($form[$field['field_name']][$delta], $field, array(), $delta);
}
// Create a wrapper for additional fields
......
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