Warning: Undefined array key "extension" in belgrade_preprocess_region() (line 35 of themes/contrib/belgrade/includes/region.inc).

Created on 11 June 2023, over 1 year ago
Updated 25 July 2023, over 1 year ago

Problem/Motivation

It would be nice if you could accept this solution if tests are throwing no new warnings?

In region.inc line 35 I get this warning away with the null coalescing operator (??)

    if (theme_get_setting('navigation_logo') === 1) {
      $variables['site_logo'] = \Drupal::service('file_url_generator')->generateString(theme_get_setting('logo.url'));
      $logo_path_info = pathinfo($variables['site_logo']);
      if (theme_get_setting('inline_logo') === 1 && ($logo_path_info['extension'] ?? NULL) === 'svg') {
        $variables['inline_logo'] = true;
      }
    }

move on working in this fantastic theme!
regards, Erich

🐛 Bug report
Status

Closed: works as designed

Version

2.0

Component

Code

Created by

🇦🇹Austria enorm

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @enorm
  • 🇷🇸Serbia majmunbog

    Sure! Please go ahead and create a patch. I would be more than happy to test it. Thanks.

  • 🇷🇸Serbia majmunbog

    I don't like the approach in the solution.
    Can you give me more information when is this issue happening? I'm guessing you have no logo added to the theme.

  • 🇦🇹Austria enorm

    You are completely wright!
    I disabled the SVG-Logo in my belgrade_sub theme and the warning is gone away!

    General/General/Inline SVG logo
    uncheck: Place the logo SVG code in the DOM.

    Thank you!

    Drupal-Version 9.5.10
    PHP 8.1.18
    MariaDB 10.3.27
    Apache/2.4.56 (Debian)

  • Status changed to Closed: works as designed over 1 year ago
Production build 0.71.5 2024