13
13
use Magento \Catalog \Api \CategoryAttributeRepositoryInterface ;
14
14
use Magento \Framework \Exception \NoSuchEntityException ;
15
15
use Magento \PageBuilder \Model \State as PageBuilderState ;
16
- use \Magento \PageBuilder \Model \Stage \Config as Config ;
16
+ use Magento \PageBuilder \Model \Stage \Config as Config ;
17
+ use Psr \Log \LoggerInterface ;
17
18
18
19
/**
19
20
* Updates wysiwyg element with Page Builder specific config
22
23
*/
23
24
class Wysiwyg extends \Magento \Ui \Component \Form \Element \Wysiwyg
24
25
{
26
+ /**
27
+ * @var LoggerInterface
28
+ */
29
+ private $ logger ;
30
+
25
31
/**
26
32
* Wysiwyg constructor.
27
33
*
34
+ * @param LoggerInterface $logger
28
35
* @param ContextInterface $context
29
36
* @param FormFactory $formFactory
30
37
* @param ConfigInterface $wysiwygConfig
@@ -36,6 +43,7 @@ class Wysiwyg extends \Magento\Ui\Component\Form\Element\Wysiwyg
36
43
* @param array $config
37
44
*/
38
45
public function __construct (
46
+ LoggerInterface $ logger ,
39
47
ContextInterface $ context ,
40
48
FormFactory $ formFactory ,
41
49
ConfigInterface $ wysiwygConfig ,
@@ -55,7 +63,9 @@ public function __construct(
55
63
$ config ['wysiwyg ' ] = (bool )$ attribute ->getIsWysiwygEnabled ();
56
64
}
57
65
} catch (NoSuchEntityException $ e ) {
58
- // This model is used by non product attributes
66
+ $ logger ->warning (
67
+ __ ('This model is used by non product attributes: %1 ' , $ e ->getMessage ())
68
+ );
59
69
}
60
70
}
61
71
$ isEnablePageBuilder = isset ($ wysiwygConfigData ['is_pagebuilder_enabled ' ])
@@ -78,5 +88,6 @@ public function __construct(
78
88
}
79
89
80
90
parent ::__construct ($ context , $ formFactory , $ wysiwygConfig , $ components , $ data , $ config );
91
+ $ this ->logger = $ logger ;
81
92
}
82
93
}
0 commit comments