Skip to content

Commit 2cb6a02

Browse files
committed
MAGETWO-95652: Call to \Magento\Framework\Api\MetadataServiceInterface::getCustomAttributesMetadata leads to fatal error
1 parent d96db6d commit 2cb6a02

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

app/code/Magento/Catalog/Model/FilterProductCustomAttribute.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function __construct(array $blackList = [])
2828
/**
2929
* Delete custom attribute
3030
*
31-
* @param array $attributes
31+
* @param array $attributes set objects attributes @example ['attribute_code'=>'attribute_object']
3232
* @return array
3333
*/
3434
public function execute(array $attributes): array

app/code/Magento/Catalog/Model/Product.php

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -506,13 +506,16 @@ protected function _getResource()
506506
protected function getCustomAttributesCodes()
507507
{
508508
if ($this->customAttributesCodes === null) {
509-
$this->customAttributesCodes = array_keys($this->eavConfig->getEntityAttributes(
510-
self::ENTITY,
511-
$this
512-
));
513-
514-
$this->customAttributesCodes = $this->filterCustomAttribute->execute($this->customAttributesCodes);
515-
$this->customAttributesCodes = array_diff($this->customAttributesCodes, ProductInterface::ATTRIBUTES);
509+
$this->customAttributesCodes = array_diff(
510+
array_keys(
511+
$this->filterCustomAttribute->execute(
512+
$this->eavConfig->getEntityAttributes(
513+
self::ENTITY,
514+
$this
515+
)
516+
)
517+
), ProductInterface::ATTRIBUTES
518+
);
516519
}
517520

518521
return $this->customAttributesCodes;

0 commit comments

Comments
 (0)