summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2015-08-05 16:38:07 (GMT)
committerAlex Pott2015-08-05 16:38:07 (GMT)
commitf802277731ba90296e97119cc2dc24e357063489 (patch)
tree8e40b83fd045920eb78d0b93a73321dc6e96d034
parent8bfdce268946a97ef9ecedf4ed894724c661ed3d (diff)
Issue #2502781 by tedstein, johnshortess, joelpittet, pwolanin, stefan.r, chx, mandclu, RavindraSingh, YesCT, cilefen, xjm, lauriii: Remove SafeMarkup::set in template_preprocess_file_widget_multiple()
-rw-r--r--core/modules/file/file.field.inc18
1 files changed, 9 insertions, 9 deletions
diff --git a/core/modules/file/file.field.inc b/core/modules/file/file.field.inc
index f09760f..3fc93ef 100644
--- a/core/modules/file/file.field.inc
+++ b/core/modules/file/file.field.inc
@@ -6,7 +6,6 @@
*/
use Drupal\Component\Utility\Html;
-use Drupal\Component\Utility\SafeMarkup;
use Drupal\Core\Field\FieldDefinitionInterface;
use Drupal\Core\Render\Element;
@@ -96,13 +95,6 @@ function template_preprocess_file_widget_multiple(&$variables) {
// Render everything else together in a column, without the normal wrappers.
$widget['#theme_wrappers'] = array();
$information = drupal_render($widget);
-
- // Render the previously hidden elements, using render() instead of
- // drupal_render(), to undo the earlier hide().
- $operations = '';
- foreach ($operations_elements as $operation_element) {
- $operations .= render($operation_element);
- }
$display = '';
if ($element['#display_field']) {
unset($widget['display']['#title']);
@@ -121,7 +113,15 @@ function template_preprocess_file_widget_multiple(&$variables) {
$row[] = $display;
}
$row[] = $weight;
- $row[] = SafeMarkup::set($operations);
+
+ // Show the buttons that had previously been marked as hidden in this
+ // preprocess function. We use show() to undo the earlier hide().
+ foreach (Element::children($operations_elements) as $key) {
+ show($operations_elements[$key]);
+ }
+ $row[] = array(
+ 'data' => $operations_elements,
+ );
$rows[] = array(
'data' => $row,
'class' => isset($widget['#attributes']['class']) ? array_merge($widget['#attributes']['class'], array('draggable')) : array('draggable'),