Skip to content

Commit 813f1d7

Browse files
committed
Fix for #23577. Check if db tables for config data exists before fetch data.
1 parent ea71192 commit 813f1d7

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

app/code/Magento/Store/App/Config/Source/RuntimeConfigSource.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,17 @@ private function getConnection()
8383
*/
8484
private function getEntities($table, $keyField)
8585
{
86-
$entities = $this->getConnection()->fetchAll(
87-
$this->getConnection()->select()->from($this->resourceConnection->getTableName($table))
88-
);
8986
$data = [];
90-
foreach ($entities as $entity) {
91-
$data[$entity[$keyField]] = $entity;
87+
$tableName = $this->resourceConnection->getTableName($table);
88+
// Check if db table exists before fetch data
89+
if($this->resourceConnection->getConnection()->isTableExists($tableName)) {
90+
$entities = $this->getConnection()->fetchAll(
91+
$this->getConnection()->select()->from($tableName)
92+
);
93+
94+
foreach ($entities as $entity) {
95+
$data[$entity[$keyField]] = $entity;
96+
}
9297
}
9398

9499
return $data;

0 commit comments

Comments
 (0)