WSOD when using icons in administrative lists
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3375853. --> Reported by: [hudri](https://www.drupal.org/user/3513676) Related to !283 !282 >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>The administrative list template <code>admin/admin-block-content.html.twig</code> was reverted to a <code>&lt;div&gt;</code> based list (like Claro). This change also included a HTML ID for aria purposes:</p> <pre>&nbsp;&nbsp;&nbsp; {% set description_id = item.title|clean_id ~ '-desc' %}<br>&nbsp;&nbsp;&nbsp; &lt;div class="admin-item__title" aria-details="{{ description_id }}"&gt;{{ item.title }}&lt;/div&gt;<br>&nbsp;&nbsp;&nbsp; &lt;div class="admin-item__description" id="{{ description_id }}"&gt;{{ item.description }}&lt;/div&gt;</pre><p>This code fails if the <code>item.title</code> is a render array, because <code>clean_id</code> expects a string as parameter. But contrib might preprocess titles into render arrays, e.g. because we want add icons to titles.</p> <p>AFAIK this problem does currently not happen with plain core, so I guess this is only minor.</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Enforce the title is already stringified before passing it to <code>|clean_id</code></p> <pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {% set description_id = item.title|render|clean_id ~ '-desc' %}</pre> > Related issue: [Issue #3373985](https://www.drupal.org/node/3373985)
issue