Hi,

I am testing project Drupal Remote Dashboard 8.x-3.0 with Views Merge Rows 8.x-2.1 as dependent module. Some views are not generated with an error in the logs:

Error: Call to protected method Drupal\views\Plugin\views\style\StylePluginBase::renderFields() from context '' in views_merge_rows_views_pre_render() (regel 43 van /home/cmseasy/domains/drd.cmseasy.nl/public_html/drupal/sites/drd.cmseasy.nl/modules/views_merge_rows/views_merge_rows.module) #0 [internal function]: views_merge_rows_views_pre_render(Object(Drupal\views\ViewExecutable)) #1 /home/drupal/8/drupal-8/core/lib/Drupal/Core/Extension/ModuleHandler.php(402): call_user_func_array('views_merge_row...', Array) #2 /home/drupal/8/drupal-8/core/modules/views/src/ViewExecutable.php(1509): Drupal\Core\Extension\ModuleHandler->invokeAll('views_pre_rende...', Array) #3 /home/drupal/8/drupal-8/core/modules/views/src/Plugin/views/display/Page.php(171): Drupal\views\ViewExecutable->render() #4 /home/drupal/8/drupal-8/core/modules/views/src/ViewExecutable.php(1616): Drupal\views\Plugin\views\display\Page->execute() #5 /home/drupal/8/drupal-8/core/modules/views/src/Element/View.php(78): Drupal\views\ViewExecutable->executeDisplay('page_1', Array) #6 [internal function]: Drupal\views\Element\View::preRenderViewElement(Array) #7 /home/drupal/8/drupal-8/core/lib/Drupal/Core/Render/Renderer.php(376): call_user_func(Array, Array) #8 /home/drupal/8/drupal-8/core/lib/Drupal/Core/Render/Renderer.php(195): Drupal\Core\Render\Renderer->doRender(Array, false) #9 /home/drupal/8/drupal-8/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(226): Drupal\Core\Render\Renderer->render(Array, false) #10 /home/drupal/8/drupal-8/core/lib/Drupal/Core/Render/Renderer.php(574): Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() #11 /home/drupal/8/drupal-8/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(227): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure)) #12 /home/drupal/8/drupal-8/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)) #13 /home/drupal/8/drupal-8/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)) #14 /home/drupal/8/drupal-8/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object(Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent), 'kernel.view', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher)) #15 /home/drupal/8/drupal-8/vendor/symfony/http-kernel/HttpKernel.php(149): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object(Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent)) #16 /home/drupal/8/drupal-8/vendor/symfony/http-kernel/HttpKernel.php(64): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1) #17 /home/drupal/8/drupal-8/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #18 /home/drupal/8/drupal-8/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #19 /home/drupal/8/drupal-8/core/modules/page_cache/src/StackMiddleware/PageCache.php(99): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #20 /home/drupal/8/drupal-8/core/modules/page_cache/src/StackMiddleware/PageCache.php(78): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true) #21 /home/drupal/8/drupal-8/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #22 /home/drupal/8/drupal-8/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(50): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #23 /home/drupal/8/drupal-8/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #24 /home/drupal/8/drupal-8/core/lib/Drupal/Core/DrupalKernel.php(656): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #25 /home/drupal/8/drupal-8/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #26 {main}.

I think it is view merge role related.
Environment: server apache 2.4, php 7.1.2 and Drupal 8.3.0

Comments

Anonymous’s picture

cmseasy created an issue. See original summary.

dgagne’s picture

Please make sure you applied patches mentioned in the module description. It should solve your problem.

I apologize, the issue is not solved yet at drupal's core level.

Anonymous’s picture

the issue is not solved yet at drupal's core level.

That's disapointing,

Thanks for your fast reaction.

sharique’s picture

I applied the said patch, now I'm getting error

