render() of renderer service can only accept array now in Drupal 11.2.0, passing null lead to final error
1. Create a message
2. Send the message use the message_notify module
3. Or render the message in other ways to trigger the template_preprocess_message(array &$variables) hook
Don't pass null to the render() method.
if (isset($variables['elements']['created']) && is_array($variables['elements']['created'])) {
$variables['date'] = \Drupal::service('renderer')->render($variables['elements']['created']);
unset($variables['elements']['created']);
}
if (isset($variables['elements']['uid']) && is_array($variables['elements']['uid'])) {
$variables['author_name'] = \Drupal::service('renderer')->render($variables['elements']['uid']);
unset($variables['elements']['uid']);
}
none.
none.
none.
none.
Needs review
1.0
Code