If token modul is installed following message appears on forum pages (but not the starting page of forum):

Notice: Array to string conversion in Drupal\Component\Render\HtmlEscapedText->__construct() (line 37 of core/lib/Drupal/Component/Render/HtmlEscapedText.php).

Also reported as token issue:

https://www.drupal.org/node/2675738

Maybe the problem has its source in forum modul ...

Comments

MartinMa created an issue. See original summary.

platinum1’s picture

We have the same issue or a variation thereof:

Notice: Array to string conversion in Drupal\Component\Render\HtmlEscapedText->__construct() (line 37 of core/lib/Drupal/Component/Render/HtmlEscapedText.php).

Drupal\Component\Render\HtmlEscapedText->__construct(Array) (Line: 209)
Drupal\Core\Utility\Token->replace('[current-page:title] | [site:name]', Array, Array) (Line: 45)
Drupal\metatag\MetatagToken->replace('[current-page:title] | [site:name]', Array, Array) (Line: 305)
Drupal\metatag\MetatagManager->generateElements(Array, NULL) (Line: 217)
metatag_get_tags_from_route() (Line: 67)
metatag_page_attachments(Array) (Line: 302)
Drupal\Core\Render\MainContent\HtmlRenderer->invokePageAttachmentHooks(Array) (Line: 278)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 122)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 95)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object) (Line: 116)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object) (Line: 144)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 62)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 62)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 53)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 103)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 82)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 55)
Drupal\ban\BanMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 55)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 631)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

The error appears when an Anonymous User or an Authenticated User accesses forum posts. The error does not appear when the Admin accesses the same forum posts.
The Drupal version is 8.1.x-dev

googletorp’s picture

Priority: Normal » Minor

A conditional notice should be a minor bug.

platinum1’s picture

The condition being the type of user I assume.

platinum1’s picture

Or the installation of the token module?

fomenkoandrey’s picture

i have the same error

platinum1’s picture

@fomenkoandrey I believe you have the token module installed. If you uninstall it, the error should disappear.

fomenkoandrey’s picture

the token module must be installed for other modules (MetatagMetatag: Open GraphMetatag: Twitter Cards (отключён)...), so i cannot delete it.

platinum1’s picture

I know, I have the same problem. I first uninstalled Metatag and Pathauto, then Token, to perform the test. Therefore I am quite certain that the problem is Token.

fomenkoandrey’s picture

and there is no solution? author of the token extansion it does not seem to worry too much about the emerging bugs.

platinum1’s picture

I am sure the maintainers of the Token Module will solve this problem soon.

Is your site in production? If so, I would recommend choosing between the lesser of two evils:

1) Uninstall Pathauto, Metatag and Token, which will result in an SEO problem for a few days until Token is fixed. The benefit is that the Forum is not broken.

2) Keep the modules active and hide the Forum until Token is fixed.

If the site is still in development, simply focus on other parts of the site for a few days until Token is updated.

fomenkoandrey’s picture

>>> I am sure the maintainers of the Token Module will solve this problem soon.
I did not have this error before.
i have Drupal 8.0.5 worked long time without errors, the token module has not been updated for a long time (still alfa2) and there were no mistakes, too.
yesterday i updated metatag from beta 5 to beta 7 - an error has occurred.

so... problem not with the TOKEN module.
i try next: uninstal "Metatag: Open Graph" (for some reason, the module Metatag can not be deleted, although there is no module, using Metatags).
and the error disappeared.

platinum1’s picture

I have done more testing and you are right.
When I enable the Token module, the Forum still works correctly. When I enabled Metatag in addition, we are back to the original problem.

kenorb’s picture