@@ -149,6 +149,8 @@ class Product extends ProductResourceModel
149149 * @param Iterator $iterator
150150 * @param LinkField $linkFieldHelper
151151 * @param DataSourceHelper $dataSourceHelper
152+ * @param PriceTableResolver $priceTableResolver
153+ * @param DimensionFactory $dimensionFactory
152154 * @param array $data
153155 *
154156 * @throws Exception
@@ -167,6 +169,8 @@ public function __construct(
167169 Iterator $ iterator ,
168170 LinkField $ linkFieldHelper ,
169171 DataSourceHelper $ dataSourceHelper ,
172+ PriceTableResolver $ priceTableResolver ,
173+ DimensionFactory $ dimensionFactory ,
170174 array $ data = []
171175 ) {
172176 $ this ->iterator = $ iterator ;
@@ -175,17 +179,8 @@ public function __construct(
175179 $ this ->linkField = $ this ->linkFieldHelper ->getEntityLinkField (ProductInterface::class);
176180
177181 $ this ->dataSourceHelper = $ dataSourceHelper ;
178-
179- if (class_exists (PriceTableResolver::class)) {
180- // @codingStandardsIgnoreStart
181- $ this ->priceTableResolver = ObjectManager::getInstance ()->get (PriceTableResolver::class);
182- // @codingStandardsIgnoreEnd
183- }
184- if (class_exists (Dimension::class)) {
185- // @codingStandardsIgnoreStart
186- $ this ->dimensionFactory = ObjectManager::getInstance ()->get (DimensionFactory::class);
187- // @codingStandardsIgnoreEnd
188- }
182+ $ this ->priceTableResolver = $ priceTableResolver ;
183+ $ this ->dimensionFactory = $ dimensionFactory ;
189184
190185 parent ::__construct (
191186 $ context ,
@@ -503,13 +498,17 @@ public function getAttributeData(
503498 ->addFieldToFilter ('entity_type_id ' , ['eq ' => self ::PRODUCT_ENTITY_TYPE_ID ])
504499 ->addFieldToFilter ('attribute_code ' , ['in ' => $ attributeCodes ]);
505500
501+ $ failedSources = [];
502+
506503 /** @var ProductAttribute $productAttribute */
507504 foreach ($ productAttributeCollection as $ productAttribute ) {
508505 if ($ sourceModel = $ productAttribute ->getSourceModel ()) {
509506 try {
510507 $ sourceModels [$ productAttribute ->getAttributeCode ()] =
511508 $ productAttribute ->getSource ();
512- } catch (Exception $ e ) {} // @codingStandardsIgnoreLine
509+ } catch (Exception $ e ) {
510+ $ failedSources [] = $ productAttribute ->getSource ();
511+ }
513512 }
514513
515514 $ attributeTable = $ productAttribute ->getBackendTable ();
@@ -679,10 +678,10 @@ private function getAttributeTableFieldItems(
679678 $ this ->_resource ->getConnection ()
680679 );
681680 }
682- } catch (Exception $ e ) { // @codingStandardsIgnoreLine
681+ return $ this ;
682+ } catch (Exception $ e ) {
683+ return $ this ;
683684 }
684-
685- return $ this ;
686685 }
687686
688687 /**
0 commit comments