Undefined array key 1 in template_preprocess_languageicons_link_content()

Created on 1 July 2023, 12 months ago
Updated 27 June 2024, 2 days 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

🇮🇱Israel Promo-IL

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

Merge Requests

Comments & Activities

Production build 0.69.0 2024