Error clearing cache with Easy Admin

For the past few versions of Easy Admin, including 3.4.40 we get an error when clearing cache:

TypeError: htmlspecialchars(): Argument #1 ($string) must be of type string, false given in /home/apache2/htdocs/modules/EasyAdmin/src/Controller/Admin/CheckAndFixController.php:278
Stack trace:
#0 /home/apache2/htdocs/modules/EasyAdmin/src/Controller/Admin/CheckAndFixController.php(278): htmlspecialchars(false, 40)
#1 /home/apache2/htdocs/modules/EasyAdmin/src/Controller/Admin/CheckAndFixController.php(173): EasyAdmin\Controller\Admin\CheckAndFixController->checkCache(Array, true)
#2 /home/apache2/htdocs/vendor/laminas/laminas-mvc/src/Controller/AbstractActionController.php(72): EasyAdmin\Controller\Admin\CheckAndFixController->indexAction()
#3 /home/apache2/htdocs/vendor/laminas/laminas-eventmanager/src/EventManager.php(318): Laminas\Mvc\Controller\AbstractActionController->onDispatch(Object(Laminas\Mvc\MvcEvent))
#4 /home/apache2/htdocs/vendor/laminas/laminas-eventmanager/src/EventManager.php(176): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent), Object(Closure))
#5 /home/apache2/htdocs/vendor/laminas/laminas-mvc/src/Controller/AbstractController.php(105): Laminas\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Laminas\Mvc\MvcEvent))
#6 /home/apache2/htdocs/vendor/laminas/laminas-mvc/src/DispatchListener.php(117): Laminas\Mvc\Controller\AbstractController->dispatch(Object(Laminas\Http\PhpEnvironment\Request), Object(Laminas\Http\PhpEnvironment\Response))
#7 /home/apache2/htdocs/vendor/laminas/laminas-eventmanager/src/EventManager.php(318): Laminas\Mvc\DispatchListener->onDispatch(Object(Laminas\Mvc\MvcEvent))
#8 /home/apache2/htdocs/vendor/laminas/laminas-eventmanager/src/EventManager.php(176): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent), Object(Closure))
#9 /home/apache2/htdocs/vendor/laminas/laminas-mvc/src/Application.php(319): Laminas\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Laminas\Mvc\MvcEvent))
#10 /home/apache2/htdocs/index.php(26): Laminas\Mvc\Application->run()
#11 {main}


I suspect that this may be because we are sorta bleeding edge with our PHP (v8.5.2), but am not sure.

Thanks for the report. yes, probably 8.5 or you not have opcache. I just fixed it in a commit, but for the new release, it will be next week.

1 Like