diff --git a/core/modules/file/file.module b/core/modules/file/file.module index 60a15d6190..fc3ce622c7 100644 --- a/core/modules/file/file.module +++ b/core/modules/file/file.module @@ -48,6 +48,17 @@ function file_help($route_name, RouteMatchInterface $route_match) { } } +/** + * Implements hook_field_widget_info_alter(). + */ +function file_field_widget_info_alter(array &$info) { + // This allows setting a valid default widget in the FileUriItem annotation. + // It's not strictly needed, but it's a required value on the annotation so + // should be a valid value. + // @see \Drupal\file\Plugin\Field\FieldType\FileUriItem + $info['uri']['field_types'][] = 'file_uri'; +} + /** * Loads file entities from the database. *