Skip to content

Commit d056b80

Browse files
committed
Fixed the media gallery url
1 parent e1facfc commit d056b80

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

app/code/Magento/PageBuilder/Component/Form/HtmlCode.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use Magento\Cms\Helper\Wysiwyg\Images;
1111
use Magento\Framework\View\Element\UiComponentFactory;
1212
use Magento\Framework\View\Element\UiComponent\ContextInterface;
13+
use Magento\Ui\Component\Form\Element\DataType\Media\OpenDialogUrl;
1314
use Magento\Variable\Model\Variable\Config as VariableConfig;
1415

1516
/**
@@ -39,12 +40,18 @@ class HtmlCode extends \Magento\Ui\Component\Form\Field
3940
*/
4041
private $currentTreePath;
4142

43+
/**
44+
* @var OpenDialogUrl
45+
*/
46+
private $openDialogUrl;
47+
4248
/**
4349
* @param ContextInterface $context
4450
* @param UiComponentFactory $uiComponentFactory
4551
* @param BackendUrlInterface $backendUrl
4652
* @param Images $imagesHelper
4753
* @param VariableConfig $variableConfig
54+
* @param OpenDialogUrl $openDialogUrl
4855
* @param string $currentTreePath
4956
* @param array $components
5057
* @param array $data
@@ -55,6 +62,7 @@ public function __construct(
5562
BackendUrlInterface $backendUrl,
5663
Images $imagesHelper,
5764
VariableConfig $variableConfig,
65+
OpenDialogUrl $openDialogUrl,
5866
$currentTreePath = 'wysiwyg',
5967
$components = [],
6068
array $data = []
@@ -63,6 +71,7 @@ public function __construct(
6371
$this->imagesHelper = $imagesHelper;
6472
$this->variableConfig = $variableConfig;
6573
$this->currentTreePath = $currentTreePath;
74+
$this->openDialogUrl = $openDialogUrl;
6675
parent::__construct($context, $uiComponentFactory, $components, $data);
6776
}
6877

@@ -82,7 +91,7 @@ public function prepare()
8291
]
8392
);
8493
$config['imageUrl'] = $this->backendUrl->getUrl(
85-
'cms/wysiwyg_images/index',
94+
$this->openDialogUrl->get(),
8695
[
8796
'current_tree_path' => $this->imagesHelper->idEncode($this->currentTreePath),
8897
'target_element_id' => self::HTML_ID_PLACEHOLDER

0 commit comments

Comments
 (0)