Skip to content

Commit bed1af4

Browse files
committed
Merge remote-tracking branch 'origin/develop' into release_sync
2 parents 7fc8642 + f1a93f0 commit bed1af4

File tree

1 file changed

+4
-5
lines changed
  • app/code/Magento/PageBuilder/Component/Form/Element

1 file changed

+4
-5
lines changed

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
namespace Magento\PageBuilder\Component\Form\Element;
99

10+
use Magento\Catalog\Setup\CategorySetup;
1011
use Magento\Framework\App\ObjectManager;
1112
use Magento\Framework\Data\FormFactory;
1213
use Magento\Framework\View\Asset\Repository;
@@ -17,7 +18,6 @@
1718
use Magento\PageBuilder\Model\Config as PageBuilderConfig;
1819
use Magento\PageBuilder\Model\State as PageBuilderState;
1920
use Magento\PageBuilder\Model\Stage\Config as Config;
20-
use Magento\Framework\View\ConfigInterface as ViewConfigInterface;
2121

2222
/**
2323
* Updates wysiwyg element with Page Builder specific config
@@ -45,11 +45,10 @@ class Wysiwyg extends \Magento\Ui\Component\Form\Element\Wysiwyg
4545
* @param array $config
4646
* @param PageBuilderConfig|null $pageBuilderConfig
4747
* @param bool $overrideSnapshot
48-
* @param Repository $assetRepo
48+
* @param Repository|null $assetRepo
4949
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
5050
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
5151
* @SuppressWarnings(PHPMD.NPathComplexity)
52-
* @throws \Magento\Framework\Exception\NoSuchEntityException
5352
*/
5453
public function __construct(
5554
ContextInterface $context,
@@ -66,14 +65,14 @@ public function __construct(
6665
Repository $assetRepo = null
6766
) {
6867
$this->assetRepo = $assetRepo ?: ObjectManager::getInstance()->get(Repository::class);
69-
$wysiwygConfigData = isset($config['wysiwygConfigData']) ? $config['wysiwygConfigData'] : [];
68+
$wysiwygConfigData = $config['wysiwygConfigData'] ?? [];
7069

7170
// If a dataType is present we're dealing with an attribute
7271
if (isset($config['dataType'])) {
7372
try {
7473
$attribute = $attrRepository->get($data['name']);
7574

76-
if ($attribute) {
75+
if ($attribute && $attribute->getEntityTypeId() === CategorySetup::CATEGORY_ENTITY_TYPE_ID) {
7776
$config['wysiwyg'] = (bool)$attribute->getIsWysiwygEnabled();
7877
}
7978
} catch (NoSuchEntityException $e) {

0 commit comments

Comments
 (0)