Error: Cannot use object of type Drupal\Core\StringTranslation\TranslatableMarkup as array in Drupal\Core\Entity\EntityViewBuilder->buildMultiple() (line 303 of /.../drupal-8.7.x/www/core/lib/Drupal/Core/Entity/EntityViewBuilder.php)
#0 /.../drupal-8.7.x/www/core/lib/Drupal/Core/Entity/EntityViewBuilder.php(242): Drupal\Core\Entity\EntityViewBuilder->buildMultiple(Array) 
#1 [internal function]: Drupal\Core\Entity\EntityViewBuilder->build(Array) 
#2 /.../drupal-8.7.x/www/core/lib/Drupal/Core/Render/Renderer.php(378): call_user_func(Array, Array) 
#3 /.../drupal-8.7.x/www/core/lib/Drupal/Core/Render/Renderer.php(195): Drupal\Core\Render\Renderer->doRender(Array, false) 
#4 /.../drupal-8.7.x/www/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(226): Drupal\Core\Render\Renderer->render(Array, false) 
#5 /.../drupal-8.7.x/www/core/lib/Drupal/Core/Render/Renderer.php(582): Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() 
#6 /.../drupal-8.7.x/www/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(227): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure)) 
#7 /.../drupal-8.7.x/www/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(117): Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\CurrentRouteMatch)) 
#8 /.../drupal-8.7.x/www/core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php(90): Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\CurrentRouteMatch)) 
#9 /.../drupal-8.7.x/www/modules/contrib/devel/webprofiler/src/EventDispatcher/TraceableEventDispatcher.php(76): Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object(Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent), 'kernel.view', Object(Drupal\webprofiler\EventDispatcher\TraceableEventDispatcher)) 
#10 /.../drupal-8.7.x/www/vendor/symfony/http-kernel/HttpKernel.php(156): Drupal\webprofiler\EventDispatcher\TraceableEventDispatcher->dispatch('kernel.view', Object(Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent)) 
#11 /.../drupal-8.7.x/www/vendor/symfony/http-kernel/HttpKernel.php(68): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1) 
#12 /.../drupal-8.7.x/www/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) 
#13 /.../drupal-8.7.x/www/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) 
#14 /.../drupal-8.7.x/www/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) 
#15 /.../drupal-8.7.x/www/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true) 
#16 /.../drupal-8.7.x/www/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) 
#17 /.../drupal-8.7.x/www/modules/contrib/devel/webprofiler/src/StackMiddleware/WebprofilerMiddleware.php(38): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) 
#18 /.../drupal-8.7.x/www/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\webprofiler\StackMiddleware\WebprofilerMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) 
#19 /.../drupal-8.7.x/www/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) 
#20 /.../drupal-8.7.x/www/core/lib/Drupal/Core/DrupalKernel.php(693): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) 
#21 /.../drupal-8.7.x/www/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request)) 
#22 {main}.
CommentFileSizeAuthor
#4 task-3074813-4.png72.42 KBclemens.tolboom

Comments

clemens.tolboom created an issue. See original summary.

clemens.tolboom’s picture

Issue summary: View changes
clemens.tolboom’s picture

Title: Create user task gives exception » Create/view user task gives exception

This happens not on System tasks

clemens.tolboom’s picture

StatusFileSize
new72.42 KB

Setting a breakpoint on www/core/lib/Drupal/Core/Entity/EntityViewBuilder.php:301 we see an object (TranslatableMarkup) for use task but not for admin task

clemens.tolboom’s picture

Priority: Normal » Critical

This is critical as I cannot create view created User Tasks.

laboratory.mike’s picture

Priority: Critical » Major

Hello @clemens.tolboom,

I wanted to let you know I'm working on this now.

  • laboratory.mike committed c882720 on 8.x-2.x
    Issue #3074813 by clemens.tolboom, laboratory.mike: Create/view user...
laboratory.mike’s picture

OK, I've figured it out, and added a new alpha release with the fix.

It turns out that there were two issues. First, each task needs an @TaskBundle plugin which implements the static function getTaskOptions . This renders action links that are specific to that bundle, and user-generated tasks didn't have this set.

Second, after creating the class, I saw that I needed to add getGeneratedLink() to the part where I was rendering the links, so that they could come out as HTML. Beforehand, I was using Link::toString() only, which returns a TranslatableMarkup object.

laboratory.mike’s picture

Assigned: Unassigned » laboratory.mike
Status: Active » Fixed

OK, new release is out.

clemens.tolboom’s picture

TNX

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.