From 191818052a1bcc841c222cc3861b374bb090f40d Mon Sep 17 00:00:00 2001 From: Jelle Siderius Date: Fri, 9 Aug 2024 14:03:30 +0200 Subject: [PATCH 1/2] Prevent error from being thrown --- Console/ReencryptColumn.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Console/ReencryptColumn.php b/Console/ReencryptColumn.php index bac6f48..adbfca4 100644 --- a/Console/ReencryptColumn.php +++ b/Console/ReencryptColumn.php @@ -123,6 +123,12 @@ protected function execute(InputInterface $input, OutputInterface $output): int */ $tableName = $this->resourceConnection->getTableName($table); $connection = $this->resourceConnection->getConnection(); + + if (!$connection->isTableExists($tableName)) { + $output->writeln("The table {$tableName} doesn't exist"); + return Cli::RETURN_SUCCESS; + } + $field = $connection->quoteIdentifier(sprintf('%s.%s', $tableName, $column)); $select = $connection->select() ->from($tableName, [$identifier, "$column"]); From 8938bc30cfb92149ac3df4e7b6dc644de956690b Mon Sep 17 00:00:00 2001 From: Jelle Siderius Date: Fri, 9 Aug 2024 14:05:21 +0200 Subject: [PATCH 2/2] Prevent error from being thrown --- Console/ReencryptUnhandledCoreConfigData.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Console/ReencryptUnhandledCoreConfigData.php b/Console/ReencryptUnhandledCoreConfigData.php index 0531ab8..1fcc5ad 100644 --- a/Console/ReencryptUnhandledCoreConfigData.php +++ b/Console/ReencryptUnhandledCoreConfigData.php @@ -74,6 +74,12 @@ protected function execute(InputInterface $input, OutputInterface $output): int */ $ccdTable = $this->resourceConnection->getTableName('core_config_data'); $connection = $this->resourceConnection->getConnection(); + + if (!$connection->isTableExists($ccdTable)) { + $output->writeln("The table {$ccdTable} doesn't exist"); + return Cli::RETURN_SUCCESS; + } + $select = $connection->select() ->from($ccdTable, ['*']) ->where('(value LIKE "_:_:____%" OR value LIKE "__:_:____%")')