File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -172,6 +172,17 @@ class Category extends \Magento\ImportExport\Model\Import\AbstractEntity
172172 self ::COL_CATEGORY
173173 ];
174174
175+ /**
176+ * List of fields that can used config values in case when value does not defined directly
177+ *
178+ * @var array
179+ */
180+ protected $ useConfigFields = [
181+ 'available_sort_by ' ,
182+ 'default_sort_by ' ,
183+ 'filter_price_range '
184+ ];
185+
175186 private ?int $ errorsLimit = null ;
176187 private array $ invalidRows = [];
177188
@@ -816,7 +827,8 @@ public function validateRow(array $rowData, $rowNum)
816827 foreach ($ this ->attributes as $ attrCode => $ attrParams ) {
817828 if (isset ($ rowData [$ attrCode ]) && strlen ($ rowData [$ attrCode ])) {
818829 $ this ->isAttributeValid ($ attrCode , $ attrParams , $ rowData , $ rowNum );
819- } elseif ($ attrParams ['is_required ' ] && !isset ($ this ->categoriesWithRoots [$ root ][$ category ])) {
830+ } elseif ($ attrParams ['is_required ' ] && !isset ($ this ->categoriesWithRoots [$ root ][$ category ])
831+ && !in_array ($ attrCode , $ this ->useConfigFields )) {
820832 $ this ->addRowError (self ::ERROR_VALUE_IS_REQUIRED , $ rowNum , $ attrCode );
821833 }
822834 }
You can’t perform that action at this time.
0 commit comments