Error: Call to undefined method Drupal\views\Plugin\views\style\Table::getRenderedFields() in views_merge_rows_views_pre_render() (line 44 of /home/drupal/public_html/drupal-8/modules/contrib/views_merge_rows/views_merge_rows.module) #0 [internal function]: views_merge_rows_views_pre_render(Object(Drupal\views\ViewExecutable)) #1 /home/drupal/public_html/drupal-8/core/lib/Drupal/Core/Extension/ModuleHandler.php(402): call_user_func_array('views_merge_row...', Array) #2 /home/drupal/public_html/drupal-8/core/modules/views/src/ViewExecutable.php(1509): Drupal\Core\Extension\ModuleHandler->invokeAll('views_pre_rende...', Array) #3 /home/drupal/public_html/drupal-8/modules/contrib/eva/src/Plugin/views/display/Eva.php(292): Drupal\views\ViewExecutable->render() #4 /home/drupal/public_html/drupal-8/core/modules/views/src/ViewExecutable.php(1616): Drupal\eva\Plugin\views\display\Eva->execute() #5 /home/drupal/public_html/drupal-8/core/modules/views/src/Element/View.php(78): Drupal\views\ViewExecutable->executeDisplay('entity_view_2', Array) #6 [internal function]: Drupal\views\Element\View::preRenderViewElement(Array) #7 /home/drupal/public_html/drupal-8/core/lib/Drupal/Core/Render/Renderer.php(376): call_user_func(Array, Array) #8 /home/drupal/public_html/drupal-8/core/lib/Drupal/Core/Render/Renderer.php(448): Drupal\Core\Render\Renderer->doRender(Array) #9 /home/drupal/public_html/drupal-8/core/lib/Drupal/Core/Render/Renderer.php(448): Drupal\Core\Render\Renderer->doRender(Array) #10 /home/drupal/public_html/drupal-8/core/lib/Drupal/Core/Render/Renderer.php(195): Drupal\Core\Render\Renderer->doRender(Array, false) #11 /home/drupal/public_html/drupal-8/core/lib/Drupal/Core/Template/TwigExtension.php(490): Drupal\Core\Render\Renderer->render(Array) #12 /home/drupal/public_html/drupal-8/vendor/twig/twig/lib/Twig/Environment.php(404) : eval()'d code(50): Drupal\Core\Template\TwigExtension->escapeFilter(Object(Drupal\Core\Template\TwigEnvironment), Array, 'html', NULL, true) #13 /home/drupal/public_html/drupal-8/vendor/twig/twig/lib/Twig/Template.php(379): __TwigTemplate_19db1f2dc8324b193565f17c7d6063b4ecb932b9c9bcb81a1284d24b5d5bac18->doDisplay(Array, Array) #14 /home/drupal/public_html/drupal-8/vendor/twig/twig/lib/Twig/Template.php(347): Twig_Template->displayWithErrorHandling(Array, Array) #15 /home/drupal/public_html/drupal-8/vendor/twig/twig/lib/Twig/Template.php(358): Twig_Template->display(Array) #16 /home/drupal/public_html/drupal-8/core/themes/engines/twig/twig.engine(64): Twig_Template->render(Array) #17 /home/drupal/public_html/drupal-8/core/lib/Drupal/Core/Theme/ThemeManager.php(384): twig_render_template('modules/contrib...', Array) #18 /home/drupal/public_html/drupal-8/core/lib/Drupal/Core/Render/Renderer.php(435): Drupal\Core\Theme\ThemeManager->render('drd_core', Array) #19 /home/drupal/public_html/drupal-8/core/lib/Drupal/Core/Render/Renderer.php(195): Drupal\Core\Render\Renderer->doRender(Array, false) #20 /home/drupal/public_html/drupal-8/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(226): Drupal\Core\Render\Renderer->render(Array, false) #21 /home/drupal/public_html/drupal-8/core/lib/Drupal/Core/Render/Renderer.php(574): Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() #22 /home/drupal/public_html/drupal-8/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(227): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure)) #23 /home/drupal/public_html/drupal-8/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)) #24 /home/drupal/public_html/drupal-8/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)) #25 /home/drupal/public_html/drupal-8/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object(Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent), 'kernel.view', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher)) #26 /home/drupal/public_html/drupal-8/vendor/symfony/http-kernel/HttpKernel.php(149): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object(Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent)) #27 /home/drupal/public_html/drupal-8/vendor/symfony/http-kernel/HttpKernel.php(64): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1) #28 /home/drupal/public_html/drupal-8/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #29 /home/drupal/public_html/drupal-8/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #30 /home/drupal/public_html/drupal-8/core/modules/page_cache/src/StackMiddleware/PageCache.php(99): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #31 /home/drupal/public_html/drupal-8/core/modules/page_cache/src/StackMiddleware/PageCache.php(78): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true) #32 /home/drupal/public_html/drupal-8/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #33 /home/drupal/public_html/drupal-8/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(50): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #34 /home/drupal/public_html/drupal-8/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #35 /home/drupal/public_html/drupal-8/core/lib/Drupal/Core/DrupalKernel.php(656): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #36 /home/drupal/public_html/drupal-8/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #37 {main}.

I checked and found out that method getRenderedFields does not existing neither in StylePluginBase nor in Table style plugin.

dgagne’s picture

Seems to be the same problem as previous one. Unfortunately, you need to patch drupal core to make the module work. Please follow links provided in module's page under drupal 8 section.

flutterstack’s picture

Even after applying the patches https://www.drupal.org/node/2829046, https://www.drupal.org/node/2824920, https://www.drupal.org/node/2826755.

