Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cast to string when passing to MailFormatHelper::htmlToText() #5218

Merged
merged 3 commits into from
Sep 5, 2022

Conversation

claudiu-cristea
Copy link
Member

@claudiu-cristea claudiu-cristea commented Sep 3, 2022

When running drush core:requirements on PHP 8.1 I'm getting:

[error]  Message: /Deprecated function/: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in Drupal\Component\Utility\Html::escape() (line 424 of /core/lib/Drupal/Component/Utility/Html.php/).
Drupal\Component\Utility\Html::escape(NULL) (Line: 262)
Drupal\Component\Render\FormattableMarkup::placeholderEscape(NULL) (Line: 232)
Drupal\Component\Render\FormattableMarkup::placeholderFormat('%profile_name (%profile-%version)', Array) (Line: 195)
Drupal\Core\StringTranslation\TranslatableMarkup->render() (Line: 15)
Drupal\Core\StringTranslation\TranslatableMarkup->__toString()
str_replace('', '', Object) (Line: 69)
Drupal\Component\Utility\Xss::filter(Object, Array) (Line: 117)
Drupal\Core\Mail\MailFormatHelper::htmlToText(Object) (Line: 23)
Drush\Drupal\DrupalUtil::drushRender(Object) (Line: 125)
Drush\Drupal\Commands\core\DrupalCommands->requirements(Array)
...

The issue is that we're passing TranslatableMarkup instances.

Verified

This commit was signed with the committer’s verified signature.
aykevl Ayke

Verified

This commit was signed with the committer’s verified signature.
aykevl Ayke
@claudiu-cristea claudiu-cristea force-pushed the php8.1-warnings-htmlToText branch from 1669037 to 1e25b65 Compare September 4, 2022 13:04

Verified

This commit was signed with the committer’s verified signature.
aykevl Ayke
@weitzman weitzman merged commit 8e4b72a into 11.x Sep 5, 2022
@weitzman weitzman deleted the php8.1-warnings-htmlToText branch September 5, 2022 05:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants