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)
108
108
continue ;
109
109
}
110
110
$ 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
+
113
120
$ subscriptionModel = $ this ->getAttributeValue ($ subscription , 'subscription_model ' );
114
121
115
122
if (!empty ($ subscriptionModel )
@@ -173,13 +180,15 @@ private function getAdditionalColumns(\DOMNode $subscription): array
173
180
* @param string $columnName
174
181
* @return string
175
182
*/
176
- public function checkifcolumnexist ($ tableName , $ columnName ) : ? string
183
+ public function checkifcolumnexist ($ tableName , $ columnName ) : string
177
184
{
178
185
$ connection = $ this ->resourceConnection ->getConnection ();
179
186
$ tableName = $ this ->resourceConnection ->getTableName ($ tableName );
180
187
181
188
if (!$ connection ->isTableExists ($ tableName ) || $ connection ->tableColumnExists ($ tableName , $ columnName )) {
182
189
return $ columnName ;
183
190
}
191
+
192
+ return '' ;
184
193
}
185
194
}
You can’t perform that action at this time.
0 commit comments