From 8388a90ea53e67a3f0bde1e03e2f24b64f1925ee Mon Sep 17 00:00:00 2001 From: nikunj Date: Mon, 31 Aug 2020 11:44:45 +0530 Subject: [PATCH] #21853: Fix tests. --- .../Magento/Framework/Mview/View/Subscription.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/internal/Magento/Framework/Mview/View/Subscription.php b/lib/internal/Magento/Framework/Mview/View/Subscription.php index cd6288a231eb9..a65f6e98016f1 100644 --- a/lib/internal/Magento/Framework/Mview/View/Subscription.php +++ b/lib/internal/Magento/Framework/Mview/View/Subscription.php @@ -178,7 +178,7 @@ protected function getLinkedViews() continue; } // Search in view subscriptions - foreach ($view->getSubscriptions() as $subscription) { + foreach ($view->getSubscriptions() ?? [] as $subscription) { if ($subscription['name'] != $this->getTableName()) { continue; } @@ -200,7 +200,12 @@ protected function buildStatement($event, $view) { // Get the subscription for the specific view and specific table. // We will use column name from it. - $subscription = $view->getSubscriptions()[$this->getTableName()]; + $subscriptions = $view->getSubscriptions() ?? []; + if (empty($subscriptions[$this->getTableName()])) { + return ''; + } + + $subscription = $subscriptions[$this->getTableName()]; // Get the changelog from View to get changelog column name. $changelog = $view->getChangelog();