Skip to content
Snippets Groups Projects
Commit 05057f1f authored by Pierre Dureau's avatar Pierre Dureau
Browse files

Issue #3516558 by plopesc, m4olivei, cb_govcms, tarawij: Settings is not a...

Issue #3516558 by plopesc, m4olivei, cb_govcms, tarawij: Settings is not a valid render array in navigation module
parent 1a2079a4
No related branches found
No related tags found
3 merge requests!5423Draft: Resolve #3329907 "Test2",!3478Issue #3337882: Deleted menus are not removed from content type config,!579Issue #2230909: Simple decimals fail to pass validation
Pipeline #481359 passed with warnings
Pipeline: drupal

#481371

    Pipeline: drupal

    #481365

      Pipeline: drupal

      #481361

        ...@@ -6,13 +6,14 @@ ...@@ -6,13 +6,14 @@
        * Available variables: * Available variables:
        * - content: The content for this layout. * - content: The content for this layout.
        * - attributes: HTML attributes for the layout <div>. * - attributes: HTML attributes for the layout <div>.
        * - content.settings.hide_logo: Whether to hide the logo. * - settings: layout settings. The following are related to the logo:
        * - content.settings.logo_path: The path to the logo image if logo_managed * - hide_logo: Whether to hide the logo.
        * in navigation.settings configuration has been set. * - logo_path: The path to the logo image if logo_managed
        * - content.settings.logo_width: The width of the logo image. Available if * in navigation.settings configuration has been set.
        * logo_path points to a valid image file. * - logo_width: The width of the logo image. Available if
        * - content.settings.logo_height: The height of the logo image. Available if * logo_path points to a valid image file.
        * logo_path points to a valid image file. * - settings.logo_height: The height of the logo image. Available if
        * logo_path points to a valid image file.
        * @ingroup themeable * @ingroup themeable
        */ */
        #} #}
        ...@@ -45,10 +46,10 @@ ...@@ -45,10 +46,10 @@
        <h3 id="{{ title_menu }}" class="visually-hidden">{{ 'Administrative toolbar content'|t }}</h3> <h3 id="{{ title_menu }}" class="visually-hidden">{{ 'Administrative toolbar content'|t }}</h3>
        {# @todo - Needs to be placed here so we can have the header footer on mobile. #} {# @todo - Needs to be placed here so we can have the header footer on mobile. #}
        <div class="admin-toolbar__header"> <div class="admin-toolbar__header">
        {% if not content.settings.hide_logo %} {% if not settings.hide_logo %}
        <a class="admin-toolbar__logo" href="{{ path('<front>') }}"> <a class="admin-toolbar__logo" href="{{ path('<front>') }}">
        {% if content.settings.logo_path is not null %} {% if settings.logo_path is not null %}
        <img alt="{{ 'Navigation logo'|t }}" src="{{ content.settings.logo_path }}" loading="eager" width="{{ content.settings.logo_width|default(40) }}" height="{{ content.settings.logo_height|default(40) }}"> <img alt="{{ 'Navigation logo'|t }}" src="{{ settings.logo_path }}" loading="eager" width="{{ settings.logo_width|default(40) }}" height="{{ settings.logo_height|default(40) }}">
        {% else %} {% else %}
        {% include '@navigation/logo.svg.twig' with { {% include '@navigation/logo.svg.twig' with {
        label: 'Navigation logo'|t label: 'Navigation logo'|t
        ......
        ...@@ -134,7 +134,7 @@ public function doBuildNavigation(): array { ...@@ -134,7 +134,7 @@ public function doBuildNavigation(): array {
        $asset_url = $module_path . '/assets/fonts/inter-var.woff2'; $asset_url = $module_path . '/assets/fonts/inter-var.woff2';
        $defaults = [ $defaults = [
        'settings' => ['hide_logo' => $logo_provider === self::LOGO_PROVIDER_HIDE], '#settings' => ['hide_logo' => $logo_provider === self::LOGO_PROVIDER_HIDE],
        '#attached' => [ '#attached' => [
        'html_head_link' => [ 'html_head_link' => [
        [ [
        ...@@ -157,10 +157,10 @@ public function doBuildNavigation(): array { ...@@ -157,10 +157,10 @@ public function doBuildNavigation(): array {
        if (!empty($logo_path) && is_file($logo_path)) { if (!empty($logo_path) && is_file($logo_path)) {
        $logo_managed_url = $this->fileUrlGenerator->generateAbsoluteString($logo_path); $logo_managed_url = $this->fileUrlGenerator->generateAbsoluteString($logo_path);
        $image = $this->imageFactory->get($logo_path); $image = $this->imageFactory->get($logo_path);
        $build[0]['settings']['logo_path'] = $logo_managed_url; $build[0]['#settings']['logo_path'] = $logo_managed_url;
        if ($image->isValid()) { if ($image->isValid()) {
        $build[0]['settings']['logo_width'] = $image->getWidth(); $build[0]['#settings']['logo_width'] = $image->getWidth();
        $build[0]['settings']['logo_height'] = $image->getHeight(); $build[0]['#settings']['logo_height'] = $image->getHeight();
        } }
        } }
        } }
        ......
        0% Loading or .
        You are about to add 0 people to the discussion. Proceed with caution.
        Please register or to comment