Skip to content
Snippets Groups Projects
Commit 3bc425c2 authored by catch's avatar catch
Browse files

Issue #3426309 by Wim Leers, smustgrave: Add config validation for weights...

Issue #3426309 by Wim Leers, smustgrave: Add config validation for weights (blocks, filters, etc. all use weights)

(cherry picked from commit 9c1e1035)
parent 5959b69d
Branches
Tags
36 merge requests!13092Issue #3498963 by benjifisher, heddn: Add lookup_migrations configuration to...,!12802Issue #3537193 by opauwlo: Add enable absolute path option for CKEditor5 image uploads,!12745Fixed: Path alias language doesn't changes on changing of node language,!12684Issue #3220784,!12537Add ViewsConfigUpdater deprecation support for default_argument_skip_url,!12523Issue #3493858 by vidorado, xavier.masson, smustgrave: Extend ViewsBlockBase...,!122353526426-warning-for-missing,!12212Issue #3445525 by alexpott, japerry, catch, mglaman, longwave: Add BC layer...,!11958Issue #3490507 by alexpott, smustgrave: Fix bogus mocking in...,!11769Issue #3517987: Add option to contextual filters to encode slashes in query parameter.,!11185Issue #3477324 by andypost, alexpott: Fix usage of str_getcsv() and fgetcsv() for PHP 8.4,!10602Issue #3438769 by vinmayiswamy, antonnavi, michelle, amateescu: Sub workspace does not clear,!10301Issue #3469309 by mstrelan, smustgrave, moshe weitzman: Use one-time login...,!10187Issue #3487488 by dakwamine: ExtensionMimeTypeGuesser::guessMimeType must support file names with "0" (zero) like foo.0.zip,!9944Issue #3483353: Consider making the createCopy config action optionally fail...,!9929Issue #3445469 by pooja_sharma, smustgrave: Add additional test coverage for...,!9787Resolve issue 3479427 - bootstrap barrio issue under Windows,!9742Issue #3463908 by catch, quietone: Split OptionsFieldUiTest into two,!9526Issue #3458177 by mondrake, catch, quietone, godotislate, longwave, larowlan,...,!8738Issue #3424162 by camilledavis, dineshkumarbollu, smustgrave: Claro...,!8704Make greek characters available in ckeditor5,!8597Draft: Issue #3442259 by catch, quietone, dww: Reduce time of Migrate Upgrade tests...,!8533Issue #3446962 by kim.pepper: Remove incorrectly added...,!8517Issue #3443748 by NexusNovaz, smustgrave: Testcase creates false positive,!8325Update file Sort.php,!8095Expose document root on install,!7930Resolve #3427374 "Taxonomytid viewsargumentdefault plugin",!7627Issue #3439440 by nicxvan, Binoli Lalani, longwave: Remove country support from DateFormatter,!7445Issue #3440169: When using drupalGet(), provide an associative array for $headers,!7401#3271894 Fix documented StreamWrapperInterface return types for realpath() and dirname(),!7384Add constraints to system.advisories,!7078Issue #3320569 by Spokje, mondrake, smustgrave, longwave, quietone, Lendude,...,!6622Issue #2559833 by piggito, mohit_aghera, larowlan, guptahemant, vakulrai,...,!6502Draft: Resolve #2938524 "Plach testing issue",!38582585169-10.1.x,!3226Issue #2987537: Custom menu link entity type should not declare "bundle" entity key
Pipeline #114094 passed with warnings
Pipeline: drupal

