Undefined array key 1 in template_preprocess_languageicons_link_content()

Created on 1 July 2023, over 1 year ago
Updated 11 July 2024, 4 months ago

if Image size empty (not required)

Warning: Undefined array key 1 in template_preprocess_languageicons_link_content() (line 114 of /var/www/d10mnw/dog.d10.promo.org.il/modules/~other/languageicons/languageicons.module)

languageicons.module

/*WT-patch: Undefined array key */
  //[$width, $height] = explode('x', $size);
  [$width, $height] = $size ? explode('x', $size) : FALSE;

  if ($path = \Drupal::config('languageicons.settings')->get('path')) {
    $variables['icon'] = [
      '#theme' => 'image',
      '#uri' => str_replace('*', $language->getId(), Html::escape($path)),
      '#alt' => $title,
      '#title' => $title,
      '#width' => $width ?? '', //$size ? $width : '', //$width,
      '#height' => $height ?? '', //$size ? $height : '', //$height,
      '#attributes' => ['class' => ['language-icon']],
    ];
/*<<<*/

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024