Skip to content

Commit 7d2b33b

Browse files
author
Lukasz Borowiec
committed
#501: User sees content snapshot on CMS page in Admin Panel #7 - Fix for static test, added a logger for the wyswig file
1 parent f36e694 commit 7d2b33b

File tree

1 file changed

+13
-2
lines changed
  • app/code/Magento/PageBuilder/Component/Form/Element

1 file changed

+13
-2
lines changed

app/code/Magento/PageBuilder/Component/Form/Element/Wysiwyg.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
use Magento\Catalog\Api\CategoryAttributeRepositoryInterface;
1414
use Magento\Framework\Exception\NoSuchEntityException;
1515
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;
1718

1819
/**
1920
* Updates wysiwyg element with Page Builder specific config
@@ -22,9 +23,15 @@
2223
*/
2324
class Wysiwyg extends \Magento\Ui\Component\Form\Element\Wysiwyg
2425
{
26+
/**
27+
* @var LoggerInterface
28+
*/
29+
private $logger;
30+
2531
/**
2632
* Wysiwyg constructor.
2733
*
34+
* @param LoggerInterface $logger
2835
* @param ContextInterface $context
2936
* @param FormFactory $formFactory
3037
* @param ConfigInterface $wysiwygConfig
@@ -36,6 +43,7 @@ class Wysiwyg extends \Magento\Ui\Component\Form\Element\Wysiwyg
3643
* @param array $config
3744
*/
3845
public function __construct(
46+
LoggerInterface $logger,
3947
ContextInterface $context,
4048
FormFactory $formFactory,
4149
ConfigInterface $wysiwygConfig,
@@ -55,7 +63,9 @@ public function __construct(
5563
$config['wysiwyg'] = (bool)$attribute->getIsWysiwygEnabled();
5664
}
5765
} 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+
);
5969
}
6070
}
6171
$isEnablePageBuilder = isset($wysiwygConfigData['is_pagebuilder_enabled'])
@@ -78,5 +88,6 @@ public function __construct(
7888
}
7989

8090
parent::__construct($context, $formFactory, $wysiwygConfig, $components, $data, $config);
91+
$this->logger = $logger;
8192
}
8293
}

0 commit comments

Comments
 (0)