Skip to content
Snippets Groups Projects

Add constraints to image.settings and mark it fully validatable

Closes #3425870

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
13 13
14 14 protected static $modules = ['image'];
15 15
16 /**
17 * {@inheritdoc}
18 */
19 protected static $configSchemaCheckerExclusions = [
20 // The schema of `image.settings` requires that the `preview_image` value
21 // be a file that actually exists, but that won't be the case in this test.
22 // Therefore, exclude `image.settings` from the schema check; we still
23 // assert that the expected value is migrated.
24 'image.settings',
25 ];
  • Wim Leers
  • Adam G-H added 185 commits

    added 185 commits

    Compare with previous version

  • Adam G-H added 1 commit

    added 1 commit

    Compare with previous version

  • Adam G-H added 1 commit

    added 1 commit

    Compare with previous version

  • Adam G-H added 1 commit

    added 1 commit

    Compare with previous version

  • Adam G-H added 1 commit

    added 1 commit

    • 7ba61fa3 - Test that preview_image is validated as an image

    Compare with previous version

  • Wim Leers
  • 87 87
    88 88 image.settings:
    89 89 type: config_object
    90 constraints:
    91 FullyValidatable: ~
    90 92 mapping:
    91 93 preview_image:
    92 94 type: string
    93 95 label: 'Preview image'
    96 constraints:
    97 NotBlank: []
    98 # We need to use Symfony's Image constraint because it will accept a file
    99 # path as a string, whereas the File module's FileIsImage constraint expects
    100 # a full file entity.
    101 Image: []
    • Comment on lines +98 to +101

      Dear committer,

      This is why a "new" constraint is being added in ConstraintManager, but it's really just another Symfony constraint that we're bringing into Drupal. This explains why we cannot use Drupal's own FileIsImage constraint.

    • Please register or sign in to reply
  • 60 60 // Enable saving the logs and set the post migration admin user name.
    61 61 $this->outputLogs = TRUE;
    62 62 $this->migratedAdminUserName = 'admin';
    63 $this->expectedLoggedErrors = 27;
    63 $this->expectedLoggedErrors = 29;
  • Alex Pott added 1 commit

    added 1 commit

    Compare with previous version

  • Please register or sign in to reply
    Loading