Problem/Motivation
If there's a field configured with empty allowed extensions file upload is not working and shows an error message stating that something went wrong. In log messages the following error can be found:
Drupal\Component\Plugin\Exception\PluginNotFoundException: The "file_validate_extensions" plugin does not exist. Valid plugin IDs for Drupal\Core\Validation\ConstraintManager are: Callback, Blank, NotBlank, Email, Choice, File, Image, IdenticalTo, SourceEditingPreventSelfXssConstraint, CKEditor5Element, StyleSensibleElement, CKEditor5MediaAndFilterSettingsInSync, SourceEditingRedundantTags, CKEditor5ToolbarItemConditionsMet, CKEditor5ToolbarItemDependencyConstraint, CKEditor5ToolbarItem, CKEditor5FundamentalCompatibility, UniqueLabelInList, CKEditor5EnabledConfigurablePlugins, CropTypeMachineNameValidation, CropTypeAspectRatioValidation, CustomFieldLinkAccess, CustomFieldTime, CustomFieldLinkType, CustomFieldLinkNotExistingInternal, CustomFieldLinkExternalProtocols, DateTimeFormat, FileNameLength, FileExtensionSecure, FileSizeLimit, FileIsImage, FileImageDimensions, FileUriUnique, FileValidation, FileExtension, FileEncoding, GeolocationValidateCoordinate, LinkAccess, LinkType, LinkNotExistingInternal, LinkExternalProtocols, MenuSettings, PathAlias, RedirectSourceLinkType, RedirectUniqueHash, SchedulerPublishOn, SchedulerUnpublishOn, TaxonomyHierarchy, CampaignRelatedContent, MinInspirationMediaItems, RequiredWhenMinChildren, ExactCount, UserName, RoleExists, UserMailUnique, UserNameUnique, ProtectedUserField, UserCancelMethod, UserMailRequired, VideoEmbedValidation, MenuTreeHierarchy, ExtensionName, ExtensionExists, MenuLinkDepth, EntityUntranslatableFields, EntityChanged, Bundle, ValidReference, EntityType, ImmutableProperties, ReferenceAccess, EntityHasField, UniquePathAlias, ValidPath, Range, CountryCode, AllowedValues, PrimitiveType, Count, UriHost, UniqueField, ClassResolver, Null, EntityBundleExists, Length, ValidKeys, AtLeastOneOf, Uuid, FullyValidatable, ComplexData, NotNull, Regex, ConfigExists, LangcodeRequiredIfTranslatableValues, RequiredConfigDependencies, PluginExists in Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition() (line 53 of /app/web/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php).
This is caused by deprecations introduced in Drupal 10.2.0.
Steps to reproduce
1. Add a file upload field to a content type
2. Configure the field with empty allowed extensions
3. Create/edit a node of said content type
4. Try uploading a file in the file upload field.
Proposed resolution
Fix the calls to deprecated functions.
Comments