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 after update to version 2 #249

Open
tsens opened this issue May 22, 2018 · 9 comments
Open

Error after update to version 2 #249

tsens opened this issue May 22, 2018 · 9 comments

Comments

@tsens
Copy link

tsens commented May 22, 2018

This error occurred when I upgraded to version 2

image

image

@stof
Copy link
Contributor

stof commented May 22, 2018

can you give the stack trace of the exception (the dedicated tab in the exception page allows to get them in text format, suitable for copy/pasting) ?

@tsens
Copy link
Author

tsens commented May 22, 2018

Twig_Error_Runtime:
An exception has been thrown during the rendering of a template ("The option "prev_message" does not exist.").

at templates/grid_top.html.twig:45
at Twig_Template->displayWithErrorHandling(array('list' => object(Pagerfanta), 'limit' => 10, 'order' => '', 'filters' => array(), 'routeName' => 'alerts', 'app' => object(AppVariable)), array())
(vendor/twig/twig/lib/Twig/Template.php:367)
at Twig_Template->display(array('list' => object(Pagerfanta), 'limit' => 10, 'order' => '', 'filters' => array(), 'routeName' => 'alerts', 'app' => object(AppVariable)))
(vendor/twig/twig/lib/Twig/Template.php:375)
at Twig_Template->render(array('list' => object(Pagerfanta), 'limit' => 10, 'order' => '', 'filters' => array(), 'routeName' => 'alerts', 'app' => object(AppVariable)))
(vendor/twig/twig/lib/Twig/Extension/Core.php:1312)
at twig_include(object(Twig_Environment), array('list' => object(Pagerfanta), 'limit' => 10, 'order' => '', 'filters' => array(), 'routeName' => 'alerts', 'app' => object(AppVariable)), 'grid_top.html.twig')
(var/cache/dev/twig/f8/f882e2a32c9d4d1fb92d842358e80317f453a374183d5e48851f2c8c93cb79c8.php:51)
at __TwigTemplate_ab13de6fa31e1bfb832877c5ccce36a71c1903b61416894a1523cd7008ba04c8->block_grid(array('list' => object(Pagerfanta), 'limit' => 10, 'order' => '', 'filters' => array(), 'routeName' => 'alerts', 'app' => object(AppVariable)), array('grid' => array(object(__TwigTemplate_ab13de6fa31e1bfb832877c5ccce36a71c1903b61416894a1523cd7008ba04c8), 'block_grid')))
(vendor/twig/twig/lib/Twig/Template.php:189)
at Twig_Template->displayBlock('grid', array('list' => object(Pagerfanta), 'limit' => 10, 'order' => '', 'filters' => array(), 'routeName' => 'alerts', 'app' => object(AppVariable)), array('grid' => array(object(__TwigTemplate_ab13de6fa31e1bfb832877c5ccce36a71c1903b61416894a1523cd7008ba04c8), 'block_grid')))
(var/cache/dev/twig/f8/f882e2a32c9d4d1fb92d842358e80317f453a374183d5e48851f2c8c93cb79c8.php:30)
at __TwigTemplate_ab13de6fa31e1bfb832877c5ccce36a71c1903b61416894a1523cd7008ba04c8->doDisplay(array('list' => object(Pagerfanta), 'limit' => 10, 'order' => '', 'filters' => array(), 'routeName' => 'alerts', 'app' => object(AppVariable)), array('grid' => array(object(__TwigTemplate_ab13de6fa31e1bfb832877c5ccce36a71c1903b61416894a1523cd7008ba04c8), 'block_grid')))
(vendor/twig/twig/lib/Twig/Template.php:390)
at Twig_Template->displayWithErrorHandling(array('list' => object(Pagerfanta), 'limit' => 10, 'order' => '', 'filters' => array(), 'routeName' => 'alerts', 'app' => object(AppVariable)), array('grid' => array(object(__TwigTemplate_ab13de6fa31e1bfb832877c5ccce36a71c1903b61416894a1523cd7008ba04c8), 'block_grid')))
(vendor/twig/twig/lib/Twig/Template.php:367)
at Twig_Template->display(array('list' => object(Pagerfanta), 'limit' => 10, 'order' => '', 'filters' => array(), 'routeName' => 'alerts'))
(vendor/twig/twig/lib/Twig/Template.php:375)
at Twig_Template->render(array('list' => object(Pagerfanta), 'limit' => 10, 'order' => '', 'filters' => array(), 'routeName' => 'alerts'))
(vendor/twig/twig/lib/Twig/Environment.php:289)
at Twig_Environment->render('alerts/grid.html.twig', array('list' => object(Pagerfanta), 'limit' => 10, 'order' => '', 'filters' => array(), 'routeName' => 'alerts'))
(vendor/symfony/framework-bundle/Controller/ControllerTrait.php:225)
at Symfony\Bundle\FrameworkBundle\Controller\Controller->render('alerts/grid.html.twig', array('list' => object(Pagerfanta), 'limit' => 10, 'order' => '', 'filters' => array(), 'routeName' => 'alerts'))
(src/Controller/Alerts/AlertsController.php:56)
at App\Controller\Alerts\AlertsController->grid(1, 0, '', '', object(AlertRepository))
(vendor/symfony/http-kernel/HttpKernel.php:149)
at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
(vendor/symfony/http-kernel/HttpKernel.php:66)
at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
(vendor/symfony/http-kernel/Kernel.php:190)
at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
(public/index.php:37)

