Skip to content

Commit 5b73e2a

Browse files
committed
Merge branch 'MC-15322' into MC-1426-Collect-PageBuilder-Content-Type-Data-for-PageBuilder-Analytics
2 parents ea66ccb + 5e6fbcd commit 5b73e2a

File tree

1 file changed

+22
-4
lines changed
  • app/code/Magento/PageBuilder/Block/Catalog/Block/Product/View

1 file changed

+22
-4
lines changed

app/code/Magento/PageBuilder/Block/Catalog/Block/Product/View/Attributes.php

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,36 @@
77

88
namespace Magento\PageBuilder\Block\Catalog\Block\Product\View;
99

10+
use Magento\Framework\DataObject;
11+
12+
/**
13+
* Create a new instance of attributes which excludes Page Builder attributes
14+
*/
1015
class Attributes extends \Magento\Catalog\Block\Product\View\Attributes
1116
{
1217
const DISPLAY_ATTRIBUTES_NON_PAGEBUILDER = 'non_pagebuilder';
1318

1419
const DISPLAY_ATTRIBUTES_PAGEBUILDER_ONLY = 'pagebuilder_only';
1520

21+
/**
22+
* @inheritdoc
23+
*/
24+
public function getProduct()
25+
{
26+
$product = parent::getProduct();
27+
28+
if (!$product) {
29+
$product = new DataObject();
30+
$product->setAttributes([]);
31+
}
32+
33+
return $product;
34+
}
35+
1636
/**
1737
* Determine if we should display the attribute on the front-end, add support for exclude page builder & page
18-
* builder only options on class.
19-
*
20-
* display_attributes can be set to determine whether to include just Page Builder attributes or to exclude
21-
* them.
38+
* builder only options on class. display_attributes can be set to determine whether to include just Page Builder
39+
* attributes or to exclude them.
2240
*
2341
* @param \Magento\Eav\Model\Entity\Attribute\AbstractAttribute $attribute
2442
* @param array $excludeAttr

0 commit comments

Comments
 (0)