File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
app/code/Magento/GroupedProduct/Model/Product/Initialization/Helper/ProductLinks/Plugin Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 88use Magento \Catalog \Api \Data \ProductLinkExtensionFactory ;
99use Magento \Catalog \Api \Data \ProductLinkInterfaceFactory ;
1010use Magento \Catalog \Api \ProductRepositoryInterface ;
11+ use Magento \Framework \Exception \NoSuchEntityException ;
1112use Magento \GroupedProduct \Model \Product \Type \Grouped as TypeGrouped ;
1213
1314/**
@@ -60,6 +61,9 @@ public function __construct(
6061 * @param array $links
6162 *
6263 * @return \Magento\Catalog\Model\Product
64+ *
65+ * @throws NoSuchEntityException
66+ *
6367 * @SuppressWarnings(PHPMD.UnusedFormalParameter)
6468 * @SuppressWarnings(PHPMD.CyclomaticComplexity)
6569 * @SuppressWarnings(PHPMD.NPathComplexity)
@@ -70,7 +74,7 @@ public function beforeInitializeLinks(
7074 array $ links
7175 ) {
7276 if ($ product ->getTypeId () === TypeGrouped::TYPE_CODE && !$ product ->getGroupedReadonly ()) {
73- $ links = ( isset ( $ links [self ::TYPE_NAME ])) ? $ links [ self :: TYPE_NAME ] : $ product ->getGroupedLinkData ();
77+ $ links = $ links [self ::TYPE_NAME ] ?? $ product ->getGroupedLinkData ();
7478 if (!is_array ($ links )) {
7579 $ links = [];
7680 }
You can’t perform that action at this time.
0 commit comments