commit 796bf1e5614e8949d55d4b84bab797b0e05881f7 Author: Joel Pittet Date: Tue Jun 9 13:13:21 2015 -0700 3 diff --git a/core/modules/file/file.field.inc b/core/modules/file/file.field.inc index 4131200..bd6a4c5 100644 --- a/core/modules/file/file.field.inc +++ b/core/modules/file/file.field.inc @@ -82,7 +82,7 @@ function template_preprocess_file_widget_multiple(&$variables) { foreach (Element::children($widget) as $sub_key) { if (isset($widget[$sub_key]['#type']) && $widget[$sub_key]['#type'] == 'submit') { $operations_elements[] = $widget[$sub_key]; - unset($widget[$sub_key]); + hide($widget[$sub_key]); } } @@ -90,22 +90,22 @@ function template_preprocess_file_widget_multiple(&$variables) { // each can be rendered later in its own column. if ($element['#display_field']) { $display_element = $widget['display']; - unset($widget['display']); + hide($widget['display']); } $weight_element = $widget['_weight']; $weight_element['#attributes']['class'] = [$weight_class]; - unset($widget['_weight']); + hide($widget['_weight']); // Store the remaining elements in a column, without the normal wrappers. $widget['#theme_wrappers'] = array(); $information = $widget; - unset($element[$key]); + hide($widget); // Arrange the row with all of the rendered columns. - $row = []; + $row = array(); $row['information'] = $information; - if ($display_element) { + if (!empty($display_element)) { unset($display_element['#title']); $display_element['#wrapper_attributes']['class'] = ['checkbox']; $row['display'] = $display_element; @@ -119,7 +119,9 @@ function template_preprocess_file_widget_multiple(&$variables) { $variables['table'] = array( '#type' => 'table', '#header' => $headers, - '#attributes' => ['id' => $table_id], + '#attributes' => array( + 'id' => $table_id, + ), '#tabledrag' => array( array( 'action' => 'order',