Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I am trying to use Views php for calculation and savings between two prices. But this is what I get:
Is it a bug or just my site being misconfigurated?
Best
Jonas
Warning: Missing argument 1 for Drupal\views_php\Plugin\views\field\ViewsPhp::phpPostExecute(), called in /var/www/sitename.com/modules/contrib/views_php/views_php.module on line 178 and defined in Drupal\views_php\Plugin\views\field\ViewsPhp->phpPostExecute() (line 179 of modules/contrib/views_php/src/Plugin/views/field/ViewsPhp.php).
Drupal\views_php\Plugin\views\field\ViewsPhp->phpPostExecute()
views_php_views_post_execute(Object)
call_user_func_array('views_php_views_post_execute', Array)
Drupal\Core\Extension\ModuleHandler->invokeAll('views_post_execute', Array)
Drupal\views\ViewExecutable->execute(NULL)
Drupal\views\ViewExecutable->render()
Drupal\views\Plugin\views\display\Block->execute()
Drupal\views\ViewExecutable->executeDisplay('block_1', Array)
Drupal\views\Element\View::preRenderViewElement(Array)
Drupal\views\Plugin\Block\ViewsBlock->build()
Drupal\block\BlockViewBuilder::preRender(Array)
call_user_func('Drupal\block\BlockViewBuilder::preRender', Array)
Drupal\Core\Render\Renderer->doRender(Array)
Drupal\Core\Render\Renderer->doRender(Array, )
Drupal\Core\Render\Renderer->render(Array)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1)
__TwigTemplate_c820b9d387ee96fd97438b883a02c6bc2400be57e95bf80474f04229422b096f->doDisplay(Array, Array)
Twig_Template->displayWithErrorHandling(Array, Array)
Twig_Template->display(Array)
Twig_Template->render(Array)
twig_render_template('themes/custom/sitename_subsite/templates/layout/page.html.twig', Array)
Drupal\Core\Theme\ThemeManager->render('page', Array)
Drupal\Core\Render\Renderer->doRender(Array, )
Drupal\Core\Render\Renderer->render(Array)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1)
__TwigTemplate_354317d4956c5d687c0586feecbf7e29545435c97e3d52c52a0340856e325bea->doDisplay(Array, Array)
Twig_Template->displayWithErrorHandling(Array, Array)
Twig_Template->display(Array)
Twig_Template->render(Array)
twig_render_template('themes/custom/sitename_subsite/templates/layout/html.html.twig', Array)
Drupal\Core\Theme\ThemeManager->render('html', Array)
Drupal\Core\Render\Renderer->doRender(Array, )
Drupal\Core\Render\Renderer->render(Array)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}()
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1)
Drupal\page_cache\StackMiddleware\PageCache->fetch(Object, 1, 1)
Drupal\page_cache\StackMiddleware\PageCache->lookup(Object, 1, 1)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1)
Stack\StackedHttpKernel->handle(Object, 1, 1)
Drupal\Core\DrupalKernel->handle(Object)
Comment | File | Size | Author |
---|---|---|---|
#6 | miss_arg_1-2627234-6.patch | 587 bytes | ipumpkin |
Comments
Comment #2
jonasdk CreditAttribution: jonasdk as a volunteer commentedIt seems that this is just because I don't understand how to use this module.
And those articles that i have fund that talks about how to use it doesn't seems to be updated.
Any suggestions on a good example page?
What I want is just to take to fields and subtract their values to get a difference.
Comment #3
jonasdk CreditAttribution: jonasdk as a volunteer commentedComment #4
Anonymous (not verified) CreditAttribution: Anonymous at Netuxo Ltd (RIP) commentedI have the same error message
Comment #5
jonasdk CreditAttribution: jonasdk as a volunteer commentedWhat I ended doing was not to use Views PHP but follow this guide http://enzolutions.com/articles/2015/10/11/how-to-include-php-code-in-drupal-8-views/ and do things like he described. And yes I don't need many calculations just on when ever one of our prices changes.
Comment #6
ipumpkin CreditAttribution: ipumpkin at DAVYIN Internet Solutions / 戴文信息科技有限公司 commentedIt seems a bug in method Drupal\views_php\Plugin\views\field\ViewsPhp::phpPostExecute() with a unused arguments $values.
Comment #7
rooby CreditAttribution: rooby commentedLooks good to me.
Comment #8
Leagnus CreditAttribution: Leagnus commentedYep #6 is good
Comment #9
Stephen Ollman+1 #6
Comment #10
Stephen OllmanWill this patch be rolled in to the next release?
Comment #11
superlolo95 CreditAttribution: superlolo95 commented#6 Worked for me too.
Comment #12
nor sairi CreditAttribution: nor sairi as a volunteer and commentedalso work to me #6..
Comment #13
themic8 CreditAttribution: themic8 commented#6 Worked for me
Comment #14
boby_ui CreditAttribution: boby_ui commented#6 is working with the latest 8.8.5 version!