Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in ViewfieldFormatterTitle->viewElements() #161

Closed
p-a-s-c-a-l opened this issue Jul 8, 2020 · 6 comments
Closed

Error in ViewfieldFormatterTitle->viewElements() #161

p-a-s-c-a-l opened this issue Jul 8, 2020 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@p-a-s-c-a-l
Copy link
Member

The website encountered an unexpected error. Please try again later.
Error: Call to a member function getTitle() on null in Drupal\viewfield\Plugin\Field\FieldFormatter\ViewfieldFormatterTitle->viewElements() (line 31 of modules/contrib/viewfield/src/Plugin/Field/FieldFormatter/ViewfieldFormatterTitle.php).

https://csis.myclimateservice.eu/study/182/step/5064/view/introduction

@p-a-s-c-a-l p-a-s-c-a-l added the bug Something isn't working label Jul 8, 2020
@p-a-s-c-a-l
Copy link
Member Author

#0 /app/web/core/lib/Drupal/Core/Field/FormatterBase.php(89): Drupal\viewfield\Plugin\Field\FieldFormatter\ViewfieldFormatterTitle->viewElements(Object(Drupal\Core\Field\EntityReferenceFieldItemList), 'en')
#1 /app/web/core/lib/Drupal/Core/Entity/Entity/EntityViewDisplay.php(263): Drupal\Core\Field\FormatterBase->view(Object(Drupal\Core\Field\EntityReferenceFieldItemList), 'en')
#2 /app/web/core/modules/views/src/Entity/Render/EntityFieldRenderer.php(276): Drupal\Core\Entity\Entity\EntityViewDisplay->buildMultiple(Array)
#3 /app/web/core/modules/views/src/Entity/Render/EntityFieldRenderer.php(163): Drupal\views\Entity\Render\EntityFieldRenderer->buildFields(Array)
#4 /app/web/core/modules/views/src/Plugin/views/field/EntityField.php(846): Drupal\views\Entity\Render\EntityFieldRenderer->render(Object(Drupal\views\ResultRow), Object(Drupal\views\Plugin\views\field\EntityField))
#5 /app/web/core/modules/views/src/Plugin/views/field/FieldPluginBase.php(1148): Drupal\views\Plugin\views\field\EntityField->getItems(Object(Drupal\views\ResultRow))
#6 /app/web/core/modules/views/views.theme.inc(236): Drupal\views\Plugin\views\field\FieldPluginBase->advancedRender(Object(Drupal\views\ResultRow))
#7 /app/web/core/lib/Drupal/Core/Theme/ThemeManager.php(287): template_preprocess_views_view_field(Array, 'views_view_fiel...', Array)
#8 /app/web/core/lib/Drupal/Core/Render/Renderer.php(431): Drupal\Core\Theme\ThemeManager->render('views_view_fiel...', Array)
#9 /app/web/core/lib/Drupal/Core/Render/Renderer.php(200): Drupal\Core\Render\Renderer->doRender(Array, false)
#10 /app/web/core/modules/views/src/Plugin/views/field/FieldPluginBase.php(1747): Drupal\Core\Render\Renderer->render(Array)
#11 /app/web/core/modules/views/src/Plugin/views/style/StylePluginBase.php(770): Drupal\views\Plugin\views\field\FieldPluginBase->theme(Object(Drupal\views\ResultRow))
#12 [internal function]: Drupal\views\Plugin\views\style\StylePluginBase->elementPreRenderRow(Array)
#13 /app/web/core/lib/Drupal/Core/Security/DoTrustedCallbackTrait.php(100): call_user_func_array(Array, Array)
#14 /app/web/core/lib/Drupal/Core/Render/Renderer.php(781): Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_ren...', 'silenced_deprec...', 'Drupal\\Core\\Ren...')
#15 /app/web/core/lib/Drupal/Core/Render/Renderer.php(372): Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array)
#16 /app/web/core/lib/Drupal/Core/Render/Renderer.php(200): Drupal\Core\Render\Renderer->doRender(Array, false)
#17 /app/web/core/modules/views/src/Plugin/views/style/StylePluginBase.php(709): Drupal\Core\Render\Renderer->render(Array)
#18 /app/web/core/modules/views/src/Plugin/views/style/StylePluginBase.php(576): Drupal\views\Plugin\views\style\StylePluginBase->renderFields(Array)
#19 /app/web/core/modules/views/src/Plugin/views/style/StylePluginBase.php(468): Drupal\views\Plugin\views\style\StylePluginBase->renderGrouping(Array, Array, true)
#20 /app/web/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php(2138): Drupal\views\Plugin\views\style\StylePluginBase->render(Array)
#21 /app/web/core/modules/views/src/ViewExecutable.php(1533): Drupal\views\Plugin\views\display\DisplayPluginBase->render()
#22 /app/web/core/modules/views/src/Plugin/views/display/Block.php(138): Drupal\views\ViewExecutable->render()
#23 /app/web/core/modules/views/src/ViewExecutable.php(1630): Drupal\views\Plugin\views\display\Block->execute()
#24 /app/web/core/modules/views/src/Element/View.php(77): Drupal\views\ViewExecutable->executeDisplay('block_1', Array)
#25 /app/web/core/modules/views/src/Plugin/Block/ViewsBlock.php(59): Drupal\views\Element\View::preRenderViewElement(Array)
#26 /app/web/core/modules/block/src/BlockViewBuilder.php(171): Drupal\views\Plugin\Block\ViewsBlock->build()
#27 [internal function]: Drupal\block\BlockViewBuilder::preRender(Array)
#28 /app/web/core/lib/Drupal/Core/Security/DoTrustedCallbackTrait.php(100): call_user_func_array(Array, Array)
#29 /app/web/core/lib/Drupal/Core/Render/Renderer.php(781): Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_ren...', 'silenced_deprec...', 'Drupal\\Core\\Ren...')
#30 /app/web/core/lib/Drupal/Core/Render/Renderer.php(372): Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array)
#31 /app/web/core/lib/Drupal/Core/Render/Renderer.php(444): Drupal\Core\Render\Renderer->doRender(Array)
#32 /app/web/core/lib/Drupal/Core/Render/Renderer.php(200): Drupal\Core\Render\Renderer->doRender(Array, false)
#33 /app/web/core/lib/Drupal/Core/Template/TwigExtension.php(501): Drupal\Core\Render\Renderer->render(Array)
#34 /app/web/sites/default/files/php/twig/5f05d4153e124_page.html.twig_tqVxPI0uYUGwGCr-t6Czb7mjK/xqk1S7XStFGDr8FCsx5C-2fr6JG9hI-lkNTBHR93bF0.php(100): Drupal\Core\Template\TwigExtension->escapeFilter(Object(Drupal\Core\Template\TwigEnvironment), Array, 'html', NULL, true)
#35 /app/vendor/twig/twig/src/Template.php(455): __TwigTemplate_f15afe0a41e6ab9e58e1f303945c1825413a5aa20f960cdb080debbd014f8f1c->doDisplay(Array, Array)
#36 /app/vendor/twig/twig/src/Template.php(422): Twig\Template->displayWithErrorHandling(Array, Array)
#37 /app/vendor/twig/twig/src/Template.php(434): Twig\Template->display(Array)
#38 /app/web/core/themes/engines/twig/twig.engine(64): Twig\Template->render(Array)
#39 /app/web/core/lib/Drupal/Core/Theme/ThemeManager.php(384): twig_render_template('themes/custom/c...', Array)
#40 /app/web/core/lib/Drupal/Core/Render/Renderer.php(431): Drupal\Core\Theme\ThemeManager->render('page', Array)
#41 /app/web/core/lib/Drupal/Core/Render/Renderer.php(200): Drupal\Core\Render\Renderer->doRender(Array, false)
#42 /app/web/core/lib/Drupal/Core/Template/TwigExtension.php(501): Drupal\Core\Render\Renderer->render(Array)
#43 /app/web/sites/default/files/php/twig/5f05d4153e124_html.html.twig_q_crBVyej8CwNTVAGunx_CeRg/kdx3xecLKIcz7cDyi4IjpRnkZlhcJcZ_Q9cHLpoPvBA.php(105): Drupal\Core\Template\TwigExtension->escapeFilter(Object(Drupal\Core\Template\TwigEnvironment), Array, 'html', NULL, true)
#44 /app/vendor/twig/twig/src/Template.php(455): __TwigTemplate_88d1544f2c87c825de58747ed0b62e90f9d695557b195b56462fd470d598cc20->doDisplay(Array, Array)
#45 /app/vendor/twig/twig/src/Template.php(422): Twig\Template->displayWithErrorHandling(Array, Array)
#46 /app/vendor/twig/twig/src/Template.php(434): Twig\Template->display(Array)
#47 /app/web/core/themes/engines/twig/twig.engine(64): Twig\Template->render(Array)
#48 /app/web/core/lib/Drupal/Core/Theme/ThemeManager.php(384): twig_render_template('themes/custom/c...', Array)
#49 /app/web/core/lib/Drupal/Core/Render/Renderer.php(431): Drupal\Core\Theme\ThemeManager->render('html', Array)
#50 /app/web/core/lib/Drupal/Core/Render/Renderer.php(200): Drupal\Core\Render\Renderer->doRender(Array, false)
#51 /app/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(147): Drupal\Core\Render\Renderer->render(Array)
#52 /app/web/core/lib/Drupal/Core/Render/Renderer.php(573): Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}()
#53 /app/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(148): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#54 /app/web/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))
#55 [internal function]: Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object(Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent), 'kernel.view', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#56 /app/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func(Array, Object(Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent), 'kernel.view', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#57 /app/vendor/symfony/http-kernel/HttpKernel.php(156): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object(Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent))
#58 /app/vendor/symfony/http-kernel/HttpKernel.php(68): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#59 /app/web/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#60 /app/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#61 /app/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#62 /app/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#63 /app/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#64 /app/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#65 /app/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#66 /app/web/core/lib/Drupal/Core/DrupalKernel.php(708): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#67 /app/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#68 {main}

@p-a-s-c-a-l
Copy link
Member Author

I've edited the respective node directly, saved it and reloaded the page and now it's working. Any idea what's going on?

@fabrisj
Copy link

fabrisj commented Jul 9, 2020

@p-a-s-c-a-l
Copy link
Member Author

@fabrisj perhaps you can address @DenoBeno directly, he may not be receive a notification from GitHub. Also regarding this problem.

@patrickkaleta
Copy link
Contributor

@fgeyer16 and I found the problem and solved it for now.

Cause:
Last week's content synchronization for the GL-templates had an error: Templates without an field_view_twins field (fieldtype: Viewfield) were assigned a missing Viewfield on PROD, which caused the error. This means that all Studies created after last Monday (4 in total) can produce this error.
viewfield_migration-error

Solution for now:
On PROD I re-saved all the problematic GL-templates on PROD, so new Studies should not run into this error anymore. For the 4 existing Studies I re-saved all the problematic GL-steps and now these Studies are working again as well.

ToDo:
Before the next synchronization, I will have to adapt the respective migration file for the GL-templates adding this subprocess.

@patrickkaleta
Copy link
Contributor

Completed in #162

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants