Closed (fixed)
Project:
Task
Version:
8.x-2.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Reporter:
Created:
14 Aug 2019 at 10:32 UTC
Updated:
16 Sep 2019 at 17:54 UTC
Jump to comment: Most recent, Most recent file
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}.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | task-3074813-4.png | 72.42 KB | clemens.tolboom |
Comments
Comment #2
clemens.tolboomComment #3
clemens.tolboomThis happens not on System tasks
Comment #4
clemens.tolboomSetting 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
Comment #5
clemens.tolboomThis is critical as I cannot
createview created User Tasks.Comment #6
laboratory.mikeHello @clemens.tolboom,
I wanted to let you know I'm working on this now.
Comment #8
laboratory.mikeOK, 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.
Comment #9
laboratory.mikeOK, new release is out.
Comment #10
clemens.tolboomTNX