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

Created on 11 June 2023, about 1 year ago
Updated 25 July 2023, 11 months 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 11 months ago
Production build 0.69.0 2024