Skip to content
Snippets Groups Projects
Verified Commit a4785d91 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3385283 by e0ipso, smustgrave, idiaz.roncero, jldust, wotnak:...

Issue #3385283 by e0ipso, smustgrave, idiaz.roncero, jldust, wotnak: Components without props throw error

(cherry picked from commit 99040d47)
parent c4db1fe9
No related branches found
No related tags found
20 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,!5950Issue #3403653 by alexpott, longwave: Incorporate improvements to how contrib runs PHPStan to core,!5858Issue #3401971 by fjgarlin: Test-only job shouldn't require constant rebases...,!5716Draft: Issue #3401102 by Spokje, longwave, smustgrave: Nightwatch artifacts on GitLab not retained,!5674Transaction autocommit during shutdown relies on unreliable object destruction order,!5644Issue #3395563 by nireneko, marvil07, lauriii, borisson_, smustgrave, Wim...
Pipeline #49967 failed
Pipeline: drupal

#49973

    Pipeline: drupal

    #49972

      Pipeline: drupal

      #49971

        +1
        ......@@ -79,6 +79,10 @@ public function validateDefinition(array $definition, bool $enforce_schemas): bo
        }
        return TRUE;
        }
        // If there are no props, force casting to object instead of array.
        if (($schema['properties'] ?? NULL) === []) {
        $schema['properties'] = new \stdClass();
        }
        $classes_per_prop = $this->getClassProps($schema);
        $missing_class_errors = [];
        foreach ($classes_per_prop as $prop_name => $class_types) {
        ......
        $schema: https://git.drupalcode.org/project/sdc/-/raw/1.x/src/metadata.schema.json
        name: No props
        description: Component without properties
        props:
        type: object
        properties: {}
        This is a test string.
        ......@@ -44,6 +44,7 @@ public function testRender(): void {
        $this->checkRenderElementAlters();
        $this->checkSlots();
        $this->checkInvalidSlot();
        $this->checkEmptyProps();
        }
        /**
        ......@@ -335,6 +336,22 @@ public function checkInvalidSlot(): void {
        $this->renderComponentRenderArray($build);
        }
        /**
        * Ensure that components can have 0 props.
        */
        public function checkEmptyProps(): void {
        $build = [
        '#type' => 'component',
        '#component' => 'sdc_test:no-props',
        '#props' => [],
        ];
        $crawler = $this->renderComponentRenderArray($build);
        $this->assertEquals(
        $crawler->filter('#sdc-wrapper')->innerText(),
        'This is a test string.'
        );
        }
        /**
        * Ensures some key aspects of the plugin definition are correctly computed.
        *
        ......
        0% Loading or .
        You are about to add 0 people to the discussion. Proceed with caution.
        Please register or to comment