conflict with gin theme

Created on 25 January 2025, 2 months ago

Problem/Motivation

2025/01/25 09:34:24 [error] 16712#16776: *52 FastCGI sent in stderr: "Uncaught PHP Exception Error: "Call to a member function getOption() on string" at H:\wemp\nginx\html\nkmz\modules\contrib\ui_icons\modules\ui_icons_menu\ui_icons_menu.module line 95" while reading response header from upstream, client: 127.0.0.1, server: localhost, request: "GET /admin/appearance HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "127.0.0.1:81", referrer: "http://127.0.0.1:81/admin/appearance"

Steps to reproduce

drupal 10.4 +gin theme 4.x + UI Icons Menu

Proposed resolution

ui_icons_menu.module line 95,check if the $url is a object.

function ui_icons_menu__preprocess_menu_item(array &$item): void {
  /** @var \Drupal\Core\Url $url */
  $url = &$item['url'];
  + if(is_object($url)){  
    if (!$icon = $url->getOption('icon')) {
      return;
    }
  
    if ($url->getOption('ui_icons_processed')) {
      return;
    }
  
    $url->setOption('ui_icons_processed', TRUE);
    ui_icons_menu_generate_markup($item['title'], $icon['target_id'], $icon['settings'] ?? [], $url->getOption('icon_display') ?? 'before');


+  }

}

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

1.0

Component

UI Icons Menu

Created by

🇨🇳China huangweiqiu

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