File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
lib/internal/Magento/Framework/Mview/Config Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments