Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Installing module on D8.3.3 I got following message:
Warning: htmlspecialchars() expects parameter 1 to be string, object given in Drupal\Component\Utility\Html::escape() (line 423 of core/lib/Drupal/Component/Utility/Html.php).
Just installed honeypot months ago on other site, and got no message like this.
At first look I cant see any other problem
Comment | File | Size | Author |
---|---|---|---|
#8 | honeypot-correct-install-message.png | 78.71 KB | geerlingguy |
#6 | honeypot-display-install-message-bug.png | 87.05 KB | geerlingguy |
#4 | honeypot-broken_configure_link-2885016-4-d8.patch | 724 bytes | eelkeblok |
|
Comments
Comment #2
rhormens CreditAttribution: rhormens at CI&T commentedComment #3
eelkeblokJust to save somebody a few minutes of debugging, the problem is the Link object being passed into t() from the hook_install implementation.
Comment #4
eelkeblokI took the liberty of baking a patch. Sorry if I duplicated some of your work, rhormens.
Just as some extra explanation about the patch, it not only changes the type of object passed into t(), but also changes the structure of the translated string. It is generally considerded better to keep linked text in context and only insert the linked url with a placeholder. This makes the translator's job a lot easier.
Comment #5
geerlingguy CreditAttribution: geerlingguy at Midwestern Mac, LLC commentedLooks good. I'll merge soon and put out a new release. Thanks!
Comment #6
geerlingguy CreditAttribution: geerlingguy at Midwestern Mac, LLC commentedNot only that, the install message looks pretty dumb the way it's currently displaying:
Comment #8
geerlingguy CreditAttribution: geerlingguy at Midwestern Mac, LLC commentedFixed via patch, thanks for everyone's help! The install message looks correct again:
Comment #9
rhormens CreditAttribution: rhormens at CI&T commentedComment #10
geerlingguy CreditAttribution: geerlingguy at Midwestern Mac, LLC commentedUpdating title for posterity.