Skip to content
Grav 2.0 is officially stable. Read the announcement →
Support

Critical failure with "batch" filter expects an array or "Traversable", got "NULL"

Solved by pg@grav View solution

Started by pg@grav 1 year ago · 2 replies · 154 views
1 year ago

Hello,
perhaps somebody could help and give me a hint. I transfered a Website to Xampp. After updating the theme "Landio" i get a critical failure from the "batch" filter (twig):

PHP
grav.CRITICAL: The "batch" filter expects an array or "Traversable", got "NULL". - Trace: #0
D:\Xampp8117\htdocs\testfolder\cache\twig\e4\e4b630d6876bd248f5507081e1a793969ba9008e894791cdc4e3c5a868e2ec34.php(39): twig_array_batch(NULL, 2) #1 
D:\Xampp8117\htdocs\testfolder\vendor\twig\twig\src\Template.php(453): __TwigTemplate_30efb5231938f21eabbaa16a7993d72390a3b2e63463c877c555038f344746b0->doDisplay(Array, Array) #2
D:\Xampp8117\htdocs\testfolder\vendor\twig\twig\src\Template.php(420): Twig\Template->displayWithErrorHandling(Array, Array) #3
D:\Xampp8117\htdocs\testfolder\vendor\twig\twig\src\Template.php(432): Twig\Template->display(Array) #4
D:\Xampp8117\htdocs\testfolder\vendor\twig\twig\src\TemplateWrapper.php(47): Twig\Template->render(Array, Array) #5
D:\Xampp8117\htdocs\testfolder\vendor\twig\twig\src\Environment.php(384): Twig\TemplateWrapper->render(Array) #6
D:\Xampp8117\htdocs\testfolder\system\src\Grav\Common\Twig\Twig.php(340): Twig\Environment->render('modular/text.ht...', Array) #7
D:\Xampp8117\htdocs\testfolder\system\src\Grav\Common\Page\Page.php(987): Grav\Common\Twig\Twig->processPage(Object(Grav\Common\Page\Page), '') #8
.. more code here..
D:\Xampp8117\htdocs\testfolder\index.php(47): Grav\Common\Grav->process() #69 {main} [] []
1 year ago

Not only you didn't provide any context (was it admin, main page, other page with some custom theme template?), you even managed to remove part of the error, where I believe it actually showed where the error was

👍 1
1 year ago Solution

Thanks Karmalakas for the advice
The problem is solved.
it was the failure with /modular/text.html.twig connected with the line

TWIG
{# {% for row in page.header.text|batch(2) %}

i corrected my twig. Now theres is no failure
Thanks again

Suggested topics

Topic Participants Replies Views Activity
Support · by Anna, 3 days ago
3 62 9 hours ago
Support · by TomW, 2 days ago
2 62 9 hours ago
Support · by Anna, 6 days ago
7 179 2 days ago
Support · by Anna, 6 days ago
9 147 2 days ago
Support · by stuart young, 5 days ago
2 97 4 days ago