- Issue created by @mikepadiernos
- Status changed to Needs review
3 months ago 1:18am 17 July 2025 - π§π·Brazil luco
hello!
thank you for reporting this issue.
I tested this patch π TypeError: htmlspecialchars(): Argument #1 ($string) must be of type string, array given in htmlspecialchars() (line 432 of core\lib\Drupal\Component\Utility\Html.php) Active against D11 and it worked. in my case it was due to sample content created with Devel Generate.
you can include it in your composer.json under "extra" like so:
"patches": { "drupal/core": { "Add Exception for TypeError Argument must be String in \\Drupal\\Component\\Utility\\Html escape{}": "https://www.drupal.org/files/issues/2025-07-05/TypeError_htmlspecialchars_ArgumentNustBeTypeString_ArrayGiven-3352384-76.patch" } }
if you're on D10 or 9 kindly check earlier comments.
let me know if that solves your problem so we can close this, ok?
- π§π·Brazil luco
hi there,
quick update: I double-checked my code and it was indeed a little buggy. π¬
the latest change to the 4.0.x-dev branch β should fix it for you.
please test and let me know how it goes, ok?
thanks again!