- Issue created by @ashutosh.mishra
- 🇮🇳India shiv_yadav
Hello ashutosh.mishra,
I install claro theme but I have not got any error. Shared screenshot as well .
my configuration:
drupal-10.1.3
php 8.1.2 - Status changed to Postponed: needs info
about 1 year ago 1:21pm 18 September 2023 - 🇷🇺Russia danny-dee
We've encountered the same issue on the following page: /en/admin/
This happens on all environments including production.
Drupal version we use is 9.5.10.I've attached a patch that works for us, it simply negates the issue, but does not address it's root.
ashutosh.mishra please test this patchThanks
- 🇪🇸Spain eduardo morales alberti Spain, 🇪🇺
The attributes options should be an array https://git.drupalcode.org/project/drupal/-/blob/11.x/core/lib/Drupal/Co...
* - 'attributes': An associative array of HTML attributes that will be * added to the anchor tag if you use the \Drupal\Core\Link class to make * the link.
So if the getOption returns a string, then the definition of the item is not correct.
$item['url']->getOption('attributes') ?: [];
- 🇪🇸Spain eduardo morales alberti Spain, 🇪🇺
In our case, it is because of a view menu tab.
MariaDB [drupal]> select route_name, url, menu_name, parent, provider from menu_tree where options like '%class";s:0%'; +---------------------------+-----+-----------+--------------------+-------------------+ | route_name | url | menu_name | parent | provider | +---------------------------+-----+-----------+--------------------+-------------------+ | view.reporter_news.page_1 | | admin | mysite.admin | menu_link_content | +---------------------------+-----+-----------+--------------------+-------------------+ 1 row in set (0.001 sec)
Column options unserialized:
array ( 'attributes' => array ( 'title' => '', 'id' => '', 'name' => '', 'rel' => '', 'class' => '', 'style' => '', 'target' => '', 'accesskey' => '', ), 'item_attributes' => array ( 'id' => '', 'class' => '', 'style' => '', ), 'query' => array ( ), )
We are not sure, why views are saving the class as a string instead of an array.
- 🇪🇸Spain eduardo morales alberti Spain, 🇪🇺
After some research seems like like is a custom menu item, and the attributes comes from menu_link_attributes