@@ -199,7 +199,7 @@ class Category extends \Magento\ImportExport\Model\Import\AbstractEntity
199199 private $ symbolIgnoreFields = false ;
200200
201201 private int $ defaultAttributeSetId = 0 ;
202- private CategoryImportVersion $ categoryImportVersionFeature ;
202+ private ? CategoryImportVersion $ categoryImportVersionFeature ;
203203 private ?Uploader $ fileUploader = null ;
204204 private DirectoryWriteInterface $ mediaDirectory ;
205205 private StoreManagerInterface $ storeManager ;
@@ -383,7 +383,7 @@ private function initCategories(): self
383383 }
384384
385385 $ index = $ this ->implodeEscaped (
386- $ this ->_scopeConfig ->getValue (Config::XML_PATH_CATEGORY_PATH_SEPERATOR ),
386+ ( string ) $ this ->_scopeConfig ->getValue (Config::XML_PATH_CATEGORY_PATH_SEPERATOR ),
387387 $ path
388388 );
389389 $ this ->categoriesWithRoots [$ rootCategoryName ][$ index ] = [
@@ -861,13 +861,13 @@ private function getCategoryName(array $rowData): string
861861 }
862862
863863 $ categoryParts = $ this ->explodeEscaped (
864- $ this ->_scopeConfig ->getValue (Config::XML_PATH_CATEGORY_PATH_SEPERATOR ),
864+ ( string ) $ this ->_scopeConfig ->getValue (Config::XML_PATH_CATEGORY_PATH_SEPERATOR ),
865865 $ rowData [self ::COL_CATEGORY ]
866866 );
867867 return end ($ categoryParts );
868868 }
869869
870- private function explodeEscaped (string $ delimiter = ' / ' , string $ string ): array
870+ private function explodeEscaped (string $ delimiter , string $ string ): array
871871 {
872872 $ exploded = explode ($ delimiter , $ string );
873873 $ fixed = [];
@@ -911,12 +911,12 @@ protected function getParentCategory(array $rowData)
911911 $ parent = $ categoryParts [count ($ categoryParts ) - 2 ];
912912 } else {
913913 $ categoryParts = $ this ->explodeEscaped (
914- $ this ->_scopeConfig ->getValue (Config::XML_PATH_CATEGORY_PATH_SEPERATOR ),
914+ ( string ) $ this ->_scopeConfig ->getValue (Config::XML_PATH_CATEGORY_PATH_SEPERATOR ),
915915 $ rowData [self ::COL_CATEGORY ]
916916 );
917917 array_pop ($ categoryParts );
918918 $ parent = $ this ->implodeEscaped (
919- $ this ->_scopeConfig ->getValue (Config::XML_PATH_CATEGORY_PATH_SEPERATOR ),
919+ ( string ) $ this ->_scopeConfig ->getValue (Config::XML_PATH_CATEGORY_PATH_SEPERATOR ),
920920 $ categoryParts
921921 );
922922 }
@@ -1170,7 +1170,9 @@ private function getUploader(): Uploader
11701170 private function saveCategoryEntity (array $ entityRowsIn , array $ entityRowsUp ): self
11711171 {
11721172 if ($ entityRowsIn ) {
1173- $ entityRowsIn = $ this ->categoryImportVersionFeature ->processCategory ($ entityRowsIn );
1173+ if ($ this ->categoryImportVersionFeature !== null ) {
1174+ $ entityRowsIn = $ this ->categoryImportVersionFeature ->processCategory ($ entityRowsIn );
1175+ }
11741176
11751177 $ this ->_connection ->insertMultiple ($ this ->entityTable , $ entityRowsIn );
11761178 }
@@ -1197,7 +1199,11 @@ private function saveCategoryEntity(array $entityRowsIn, array $entityRowsUp): s
11971199 */
11981200 private function saveCategoryAttributes (array $ attributesData ): self
11991201 {
1200- $ entityFieldName = $ this ->categoryImportVersionFeature ->getEntityFieldName ();
1202+ if ($ this ->categoryImportVersionFeature !== null ) {
1203+ $ entityFieldName = $ this ->categoryImportVersionFeature ->getEntityFieldName ();
1204+ } else {
1205+ $ entityFieldName = 'entity_id ' ;
1206+ }
12011207
12021208 $ entityIds = array ();
12031209
0 commit comments