Problem/Motivation
After updating to last version of drupal core "10.2", there is an error in the module imce.
This is therror reported by php 8.2
Uncaught PHP Exception Drupal\Component\Plugin\Exception\PluginNotFoundException: "The "Drupal\imce\Plugin\ImcePlugin\Upload::validateFileName" plugin does not exist. Valid plugin IDs for Drupal\Core\Validation\ConstraintManager are: Callback, Blank, NotBlank, Email, Choice, BlockContentEntityChanged, CKEditor5ToolbarItemConditionsMet, CKEditor5MediaAndFilterSettingsInSync, CKEditor5FundamentalCompatibility, CKEditor5Element, UniqueLabelInList, SourceEditingPreventSelfXssConstraint, CKEditor5EnabledConfigurablePlugins, SourceEditingRedundantTags, StyleSensibleElement, CKEditor5ToolbarItemDependencyConstraint, CKEditor5ToolbarItem, CommentName, DateTimeFormat, FileNameLength, FileUriUnique, FileSizeLimit, FileExtensionSecure, FileValidation, FileIsImage, FileImageDimensions, FileExtension, LinkAccess, LinkType, LinkNotExistingInternal, LinkExternalProtocols, MenuTreeHierarchy, MenuSettings, PathAlias, TaxonomyHierarchy, UserMailUnique, ProtectedUserField, UserNameUnique, UserName, UserMailRequired, UniquePathAlias, ValidPath, Uuid, Regex, ComplexData, Count, UniqueField, AllowedValues, Range, Length, ValidKeys, NotNull, Null, PrimitiveType, ImmutableProperties, EntityType, EntityUntranslatableFields, ReferenceAccess, EntityHasField, Bundle, EntityChanged, ValidReference, PluginExists, ExtensionName, ExtensionExists, RequiredConfigDependencies, ConfigExists" at web/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php
Comments
Comment #2
cilefen commentedIs the IMCE module present?
Comment #3
cilefen commentedComment #4
larowlanComment #5
_michel_ commentedMore info about this issue.
IMCE was working perfectly with drupal 10.1.7
Once updated drupal to 10.2, I get a php error when trying to upload a file.
Creating a subdirectory with IMCE works well.
This is the php error when trying to upload a file
Comment #6
e5sego commentedI can confirm what _michel_ described.
Comment #7
darisb commentedSame as _michel_
Comment #8
mlncn commentedConfirming the same error, and that we can reproduce it at /admin/imce/browser — the module is definitely installed and present!
As was reported in the duplicate #3409366: Uploading with IMCE shows AJAX error the problem manifests to an editor uploading a file through IMCE as a pop-up box with an AJAX error:
And then in the logs the same PHP error as already reported in this issue.
More information about our environment:
Maybe switching to PHP Attribute based plugins would fix it: https://www.drupal.org/docs/drupal-apis/plugin-api/attribute-based-plugins
But they are not supposed to have broken old plugins in 10.2! But it seems IMCE might not be alone in this regard: #3409599: Drupal\Component\Plugin\Exception\PluginNotFoundException: The "webform_file_validate_extensions" plugin does not exist
Comment #10
ufku commentedFixed the static method not working as an upload validator.
Thanks for reporting.
Comment #11
mlncn commentedAwesome, thank you! Works wonderfully.
Comment #12
cilefen commentedComment #13
darisb commented3.0.10 fixed the issue for me. It failed to install when I used the Drupal module updater. It installed successfully using Composer. Thank you.
Comment #14
_michel_ commentedProblem solved for me.
Thanks a lot.