@tsens
Copy link
Author

tsens commented May 22, 2018

InvalidArgumentException:
The option "prev_message" does not exist.

at vendor/pagerfanta/pagerfanta/src/Pagerfanta/View/Template/Template.php:61
at Pagerfanta\View\Template\Template->option('prev_message')
(vendor/pagerfanta/pagerfanta/src/Pagerfanta/View/Template/DefaultTemplate.php:57)
at Pagerfanta\View\Template\DefaultTemplate->previousDisabled()
(vendor/pagerfanta/pagerfanta/src/Pagerfanta/View/DefaultView.php:154)
at Pagerfanta\View\DefaultView->previous()
(vendor/pagerfanta/pagerfanta/src/Pagerfanta/View/DefaultView.php:99)
at Pagerfanta\View\DefaultView->generatePages()
(vendor/pagerfanta/pagerfanta/src/Pagerfanta/View/DefaultView.php:85)
at Pagerfanta\View\DefaultView->generate()
(vendor/pagerfanta/pagerfanta/src/Pagerfanta/View/DefaultView.php:54)
at Pagerfanta\View\DefaultView->render(object(Pagerfanta), object(Closure), array('routeName' => 'alerts_paginated'))
(vendor/white-october/pagerfanta-bundle/Twig/PagerfantaExtension.php:73)
at WhiteOctober\PagerfantaBundle\Twig\PagerfantaExtension->renderPagerfanta(object(Pagerfanta), 'pagination_template', array('routeName' => 'alerts_paginated'))
(var/cache/dev/twig/d5/d595ca5bf19bfec2f0658fe8285e0bfbe7a301c5e74de73fe303111b4fe5be06.php:127)
at __TwigTemplate_c577a03b277ec6122fd5714f92dfb9a574f0c1faf3fee6016c802bc8d0aac3b7->doDisplay(array('list' => object(Pagerfanta), 'limit' => 10, 'order' => '', 'filters' => array(), 'routeName' => 'alerts', 'app' => object(AppVariable)), array())
(vendor/twig/twig/lib/Twig/Template.php:390)
at Twig_Template->displayWithErrorHandling(array('list' => object(Pagerfanta), 'limit' => 10, 'order' => '', 'filters' => array(), 'routeName' => 'alerts', 'app' => object(AppVariable)), array())
(vendor/twig/twig/lib/Twig/Template.php:367)
at Twig_Template->display(array('list' => object(Pagerfanta), 'limit' => 10, 'order' => '', 'filters' => array(), 'routeName' => 'alerts', 'app' => object(AppVariable)))
(vendor/twig/twig/lib/Twig/Template.php:375)
at Twig_Template->render(array('list' => object(Pagerfanta), 'limit' => 10, 'order' => '', 'filters' => array(), 'routeName' => 'alerts', 'app' => object(AppVariable)))
(vendor/twig/twig/lib/Twig/Extension/Core.php:1312)
at twig_include(object(Twig_Environment), array('list' => object(Pagerfanta), 'limit' => 10, 'order' => '', 'filters' => array(), 'routeName' => 'alerts', 'app' => object(AppVariable)), 'grid_top.html.twig')
(var/cache/dev/twig/f8/f882e2a32c9d4d1fb92d842358e80317f453a374183d5e48851f2c8c93cb79c8.php:51)
at __TwigTemplate_ab13de6fa31e1bfb832877c5ccce36a71c1903b61416894a1523cd7008ba04c8->block_grid(array('list' => object(Pagerfanta), 'limit' => 10, 'order' => '', 'filters' => array(), 'routeName' => 'alerts', 'app' => object(AppVariable)), array('grid' => array(object(__TwigTemplate_ab13de6fa31e1bfb832877c5ccce36a71c1903b61416894a1523cd7008ba04c8), 'block_grid')))
(vendor/twig/twig/lib/Twig/Template.php:189)
at Twig_Template->displayBlock('grid', array('list' => object(Pagerfanta), 'limit' => 10, 'order' => '', 'filters' => array(), 'routeName' => 'alerts', 'app' => object(AppVariable)), array('grid' => array(object(__TwigTemplate_ab13de6fa31e1bfb832877c5ccce36a71c1903b61416894a1523cd7008ba04c8), 'block_grid')))
(var/cache/dev/twig/f8/f882e2a32c9d4d1fb92d842358e80317f453a374183d5e48851f2c8c93cb79c8.php:30)
at __TwigTemplate_ab13de6fa31e1bfb832877c5ccce36a71c1903b61416894a1523cd7008ba04c8->doDisplay(array('list' => object(Pagerfanta), 'limit' => 10, 'order' => '', 'filters' => array(), 'routeName' => 'alerts', 'app' => object(AppVariable)), array('grid' => array(object(__TwigTemplate_ab13de6fa31e1bfb832877c5ccce36a71c1903b61416894a1523cd7008ba04c8), 'block_grid')))
(vendor/twig/twig/lib/Twig/Template.php:390)
at Twig_Template->displayWithErrorHandling(array('list' => object(Pagerfanta), 'limit' => 10, 'order' => '', 'filters' => array(), 'routeName' => 'alerts', 'app' => object(AppVariable)), array('grid' => array(object(__TwigTemplate_ab13de6fa31e1bfb832877c5ccce36a71c1903b61416894a1523cd7008ba04c8), 'block_grid')))
(vendor/twig/twig/lib/Twig/Template.php:367)
at Twig_Template->display(array('list' => object(Pagerfanta), 'limit' => 10, 'order' => '', 'filters' => array(), 'routeName' => 'alerts'))
(vendor/twig/twig/lib/Twig/Template.php:375)
at Twig_Template->render(array('list' => object(Pagerfanta), 'limit' => 10, 'order' => '', 'filters' => array(), 'routeName' => 'alerts'))
(vendor/twig/twig/lib/Twig/Environment.php:289)
at Twig_Environment->render('alerts/grid.html.twig', array('list' => object(Pagerfanta), 'limit' => 10, 'order' => '', 'filters' => array(), 'routeName' => 'alerts'))
(vendor/symfony/framework-bundle/Controller/ControllerTrait.php:225)
at Symfony\Bundle\FrameworkBundle\Controller\Controller->render('alerts/grid.html.twig', array('list' => object(Pagerfanta), 'limit' => 10, 'order' => '', 'filters' => array(), 'routeName' => 'alerts'))
(src/Controller/Alerts/AlertsController.php:56)
at App\Controller\Alerts\AlertsController->grid(1, 0, '', '', object(AlertRepository))
(vendor/symfony/http-kernel/HttpKernel.php:149)
at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
(vendor/symfony/http-kernel/HttpKernel.php:66)
at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
(vendor/symfony/http-kernel/Kernel.php:190)
at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
(public/index.php:37)

