diff -urp node_widget_orig/includes/node_widget.class.inc node_widget/includes/node_widget.class.inc --- node_widget_orig/includes/node_widget.class.inc 2010-05-07 10:46:23.000000000 +0100 +++ node_widget/includes/node_widget.class.inc 2010-09-01 12:05:43.991655485 +0100 @@ -70,12 +70,31 @@ class node_widget { */ function &get_form($delta = 0) { + $elements = array(); if ($this->fieldgroup) { $form = $this->form[$this->fieldgroup][$this->field['field_name']][$delta][NODE_WIDGET_VALUES]; + $elements = element_children($this->form[$this->fieldgroup][$this->field['field_name']]); } else { $form = $this->form[$this->field['field_name']][$delta][NODE_WIDGET_VALUES]; + $elements = element_children($this->form[$this->field['field_name']]); + } + + foreach (element_children($form) as $key) { + if (substr($key, 0, 6) == 'field_') { + $values = $form['#post'][$this->field['field_name']][$delta][NODE_WIDGET_VALUES][$key]; + + $form['#post'][$key] = $values; + $form[$key]['#post'][$key] = $values; + + foreach (array_filter($elements, 'is_numeric') as $delta2) { + if (isset($form[$key][$delta2]['#post'])) { + $form[$key][$delta2]['#post'][$key] = $values; + } + } + } } + $form['#type'] = 'form'; return $form; } @@ -154,11 +173,15 @@ class node_widget { function get_element($delta = 0) { if ($this->fieldgroup) { - return $this->form[$this->fieldgroup][$this->field['field_name']][$delta]; + $element = $this->form[$this->fieldgroup][$this->field['field_name']][$delta]; } else { - return $this->form[$this->field['field_name']][$delta]; + $element = $this->form[$this->field['field_name']][$delta]; } + + $element['#post'][$this->field['field_name']][$delta] = array_merge($element['#post'][$this->field['field_name']][$delta], $element['#post'][$this->field['field_name']][$delta][NODE_WIDGET_VALUES]); + + return $element; } /** diff -urp node_widget_orig/includes/node_widget.form.inc node_widget/includes/node_widget.form.inc --- node_widget_orig/includes/node_widget.form.inc 2010-03-31 20:06:22.000000000 +0100 +++ node_widget/includes/node_widget.form.inc 2010-08-30 10:48:18.180905655 +0100 @@ -17,6 +17,16 @@ function node_widget_form_alter(&$form, $form['#field_info'][$field_name] = $field_info; } } + + foreach ($node_widget->get_children() as $delta) { + $widget_form = $node_widget->get_form($delta); + $widget_form_state = $node_widget->get_form_state($delta); + $widget_form_id = $node_widget->get_form_id($delta); + foreach (module_implements('form_alter') as $module) { + $function = $module .'_form_alter'; + call_user_func_array($function, array($widget_form, $widget_form_state, $widget_form_id)); + } + } } } } @@ -52,8 +62,12 @@ function node_widget_node_form_after_bui * Implementation of node form #submit callback. */ function node_widget_node_form_submit(&$form, &$form_state) { + $submit_buttons = array ( + 'submit', // Core Drupal + 'redirect_save_edit_submit', // save_edit module + ); - if (in_array('node_form_submit', $form_state['clicked_button']['#submit'])) { + if (count(array_intersect($submit_buttons, $form_state['clicked_button']['#submit']))) { foreach (node_widget_get_fields($form) as $field_name => $field) { $node_widget = new node_widget($field, $form, $form_state); foreach ($node_widget->get_children() as $delta) { @@ -73,7 +87,9 @@ function node_widget_node_form_validate( foreach (node_widget_get_fields($form) as $field) { $node_widget = new node_widget($field, $form, $form_state); foreach ($node_widget->get_children() as $delta) { - $node_widget->validate($delta); + if ($form['nid']['#post'][$field['field_name']][$delta]['node_widget']['remove'] != 1) { + $node_widget->validate($delta); + } } } } diff -urp node_widget_orig/modules/content.node_widget.inc node_widget/modules/content.node_widget.inc --- node_widget_orig/modules/content.node_widget.inc 2010-03-31 21:56:53.000000000 +0100 +++ node_widget/modules/content.node_widget.inc 2010-08-30 12:02:55.439714122 +0100 @@ -59,9 +59,6 @@ function content_node_widget_widget_sett if (!in_array($field['widget']['type'], $widgets)) { $_field['supported'] = FALSE; $_field['message'] = t('Widget !widget not supported.', array('!widget' => $widget_info[$field['widget']['type']]['label'])); - } elseif ($field['multiple']) { - $_field['supported'] = FALSE; - $_field['message'] = t('Multiple number of values not supported.', array('!widget' => $widget_info[$field['widget']['type']]['label'])); } $settings[] = $_field; $_field['message'] = ''; diff -urp node_widget_orig/modules/date.node_widget.inc node_widget/modules/date.node_widget.inc --- node_widget_orig/modules/date.node_widget.inc 2010-02-23 14:57:19.000000000 +0000 +++ node_widget/modules/date.node_widget.inc 2010-08-30 13:14:24.954780480 +0100 @@ -9,6 +9,8 @@ function date_node_widget_widgets_info() 'date_select', 'date_text', 'date_popup', + 'date_repeat', + 'date_popup_repeat', ); }