Skip to content

Warning: htmlspecialchars() expects parameter 1 to be string... #175

Description

@bender-r

The error occurs after the creation of the first message. Drupal 8.2.7. php 7.0.14, Message 8.x-1.0-alpha6
`Warning: htmlspecialchars() expects parameter 1 to be string, object given in Drupal\Component\Utility\Html::escape() (line 421 of /var/www/html/core/lib/Drupal/Component/Utility/Html.php)
#0 /var/www/html/core/includes/bootstrap.inc(548): _drupal_error_handler_real(2, 'htmlspecialchar...', '/var/www/html/c...', 421, Array)
#1 [internal function]: _drupal_error_handler(2, 'htmlspecialchar...', '/var/www/html/c...', 421, Array)
#2 /var/www/html/core/lib/Drupal/Component/Utility/Html.php(421): htmlspecialchars(Object(Drupal\message\Entity\MessageTemplate), 11, 'UTF-8')
#3 /var/www/html/core/lib/Drupal/Component/Render/FormattableMarkup.php(259): Drupal\Component\Utility\Html::escape(Object(Drupal\message\Entity\MessageTemplate))
#4 /var/www/html/core/lib/Drupal/Component/Render/FormattableMarkup.php(200): Drupal\Component\Render\FormattableMarkup::placeholderEscape(Object(Drupal\message\Entity\MessageTemplate)) #5 /var/www/html/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php(204): Drupal\Component\Render\FormattableMarkup::placeholderFormat('@type: added %t...', Array)
#6 /var/www/html/core/lib/Drupal/Component/Utility/ToStringTrait.php(15): Drupal\Core\StringTranslation\TranslatableMarkup->render()
#7 [internal function]: Drupal\Core\StringTranslation\TranslatableMarkup->__toString() #8 /var/www/html/core/modules/dblog/src/Controller/DbLogController.php(180): strip_tags(Object(Drupal\Core\StringTranslation\TranslatableMarkup))
#9 [internal function]: Drupal\dblog\Controller\DbLogController->overview()
#10 /var/www/html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#11 /var/www/html/core/lib/Drupal/Core/Render/Renderer.php(574): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber{closure}()
#12 /var/www/html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#13 /var/www/html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#14 [internal function]: Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber{closure}()
#15 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(144): call_user_func_array(Object(Closure), Array) #16 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(64): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#17 /var/www/html/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#18 /var/www/html/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#19 /var/www/html/core/modules/page_cache/src/StackMiddleware/PageCache.php(99): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#20 /var/www/html/core/modules/page_cache/src/StackMiddleware/PageCache.php(78): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#21 /var/www/html/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#22 /var/www/html/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(50): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#23 /var/www/html/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#24 /var/www/html/core/lib/Drupal/Core/DrupalKernel.php(652): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#25 /var/www/html/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#26 {main}.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions