Skip to content

Commit 539c630

Browse files
Merge branch 'corrected-media-gallery-url' of github.com:sivaschenko/magento2-page-builder into 422_adding-conditions-combination-to-conditions-filter-fix
2 parents 8ecb326 + a90da42 commit 539c630

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@
88

99
use Magento\Backend\Model\UrlInterface as BackendUrlInterface;
1010
use Magento\Cms\Helper\Wysiwyg\Images;
11+
use Magento\Framework\App\ObjectManager;
1112
use Magento\Framework\View\Element\UiComponentFactory;
1213
use Magento\Framework\View\Element\UiComponent\ContextInterface;
14+
use Magento\Ui\Component\Form\Element\DataType\Media\OpenDialogUrl;
1315
use Magento\Variable\Model\Variable\Config as VariableConfig;
1416

1517
/**
@@ -39,12 +41,18 @@ class HtmlCode extends \Magento\Ui\Component\Form\Field
3941
*/
4042
private $currentTreePath;
4143

44+
/**
45+
* @var OpenDialogUrl
46+
*/
47+
private $openDialogUrl;
48+
4249
/**
4350
* @param ContextInterface $context
4451
* @param UiComponentFactory $uiComponentFactory
4552
* @param BackendUrlInterface $backendUrl
4653
* @param Images $imagesHelper
4754
* @param VariableConfig $variableConfig
55+
* @param OpenDialogUrl|null $openDialogUrl
4856
* @param string $currentTreePath
4957
* @param array $components
5058
* @param array $data
@@ -55,6 +63,7 @@ public function __construct(
5563
BackendUrlInterface $backendUrl,
5664
Images $imagesHelper,
5765
VariableConfig $variableConfig,
66+
OpenDialogUrl $openDialogUrl = null,
5867
$currentTreePath = 'wysiwyg',
5968
$components = [],
6069
array $data = []
@@ -63,6 +72,7 @@ public function __construct(
6372
$this->imagesHelper = $imagesHelper;
6473
$this->variableConfig = $variableConfig;
6574
$this->currentTreePath = $currentTreePath;
75+
$this->openDialogUrl = $openDialogUrl ?: ObjectManager::getInstance()->get(OpenDialogUrl::class);
6676
parent::__construct($context, $uiComponentFactory, $components, $data);
6777
}
6878

@@ -82,7 +92,7 @@ public function prepare()
8292
]
8393
);
8494
$config['imageUrl'] = $this->backendUrl->getUrl(
85-
'cms/wysiwyg_images/index',
95+
$this->openDialogUrl->get(),
8696
[
8797
'current_tree_path' => $this->imagesHelper->idEncode($this->currentTreePath),
8898
'target_element_id' => self::HTML_ID_PLACEHOLDER

0 commit comments

Comments
 (0)