From bdc7f451f9a54d8867975c7942ac812f5804c8e0 Mon Sep 17 00:00:00 2001 From: trendschau Date: Sun, 1 Sep 2024 21:54:35 +0200 Subject: [PATCH] v2.9 fix twig view syntax in plugin class --- system/typemill/Controllers/ControllerApiSystemUsers.php | 2 +- system/typemill/Plugin.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/system/typemill/Controllers/ControllerApiSystemUsers.php b/system/typemill/Controllers/ControllerApiSystemUsers.php index bbc9146..cd04799 100644 --- a/system/typemill/Controllers/ControllerApiSystemUsers.php +++ b/system/typemill/Controllers/ControllerApiSystemUsers.php @@ -236,7 +236,7 @@ class ControllerApiSystemUsers extends Controller { $response->getBody()->write(json_encode([ 'message' => Translations::translate('Please correct your input.'), - 'errors' => $validateErrors + 'errors' => $validate->errors ])); return $response->withHeader('Content-Type', 'application/json')->withStatus(400); diff --git a/system/typemill/Plugin.php b/system/typemill/Plugin.php index 78c5a85..018e3da 100644 --- a/system/typemill/Plugin.php +++ b/system/typemill/Plugin.php @@ -186,19 +186,19 @@ abstract class Plugin implements EventSubscriberInterface protected function addTwigGlobal($name, $class) { - $this->container->view->getEnvironment()->addGlobal($name, $class); + $this->container->get('view')->getEnvironment()->addGlobal($name, $class); } protected function addTwigFilter($name, $filter) { $filter = new \Twig_SimpleFilter($name, $filter); - $this->container->view->getEnvironment()->addFilter($filter); + $this->container->get('view')->getEnvironment()->addFilter($filter); } protected function addTwigFunction($name, $function) { $function = new \Twig_SimpleFunction($name, $function); - $this->container->view->getEnvironment()->addFunction($function); + $this->container->get('view')->getEnvironment()->addFunction($function); } protected function addJS($JS)