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

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Comments

_michel_ created an issue. See original summary.

cilefen’s picture

Component: base system » plugin system
Issue tags: -10.2 imce

Is the IMCE module present?

cilefen’s picture

Status: Active » Postponed (maintainer needs more info)
larowlan’s picture

Project: Drupal core » IMCE
Version: 10.2.x-dev » 3.0.9
Component: plugin system » Code
Issue tags: +Bug Smash Initiative
_michel_’s picture

More 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

Uncaught PHP Exception Drupal\Component\Plugin\Exception\PluginNotFoundException: "The "Drupal\imce\Plugin\ImcePlugin\Upload::validateFileName" plugin does not exist.

e5sego’s picture

I can confirm what _michel_ described.

darisb’s picture

Same as _michel_

mlncn’s picture

Status: Postponed (maintainer needs more info) » Active

Confirming 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:

An AJAX HTTP error occurred.
Path: /imce
HTTP Result Code: 500
StatusText: 500 Service unavailable (with message)
ResponseText: The website encountered an unexpected error. Try again later.

And then in the logs the same PHP error as already reported in this issue.

More information about our environment:

  • Drupal 10.2.0
  • PHP 8.1.26
  • Apache/2.4.57 (Debian)

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

  • ufku committed 4aaaa7d6 on 3.x
    Issue #3409317: Fix static method not working as an upload validator
    
ufku’s picture

Version: 3.0.9 » 3.0.10
Status: Active » Fixed

Fixed the static method not working as an upload validator.

Thanks for reporting.

mlncn’s picture

Awesome, thank you! Works wonderfully.

cilefen’s picture

darisb’s picture

3.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.

_michel_’s picture

Problem solved for me.
Thanks a lot.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.