@@ -444,8 +444,11 @@ protected function initCategories()
444
444
if ($ pathSize > 1 ) {
445
445
$ path = [];
446
446
for ($ i = 1 ; $ i < $ pathSize ; $ i ++) {
447
- $ name = $ collection ->getItemById ($ structure [$ i ])->getName ();
448
- $ path [] = $ this ->quoteCategoryDelimiter ($ name );
447
+ $ childCategory = $ collection ->getItemById ($ structure [$ i ]);
448
+ if ($ childCategory ) {
449
+ $ name = $ childCategory ->getName ();
450
+ $ path [] = $ this ->quoteCategoryDelimiter ($ name );
451
+ }
449
452
}
450
453
$ this ->_rootCategories [$ category ->getId ()] = array_shift ($ path );
451
454
if ($ pathSize > 2 ) {
@@ -673,8 +676,8 @@ protected function prepareLinks(array $productIds)
673
676
/**
674
677
* Update data row with information about categories. Return true, if data row was updated
675
678
*
676
- * @param array & $dataRow
677
- * @param array & $rowCategories
679
+ * @param array $dataRow
680
+ * @param array $rowCategories
678
681
* @param int $productId
679
682
* @return bool
680
683
*/
@@ -840,6 +843,7 @@ protected function paginateCollection($page, $pageSize)
840
843
public function export ()
841
844
{
842
845
//Execution time may be very long
846
+ // phpcs:ignore Magento2.Functions.DiscouragedFunction
843
847
set_time_limit (0 );
844
848
845
849
$ writer = $ this ->getWriter ();
@@ -963,6 +967,7 @@ protected function loadCollection(): array
963
967
* @return array
964
968
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
965
969
* @SuppressWarnings(PHPMD.NPathComplexity)
970
+ * phpcs:disable Generic.Metrics.NestingLevel
966
971
*/
967
972
protected function collectRawData ()
968
973
{
@@ -1057,6 +1062,7 @@ protected function collectRawData()
1057
1062
1058
1063
return $ data ;
1059
1064
}
1065
+ //phpcs:enable Generic.Metrics.NestingLevel
1060
1066
1061
1067
/**
1062
1068
* Wrap values with double quotes if "Fields Enclosure" option is enabled
0 commit comments