Problem/Motivation

Currently file_validate takes and array of validators keyed by function name. We can use the syntax accepted by \Drupal\Core\Security\DoTrustedCallbackTrait::doTrustedCallback to specify a class method or a service much like \Drupal\Core\Controller\ControllerResolver and \Drupal\Core\Render\Renderer::doCallback does.

Steps to reproduce

Proposed resolution

Add logic to look up file validators by class method or service definition and call doTrustedCallback() on them.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Comments

kim.pepper created an issue. See original summary.

kim.pepper’s picture

kim.pepper’s picture

Title: Deprecate file_validate and replace with a service that uses a callable resolver » Allow validators passed to file_validate to use callable syntax
Issue summary: View changes

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

kim.pepper’s picture

kim.pepper’s picture

Status: Postponed » Closed (outdated)