summaryrefslogtreecommitdiffstats
path: root/core/modules/file/src/Plugin/Field/FieldWidget/FileWidget.php
diff options
context:
space:
mode:
Diffstat (limited to 'core/modules/file/src/Plugin/Field/FieldWidget/FileWidget.php')
-rw-r--r--core/modules/file/src/Plugin/Field/FieldWidget/FileWidget.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/modules/file/src/Plugin/Field/FieldWidget/FileWidget.php b/core/modules/file/src/Plugin/Field/FieldWidget/FileWidget.php
index 587a396..f1da5a4 100644
--- a/core/modules/file/src/Plugin/Field/FieldWidget/FileWidget.php
+++ b/core/modules/file/src/Plugin/Field/FieldWidget/FileWidget.php
@@ -365,7 +365,7 @@ class FileWidget extends WidgetBase implements ContainerFactoryPluginInterface {
'%list' => implode(', ', $removed_names),
];
$message = t('Field %field can only hold @max values but there were @count uploaded. The following files have been omitted as a result: %list.', $args);
- drupal_set_message($message, 'warning');
+ \Drupal::messenger()->addWarning($message);
$values['fids'] = array_slice($values['fids'], 0, $keep);
NestedArray::setValue($form_state->getValues(), $element['#parents'], $values);
}