Error: Call to protected method Drupal\views\Plugin\views\style\StylePluginBase::renderFields() from context '' in views_merge_rows_views_pre_render() (line 43 of /var/www/drupalvm/drupal8-research/web/modules/contrib/views_merge_rows/views_merge_rows.module) #

gcb’s picture

That can happen if you patch core AFTER installing views_merge_rows. Uninstall/reinstall views_merge_rows and you should be all set.

colan’s picture

Status: Active » Postponed

I don't recommend hacking core as suggested above when those issues were marked Won't Fix. We're now blocked on #2824920: Make StylePluginBase::renderFields public which is the core issue that is the root of this problem. Unless there's a better way to do this, we need to focus our energies there.

colan’s picture

Title: Error: Call to protected method » Call to protected method StylePluginBase::renderFields() in views_merge_rows_views_pre_render()
wizardfish’s picture

Error: Call to protected method Drupal\views\Plugin\views\style\StylePluginBase::renderFields() from context '' in views_merge_rows_views_pre_render() (line 43 of modules/contrib/views_merge_rows/views_merge_rows.module).

Running into the same thing here, and don't think I'm willing to try those core patches.

Still no proper fix?

N1ghteyes’s picture

Just thought i'd comment here since this issue is still unresolved.

I pretty much have a fix in place, without hacking core but it thows up a number of other issues.

1) The module also requires the getRenderedFields() and setRenderedField() methods which don't actually exist.
2) Grouping appears to be broken (once i can confirm i'll open another issue for that)
3) The fix will --not-- work for styles created by other modules. They would need to invoke a hook, i have no idea if that would be an acceptable work around but once finalised i intend to commit the fix back for review.

samaphp’s picture

Thanks guys for the hard work. I'm facing the same issue described in this issue exactly.
Drupal Version: 8.7.3

I don't think I'm willing to try those core patches since it seems risky to me.
I'm wondering if we can try to find a temporary workaround for this issue inside this module? to make sure when the core issue fixed we can remove this workaround as an update for this useful module. Thanks again.

N1ghteyes’s picture

@sama - I have a mostly rewritten version of this module now since, after fixing the issue above, a whole load more problems came up. Only unique merge is working though, and only by nid currently.

What's your specific use case? I can zip it and we transfer it or something? Not much point pushing a patch up as its basically a new module and only one part of it works at that.

matt b’s picture

Confirmed, I'm getting the same issue on 8.7.3. The module description implies this is fixed from 8.4.0 - this needs updating.

dangreenman’s picture

Confirmed, I'm getting the same issue on 8.8.1.

matt b’s picture

Doesn't look like #2824920: Make StylePluginBase::renderFields public is going to get fixed anytime soon either - no update for 3 years.

siddiq’s picture

The above patches were failed for me. Then, I manually updated the lines in my files and have created the following patch file for the views_merge_rows version 8.x-2.1.

studio-days’s picture

Same issue on 8.8.5

shiva369’s picture

Is there a fix for this issue. if so please let me know.

Thanks
shiva

jasonluttrell’s picture

@N1ghteyes - are you willing to share your version? It looks as though this one is unusable and moot at the present time.

N1ghteyes’s picture

@jasonluttrell - I'll see if I can dig it out, its no more improved than this time last year, so it only works on unique merge by NID but if that works for you then you're welcome to it.

I've not tested it for a while, so usual caveat that it probably has issues. Do you want to PM me an email address?

jasonluttrell’s picture

@N1ghteyes sure, but no rush! I was trying to do something on my end but to no avail. I thought if I saw what someone else did I may have better luck. Thanks.

grimreaper’s picture

Version: 8.x-2.1 » 8.x-2.x-dev
radheymkumar’s picture

heavystonehead’s picture

Same issue v2.3 patch not working

Error: Call to protected method Drupal\views\Plugin\views\style\StylePluginBase::renderFields() from scope Drupal\views_merge_rows\HookHandler\ViewsPreRenderHookHandler in Drupal\views_merge_rows\HookHandler\ViewsPreRenderHookHandler->process() (Zeile 84 in /var/www/vhosts/dev/modules/contrib/views_merge_rows/src/HookHandler/ViewsPreRenderHookHandler.php) 
toby-fz’s picture

I just used the patch from #24 and this worked for me. I'm on core 9.5.11.

rajivgandhi chinnakrishnan’s picture

The above patch (#24) is not working with Drupal 10.3.x. Here is the patch for the Drupal 10.3.x version.

tyler.hastain’s picture

Just for tracking purposes, I tried to apply the patch from 27, and it did not apply in composer. Running Drupal 10.3.10, PHP 8.3.6, nginx/1.24.0, and MySQL 8.0.40-0ubuntu0.24.04.1.

dydave’s picture

Re-rolled patch from #27 for D11.2.

ruslan piskarov’s picture

Re-rolled patch from #29 for D11.3.3+.