Skip to content
Snippets Groups Projects
Verified Commit bb42fa92 authored by Lee Rowlands's avatar Lee Rowlands
Browse files

Issue #3410126 by kim.pepper, catch, larowlan, DamienMcKenna, alexpott: File...

Issue #3410126 by kim.pepper, catch, larowlan, DamienMcKenna, alexpott: File validation logic from #3221793 broke backwards compatibility

(cherry picked from commit bd37e393)
parent c2090141
No related branches found
No related tags found
15 merge requests!8376Drupal views: adding more granularity to the ‘use ajax’ functionality,!8300Issue #3443586 View area displays even when parent view has no results.,!7567Issue #3153723 by quietone, Hardik_Patel_12: Change the scaffolding...,!7565Issue #3153723 by quietone, Hardik_Patel_12: Change the scaffolding...,!7509Change label "Block description" to "Block type",!7344Issue #3292350 by O'Briat, KlemenDEV, hswong3i, smustgrave, quietone: Update...,!6922Issue #3412959 by quietone, smustgrave, longwave: Fix 12 'un' words,!6848Issue #3417553 by longwave: Remove withConsecutive() in CacheCollectorTest,!6720Revert "Issue #3358581 by pfrenssen, _tarik_, a.dmitriiev, smustgrave:...,!6560Update ClaroPreRender.php, confirming classes provided are in array format,!6528Issue #3414261 by catch: Add authenticated user umami performance tests,!6501Issue #3263668 by omkar-pd, Wim Leers, hooroomoo: Re-enable inline form errors...,!6354Draft: Issue #3380392 by phma: Updating language weight from the overview reverts label if translated,!6324Issue #3416723 by Ludo.R: Provide a "node type" views default argument,!6119Issue #3405704 by Spokje, longwave: symfony/psr-http-message-bridge major version bump
Pipeline #70264 passed with warnings
Pipeline: drupal

#70278

    Pipeline: drupal

    #70272

      Pipeline: drupal

      #70269

        +1
        ......@@ -2,6 +2,7 @@
        namespace Drupal\file\Validation;
        use Drupal\Component\Plugin\Exception\PluginNotFoundException;
        use Drupal\Core\Extension\ModuleHandlerInterface;
        use Drupal\Core\Validation\ConstraintManager;
        use Drupal\Core\Validation\DrupalTranslator;
        ......@@ -53,7 +54,12 @@ public function validate(FileInterface $file, array $validators): ConstraintViol
        else {
        // Create the constraint.
        // Options are an associative array of constraint properties and values.
        $constraints[] = $this->constraintManager->create($validator, $options);
        try {
        $constraints[] = $this->constraintManager->create($validator, $options);
        }
        catch (PluginNotFoundException) {
        @trigger_error(sprintf('Passing invalid constraint plugin ID "%s" in the list of $validators to Drupal\file\Validation\FileValidator::validate() is deprecated in drupal:10.2.0 and will throw an exception in drupal:11.0.0. See https://www.drupal.org/node/3363700', $validator), E_USER_DEPRECATED);
        }
        }
        }
        ......
        ......@@ -31,9 +31,11 @@ public function testValidate(): void {
        // Use a mix of legacy functions and plugin IDs to test both work.
        // Each Constraint has its own tests under
        // core/modules/file/tests/src/Kernel/Plugin/Validation/Constraint.
        // Also check that arbitrary strings can be used.
        $validators = [
        'file_validate_name_length' => [],
        'FileNameLength' => [],
        'foo' => [],
        ];
        file_test_reset();
        ......@@ -42,6 +44,7 @@ public function testValidate(): void {
        $this->assertCount(0, $violations);
        $this->assertCount(1, file_test_get_calls('validate'));
        $this->expectDeprecation('Passing invalid constraint plugin ID "foo" in the list of $validators to Drupal\file\Validation\FileValidator::validate() is deprecated in drupal:10.2.0 and will throw an exception in drupal:11.0.0. See https://www.drupal.org/node/3363700');
        file_test_reset();
        $this->file->set('filename', '');
        $violations = $this->validator->validate($this->file, $validators);
        ......
        0% Loading or .
        You are about to add 0 people to the discussion. Proceed with caution.
        Please register or to comment