From 813f1d75628f827159f9c0496a7acff60795b53d Mon Sep 17 00:00:00 2001 From: Ivan Koliadynskyy Date: Thu, 10 Oct 2019 12:17:38 +0300 Subject: [PATCH] Fix for #23577. Check if db tables for config data exists before fetch data. --- .../App/Config/Source/RuntimeConfigSource.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/Store/App/Config/Source/RuntimeConfigSource.php b/app/code/Magento/Store/App/Config/Source/RuntimeConfigSource.php index 77ccce5d23bde..79d449a886a2b 100644 --- a/app/code/Magento/Store/App/Config/Source/RuntimeConfigSource.php +++ b/app/code/Magento/Store/App/Config/Source/RuntimeConfigSource.php @@ -83,12 +83,17 @@ private function getConnection() */ private function getEntities($table, $keyField) { - $entities = $this->getConnection()->fetchAll( - $this->getConnection()->select()->from($this->resourceConnection->getTableName($table)) - ); $data = []; - foreach ($entities as $entity) { - $data[$entity[$keyField]] = $entity; + $tableName = $this->resourceConnection->getTableName($table); + // Check if db table exists before fetch data + if($this->resourceConnection->getConnection()->isTableExists($tableName)) { + $entities = $this->getConnection()->fetchAll( + $this->getConnection()->select()->from($tableName) + ); + + foreach ($entities as $entity) { + $data[$entity[$keyField]] = $entity; + } } return $data;