Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / file / src / Plugin / Field / FieldWidget / FileWidget.php
index 587a396fc6029221b384e9e9ef99b7b81291db77..f1da5a4b5f1feb64023a4d2aaa5778eb46605790 100644 (file)
@@ -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);
     }