File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
app/code/Magento/PageBuilder/Plugin/Catalog/Model/Product/Attribute Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -36,8 +36,9 @@ public function beforeSave(
36
36
\Magento \Catalog \Model \Product \Attribute \Repository $ subject ,
37
37
\Magento \Catalog \Api \Data \ProductAttributeInterface $ attribute
38
38
) {
39
- $ isPageBuilderEnabled = $ attribute ->getData ('extension_attributes ' )
40
- ? $ attribute ->getData ('extension_attributes ' )->getIsPagebuilderEnabled ()
39
+ $ extensionAttributes = $ attribute ->getData ('extension_attributes ' );
40
+ $ isPageBuilderEnabled = ($ extensionAttributes && method_exists ($ extensionAttributes , 'getIsPagebuilderEnabled ' ))
41
+ ? $ extensionAttributes ->getIsPagebuilderEnabled ()
41
42
: 0 ;
42
43
$ attribute ->setData ('is_pagebuilder_enabled ' , $ isPageBuilderEnabled );
43
44
}
@@ -58,7 +59,11 @@ public function afterGet(
58
59
$ extensionAttribute = $ result ->getExtensionAttributes ()
59
60
? $ result ->getExtensionAttributes ()
60
61
: $ this ->extensionAttributesFactory ->create ();
61
- $ extensionAttribute ->setIsPagebuilderEnabled ($ isPageBuilderEnabled );
62
+
63
+ if (method_exists ($ extensionAttribute , 'setIsPagebuilderEnabled ' )) {
64
+ $ extensionAttribute ->setIsPagebuilderEnabled ($ isPageBuilderEnabled );
65
+ }
66
+
62
67
$ result ->setExtensionAttributes ($ extensionAttribute );
63
68
return $ result ;
64
69
}
You can’t perform that action at this time.
0 commit comments