htmlspecialchars() expects parameter 1 to be string caused by ScheduledUpdateAddController

Created on 10 December 2021, over 2 years ago
Updated 11 November 2023, 8 months ago

I get this warning on /admin/content/scheduled-update/add while running core 9.2.10.

Warning: htmlspecialchars() expects parameter 1 to be string, object given in Drupal\Component\Utility\Html::escape() (line 427 of core/lib/Drupal/Component/Utility/Html.php).

Which is caused by this code in ScheduledUpdateAddController

            '@link' => Link::fromTextAndUrl($this->t('Go to the type creation page'), Url::fromRoute('entity.scheduled_update_type.add_form')),

Here's a proposed change:

        $link = Link::fromTextAndUrl($this->t('Go to the type creation page'), Url::fromRoute('entity.scheduled_update_type.add_form'))->toRenderable();
        return array(
          '#markup' => $this->t('You have not created any %bundle types yet. @link to add a new type.', [
            '%bundle' => 'Scheduled update',
            '@link' => render($link),
          ]),
        );

Patch coming.

πŸ› Bug report
Status

RTBC

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States bburg Washington D.C.

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024