From cdb559d91a75473ba247c03d69def92b78634e51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Auswo=CC=88ger?= Date: Tue, 11 Jul 2023 17:10:49 +0200 Subject: [PATCH] Fix bug with undefined method System::log() --- src/CustomElements.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/CustomElements.php b/src/CustomElements.php index bee4ae0..a4d4a08 100644 --- a/src/CustomElements.php +++ b/src/CustomElements.php @@ -12,6 +12,7 @@ use Contao\BackendUser; use Contao\Config; use Contao\Controller; +use Contao\CoreBundle\Monolog\ContaoContext; use Contao\Database; use Contao\DataContainer; use Contao\FilesModel; @@ -21,6 +22,7 @@ use Contao\System; use Doctrine\DBAL\DBALException; use MadeYourDay\RockSolidCustomElements\Template\CustomTemplate; +use Psr\Log\LogLevel; use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\HttpFoundation\Request; @@ -1403,7 +1405,7 @@ function ($count) { } ); if (count($duplicateConfigs)) { - System::log('Duplicate Custom Elements found: ' . implode(', ', array_keys($duplicateConfigs)), __METHOD__, TL_ERROR); + System::getContainer()->get('monolog.logger.contao')->log(LogLevel::ERROR, 'Duplicate Custom Elements found: ' . implode(', ', array_keys($duplicateConfigs)), array('contao' => new ContaoContext(__METHOD__, 'ERROR'))); } foreach ($allConfigs as $configPath) {