Skip to content

Commit 6dfeb91

Browse files
AC-13182::[Upgrade Build] Manual Upgrade Build 2.4.7-p2 -> 2.4.8-beta1
1 parent e28585d commit 6dfeb91

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

lib/internal/Magento/Framework/Mview/Config/Converter.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,15 @@ protected function convertChild(\DOMNode $childNode, $data)
108108
continue;
109109
}
110110
$name = $this->getAttributeValue($subscription, 'name');
111-
$column = $this->getAttributeValue($subscription, 'entity_column');
112-
$column = $this->checkifcolumnexist($name, $column);
111+
$configColumn = $this->getAttributeValue($subscription, 'entity_column');
112+
$column = $this->checkifcolumnexist($name, $configColumn);
113+
114+
if (empty($column)) {
115+
throw new \InvalidArgumentException(
116+
'Column ' . $configColumn . ' does not exist in table ' . $name
117+
);
118+
}
119+
113120
$subscriptionModel = $this->getAttributeValue($subscription, 'subscription_model');
114121

115122
if (!empty($subscriptionModel)
@@ -173,13 +180,15 @@ private function getAdditionalColumns(\DOMNode $subscription): array
173180
* @param string $columnName
174181
* @return string
175182
*/
176-
public function checkifcolumnexist($tableName, $columnName) : ?string
183+
public function checkifcolumnexist($tableName, $columnName) : string
177184
{
178185
$connection = $this->resourceConnection->getConnection();
179186
$tableName = $this->resourceConnection->getTableName($tableName);
180187

181188
if (!$connection->isTableExists($tableName) || $connection->tableColumnExists($tableName, $columnName)) {
182189
return $columnName;
183190
}
191+
192+
return '';
184193
}
185194
}

0 commit comments

Comments
 (0)