File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
app/code/Magento/Catalog/Model/Category Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -356,6 +356,7 @@ public function getAttributesMeta(Type $entityType)
356
356
$ meta = [];
357
357
$ attributes = $ entityType ->getAttributeCollection ();
358
358
$ fields = $ this ->getFields ();
359
+ $ category = $ this ->getCurrentCategory ();
359
360
/* @var EavAttribute $attribute */
360
361
foreach ($ attributes as $ attribute ) {
361
362
$ code = $ attribute ->getAttributeCode ();
@@ -382,11 +383,13 @@ public function getAttributesMeta(Type $entityType)
382
383
$ meta [$ code ]['componentType ' ] = Field::NAME ;
383
384
384
385
// disable fields
385
- $ attributeIsLocked = $ this ->getCurrentCategory ()->isLockedAttribute ($ code );
386
- $ meta [$ code ]['disabled ' ] = $ attributeIsLocked ;
387
- $ hasUseConfigField = (bool ) array_search ('use_config. ' . $ code , $ fields , true );
388
- if ($ hasUseConfigField && $ meta [$ code ]['disabled ' ]) {
389
- $ meta ['use_config. ' . $ code ]['disabled ' ] = true ;
386
+ if ($ category ) {
387
+ $ attributeIsLocked = $ category ->isLockedAttribute ($ code );
388
+ $ meta [$ code ]['disabled ' ] = $ attributeIsLocked ;
389
+ $ hasUseConfigField = (bool ) array_search ('use_config. ' . $ code , $ fields , true );
390
+ if ($ hasUseConfigField && $ meta [$ code ]['disabled ' ]) {
391
+ $ meta ['use_config. ' . $ code ]['disabled ' ] = true ;
392
+ }
390
393
}
391
394
}
392
395
You can’t perform that action at this time.
0 commit comments