Commit 7d3834d8 authored by stBorchert's avatar stBorchert Committed by joseph.olstad

Issue #2923029 by stBorchert: Do not reset item weight while removing an item

parent ff0364bd
......@@ -168,7 +168,7 @@ function media_field_widget_form(&$form, &$form_state, $field, $instance, $langc
foreach ($items as $item) {
$elements[$delta] = $element;
$elements[$delta]['#default_value'] = $item;
$elements[$delta]['#weight'] = $delta;
$elements[$delta]['#weight'] = isset($item['_weight']) ? $item['_weight'] : $delta;
// And then add one more empty row for new uploads except when this is a
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