Skip to content

Commit

Permalink
Fix for #23577. Check if db tables for config data exists before fetc…
Browse files Browse the repository at this point in the history
…h data.
  • Loading branch information
ivanko-dev committed Oct 10, 2019
1 parent ea71192 commit 813f1d7
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions app/code/Magento/Store/App/Config/Source/RuntimeConfigSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 813f1d7

Please sign in to comment.