#114104

    Pipeline: drupal

    #114100

      Pipeline: drupal

      #114099

        +1
        Showing
        with 38 additions and 27 deletions
        ......@@ -168,6 +168,17 @@ bytes:
        constraints:
        Callback: ['\Drupal\Component\Utility\Bytes', 'validateConstraint']
        weight:
        type: integer
        label: 'Weight'
        constraints:
        Range:
        # @see PHP_INT_MIN (32-bit)
        min: -2147483648
        # @see PHP_INT_MAX (32-bit)
        max: 2147483647
        FullyValidatable: ~
        # Complex extended data types:
        # Root of a configuration object.
        ......@@ -229,7 +240,7 @@ filter:
        type: boolean
        label: 'Status'
        weight:
        type: integer
        type: weight
        label: 'Weight'
        settings:
        type: filter_settings.[%parent.id]
        ......@@ -483,7 +494,7 @@ display_variant.plugin:
        type: required_label
        label: 'Label'
        weight:
        type: integer
        type: weight
        label: 'Weight'
        uuid:
        type: uuid
        ......
        ......
        ......@@ -101,7 +101,7 @@ field_formatter.entity_view_display:
        type: field_formatter
        mapping:
        weight:
        type: integer
        type: weight
        label: 'Weight'
        region:
        type: string
        ......@@ -144,7 +144,7 @@ core.entity_form_display.*.*.*:
        manager: plugin.manager.field.widget
        interface: '\Drupal\Core\Field\WidgetInterface'
        weight:
        type: integer
        type: weight
        label: 'Weight'
        region:
        type: string
        ......
        ......
        ......@@ -16,7 +16,7 @@ core.menu.static_menu_link_overrides:
        type: string
        label: 'Parent'
        weight:
        type: integer
        type: weight
        label: 'Weight'
        expanded:
        type: boolean
        ......
        ......
        ......@@ -21,7 +21,7 @@ block.block.*:
        type: string
        label: 'Region'
        weight:
        type: integer
        type: weight
        label: 'Weight'
        provider:
        type: string
        ......
        ......
        ......@@ -143,7 +143,7 @@ config_schema_test.ignore:
        type: ignore
        label: 'Indescribable'
        weight:
        type: integer
        type: weight
        label: 'Weight'
        config_schema_test.plugin_types:
        ......
        ......
        ......@@ -10,7 +10,7 @@ config_test_dynamic:
        type: label
        label: 'Label'
        weight:
        type: integer
        type: weight
        label: 'Weight'
        style:
        type: string
        ......
        ......
        ......@@ -25,7 +25,7 @@ contact.form.*:
        type: text
        label: 'Auto-reply'
        weight:
        type: integer
        type: weight
        label: 'Weight'
        message:
        type: text
        ......
        ......
        ......@@ -35,7 +35,7 @@ filter.format.*:
        Length:
        max: 255
        weight:
        type: integer
        type: weight
        label: 'Weight'
        roles:
        type: sequence
        ......
        ......
        ......@@ -23,7 +23,7 @@ image.style.*:
        manager: plugin.manager.image.effect
        interface: 'Drupal\image\ImageEffectInterface'
        weight:
        type: integer
        type: weight
        data:
        type: image.effect.[%parent.id]
        ......
        ......
        ......@@ -98,7 +98,7 @@ language.entity.*:
        type: string
        label: 'Direction'
        weight:
        type: integer
        type: weight
        label: 'Weight'
        locked:
        type: boolean
        ......
        ......
        ......@@ -51,7 +51,7 @@ layout_builder.component:
        configuration:
        type: block.settings.[id]
        weight:
        type: integer
        type: weight
        label: 'Weight'
        additional:
        type: ignore
        ......
        ......
        ......@@ -81,7 +81,7 @@ search.page.*:
        type: string
        label: 'Search page path'
        weight:
        type: integer
        type: weight
        label: 'Weight'
        plugin:
        type: string
        ......
        ......
        ......@@ -44,11 +44,8 @@ taxonomy.vocabulary.*:
        NotBlank:
        allowNull: true
        weight:
        type: integer
        type: weight
        label: 'Weight'
        # A weight can be any integer, positive or negative.
        constraints:
        NotNull: []
        new_revision:
        type: boolean
        label: 'Whether a new revision should be created by default'
        ......
        ......
        ......@@ -49,7 +49,7 @@ tour.tip:
        type: required_label
        label: 'Label'
        weight:
        type: integer
        type: weight
        label: 'Weight'
        position:
        type: string
        ......
        ......
        ......@@ -114,7 +114,7 @@ user.role.*:
        type: required_label
        label: 'Label'
        weight:
        type: integer
        type: weight
        label: 'User role weight'
        is_admin:
        type: boolean
        ......
        ......
        ......@@ -32,7 +32,7 @@ views.display.page:
        type: text
        label: 'Description'
        weight:
        type: integer
        type: weight
        label: 'Weight'
        enabled:
        type: boolean
        ......@@ -63,7 +63,7 @@ views.display.page:
        type: text
        label: 'Description'
        weight:
        type: integer
        type: weight
        label: 'Weight'
        menu_name:
        type: string
        ......
        ......
        ......@@ -26,7 +26,7 @@ workflows.state:
        label: 'Label'
        translation context: 'Workflow state label'
        weight:
        type: integer
        type: weight
        label: 'Weight'
        workflows.transition:
        ......@@ -46,5 +46,5 @@ workflows.transition:
        type: string
        label: 'To state ID'
        weight:
        type: integer
        type: weight
        label: 'Weight'
        ......@@ -157,7 +157,7 @@ public function testSchemaMapping() {
        ];
        $expected['mapping']['weight'] = [
        'label' => 'Weight',
        'type' => 'integer',
        'type' => 'weight',
        ];
        $expected['type'] = 'config_schema_test.ignore';
        $expected['unwrap_for_canonical_representation'] = TRUE;
        ......@@ -206,7 +206,7 @@ public function testSchemaMapping() {
        ],
        ];
        $expected['mapping']['effects']['sequence']['mapping']['data']['type'] = 'image.effect.[%parent.id]';
        $expected['mapping']['effects']['sequence']['mapping']['weight']['type'] = 'integer';
        $expected['mapping']['effects']['sequence']['mapping']['weight']['type'] = 'weight';
        $expected['mapping']['effects']['sequence']['mapping']['uuid']['type'] = 'uuid';
        $expected['mapping']['third_party_settings']['type'] = 'sequence';
        $expected['mapping']['third_party_settings']['label'] = 'Third party settings';
        ......
        ......
        ......@@ -71,8 +71,11 @@ public function testValidate() {
        ]);
        $adapter = ConfigEntityAdapter::createFromEntity($this->entity);
        $violations = $adapter->validate();
        $this->assertCount(1, $violations);
        $this->assertCount(2, $violations);
        $violation = $violations->get(0);
        $this->assertEquals('This value should be a valid number.', $violation->getMessage());
        $this->assertEquals('weight', $violation->getPropertyPath());
        $violation = $violations->get(1);
        $this->assertEquals('This value should be of the correct primitive type.', $violation->getMessage());
        $this->assertEquals('weight', $violation->getPropertyPath());
        }
        ......
        ......
        0% Loading or .
        You are about to add 0 people to the discussion. Proceed with caution.
        Please to comment