From 0cbd0ce28a5a65b218db79bed60912d14f50bfbb Mon Sep 17 00:00:00 2001 From: Yassine Guedidi Date: Sun, 24 Dec 2023 20:29:51 +0100 Subject: [PATCH 1/3] Fix getEntity() depreciation --- .../Event/Subscriber/SQLiteCascadeDeleteSubscriber.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Wallabag/CoreBundle/Event/Subscriber/SQLiteCascadeDeleteSubscriber.php b/src/Wallabag/CoreBundle/Event/Subscriber/SQLiteCascadeDeleteSubscriber.php index 4b9d5c243..9a1e05e73 100644 --- a/src/Wallabag/CoreBundle/Event/Subscriber/SQLiteCascadeDeleteSubscriber.php +++ b/src/Wallabag/CoreBundle/Event/Subscriber/SQLiteCascadeDeleteSubscriber.php @@ -40,7 +40,7 @@ class SQLiteCascadeDeleteSubscriber implements EventSubscriber */ public function preRemove(LifecycleEventArgs $args) { - $entity = $args->getEntity(); + $entity = $args->getObject(); if (!$this->doctrine->getConnection()->getDatabasePlatform() instanceof SqlitePlatform || !$entity instanceof Entry) { return; From e5a8b152eb2c326744cf98378dd65141e39f9dc5 Mon Sep 17 00:00:00 2001 From: Yassine Guedidi Date: Sun, 24 Dec 2023 20:44:59 +0100 Subject: [PATCH 2/3] Fix getSchemaManager() depreciation --- src/Wallabag/CoreBundle/Command/InstallCommand.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Wallabag/CoreBundle/Command/InstallCommand.php b/src/Wallabag/CoreBundle/Command/InstallCommand.php index 1ea01cc81..d29f177e6 100644 --- a/src/Wallabag/CoreBundle/Command/InstallCommand.php +++ b/src/Wallabag/CoreBundle/Command/InstallCommand.php @@ -378,7 +378,7 @@ class InstallCommand extends Command $databaseName = $connection->getDatabase(); try { - $schemaManager = $connection->getSchemaManager(); + $schemaManager = $connection->createSchemaManager(); } catch (\Exception $exception) { // mysql & sqlite if (false !== strpos($exception->getMessage(), sprintf("Unknown database '%s'", $databaseName))) { @@ -421,7 +421,7 @@ class InstallCommand extends Command */ private function isSchemaPresent() { - $schemaManager = $this->entityManager->getConnection()->getSchemaManager(); + $schemaManager = $this->entityManager->getConnection()->createSchemaManager(); return \count($schemaManager->listTableNames()) > 0 ? true : false; } From 8b9d3795da0be4e030afdfe6cb3c342d4649ba48 Mon Sep 17 00:00:00 2001 From: Yassine Guedidi Date: Mon, 25 Dec 2023 11:19:39 +0100 Subject: [PATCH 3/3] Fix setSQLLogger() depreciation --- src/Wallabag/ImportBundle/Command/ImportCommand.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Wallabag/ImportBundle/Command/ImportCommand.php b/src/Wallabag/ImportBundle/Command/ImportCommand.php index de2a8994a..9e4e11c1f 100644 --- a/src/Wallabag/ImportBundle/Command/ImportCommand.php +++ b/src/Wallabag/ImportBundle/Command/ImportCommand.php @@ -2,6 +2,8 @@ namespace Wallabag\ImportBundle\Command; +use Doctrine\DBAL\Driver\Middleware; +use Doctrine\DBAL\Logging\Middleware as LoggingMiddleware; use Doctrine\ORM\EntityManagerInterface; use Symfony\Component\Config\Definition\Exception\Exception; use Symfony\Component\Console\Command\Command; @@ -99,7 +101,11 @@ class ImportCommand extends Command } // Turning off doctrine default logs queries for saving memory - $this->entityManager->getConnection()->getConfiguration()->setSQLLogger(null); + $middlewares = $this->entityManager->getConnection()->getConfiguration()->getMiddlewares(); + $middlewaresWithoutLogging = array_filter($middlewares, function (Middleware $middleware) { + return !$middleware instanceof LoggingMiddleware; + }); + $this->entityManager->getConnection()->getConfiguration()->setMiddlewares($middlewaresWithoutLogging); if ($input->getOption('useUserId')) { $entityUser = $this->userRepository->findOneById($input->getArgument('username'));