function inline_entity_form_update_row_weights in Inline Entity Form 7
Updates entity weights based on their weights in the widget.
1 string reference to 'inline_entity_form_update_row_weights'
- inline_entity_form_field_widget_form in ./
inline_entity_form.module - Implements hook_field_widget_form().
File
- ./
inline_entity_form.module, line 837 - Provides a widget for inline management (creation, modification, removal) of referenced entities. The primary use case is the parent -> children one (for example, order -> line items), where the child entities are never managed outside the…
Code
function inline_entity_form_update_row_weights($element, &$form_state, $form) {
$ief_id = $element['#ief_id'];
// Loop over the submitted delta values and update the weight of the entities
// in the form state.
foreach (element_children($element['entities']) as $key) {
$form_state['inline_entity_form'][$ief_id]['entities'][$key]['weight'] = $element['entities'][$key]['delta']['#value'];
}
}