Problem/Motivation
Error: [] operator not supported for strings in claro_preprocess_admin_block_content() (line 206 of core\themes\claro\claro.theme).
call_user_func_array('claro_preprocess_admin_block_content', Array) (Line: 285)
Drupal\Core\Theme\ThemeManager->render('admin_block_content', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 477)
Steps to reproduce
I am getting error when click on admin/config link by admin user
Config :Drupal 10.0.10
PHP 8.1.12
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | drupal-array_operator_on_string_fix-3387887-6.patch | 800 bytes | danny-dee |
| #3 | admin-config_error.png | 286.34 KB | ashutosh.mishra |
Comments
Comment #2
shiv_yadavHello 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
Comment #3
ashutosh.mishra commentedComment #4
ashutosh.mishra commentedComment #5
viren18febs commentedNot able to reproduce the issue!
Comment #6
danny-dee commentedWe'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 patch
Thanks
Comment #7
eduardo morales albertiThe attributes options should be an array https://git.drupalcode.org/project/drupal/-/blob/11.x/core/lib/Drupal/Co...
So if the getOption returns a string, then the definition of the item is not correct.
Comment #8
eduardo morales albertiIn our case, it is because of a view menu tab.
Column options unserialized:
We are not sure, why views are saving the class as a string instead of an array and why all the attributes are empty.
Comment #9
eduardo morales albertiAfter some research seems like like is a custom menu item, and the attributes comes from menu_link_attributes
Comment #11
smustgrave commentedSeems like the finding was bug in the contrib module, but if still an issue in D11 (without the contrib module) please re-open!