I'm getting this error now on most pages within a complex 9.5.3 site running PHP8.1:
Array to string conversion in
Drupal\Core\Template\AttributeArray->__toString() (line 77 of
core/lib/Drupal/Core/Template/AttributeArray.php)
The error trace isn't really helping nail this down. Using the suggestion at AttributeArray fails to implode #allowed_tags to investigate the problem attribute arrays, many of them are toolbar-tab related, but some are flagging up problems with Views embedded in the page, and some are just field-related, for example:
0 => string (6) "hidden"
1 => string (22) "contextual-toolbar-tab"
2 => string (11) "toolbar-tab"
3 => boolean false
and
#markup => string (6) "Argyll"
#allowed_tags => array (12)
0 => string (1) "a"
1 => string (2) "em"
2 => string (6) "strong"
3 => string (4) "cite"
4 => string (10) "blockquote"
5 => string (4) "code"
6 => string (2) "ul"
7 => string (2) "ol"
8 => string (2) "li"
9 => string (2) "dl"
10 => string (2) "dt"
11 => string (2) "dd"
and
0 => Drupal\Core\Template\AttributeString#180606 (2)
Properties (2)
protected value -> string (29) "view-field-photo-table-column"
protected name -> string (2) "id"
I think I've ruled out a theme issue (admin is Claro > Gin; front end is stable9 > Custom) and disabled lots of potential problem modules (admin_toolbar, devel etc), but not certain that it's a theme issue, or a rogue module. With the snippet in __toString()
errors are flagged up on virtually every page.
But I'm just lost as to how to nail this down, or even where to start looking.