@sampart
Copy link
Collaborator

sampart commented Jun 14, 2018

Sorry for the delay in commenting, @tsens. I'm wondering whether your versions of Pagerfanta and Pagerfanta bundle have got out-of-sync, since there were changes in both of them to use just prev_message rather than a mix of prev_message and previous_message. If only Pagerfanta has been updated and not the bundle, for example, that could explain it.

Please could you let me know what version of white-october/pagerfanta-bundle you have installed? You can see this with composer show if that helps.

Alternatively, you could just go ahead and upgrade to the latest version of PagerfantaBundle and see if that solve the problem.

@tsens
Copy link
Author

tsens commented Jun 19, 2018

white-october/pagerfanta-bundle (v1.2.0) <- ERROR

  • Updating pagerfanta/pagerfanta (v1.0.5 => v2.0.1): Loading from cache
  • Updating white-october/pagerfanta-bundle (v1.1.3 => v1.2.0): Loading from cache

@sampart
Copy link
Collaborator

sampart commented Jun 25, 2018

I've not managed to replicate this. It's a very odd error, because the same commit that updated this line to use prev_message:

(vendor/pagerfanta/pagerfanta/src/Pagerfanta/View/Template/DefaultTemplate.php:57)
at Pagerfanta\View\Template\DefaultTemplate->previousDisabled()

... also updated the $defaultOptions array in that same file to include a prev_message option.

Please could you attach a copy of vendor/pagerfanta/pagerfanta/src/Pagerfanta/View/Template/DefaultTemplate.php from your install so that I can take a look? Thanks

@sampart
Copy link
Collaborator

sampart commented Jun 25, 2018

One other question - have you done a cache clear since upgrading? I've seen unusual errors like this resolved by clearing the cache in the past.

@michalcampr
Copy link

I had exactly the same error. After a while of searching, I found out that I was overriding the DefaultTemplate.php in my bundle and setting the $defaultOptions array, where one of the options had a key "previous_message" instead of "prev_message".

@sampart
Copy link
Collaborator

sampart commented Oct 8, 2018

Thanks for sharing, @michalcampr. I reckon that's highly likely to be helpful to others too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants