Skip to content

Commit 660eb75

Browse files
committed
Fix isse with default selected tree_path
1 parent 40a7876 commit 660eb75

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

app/code/Magento/Cms/Model/Wysiwyg/Gallery/DefaultConfigProvider.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ public function getConfig(\Magento\Framework\DataObject $config) : \Magento\Fram
7878
if (is_string($this->currentTreePath)) {
7979
$fileBrowserUrlParams = [
8080
'current_tree_path' => $this->imagesHelper->idEncode($this->currentTreePath),
81+
'tree_path' => $this->currentTreePath . '&'
82+
8183
];
8284
}
8385

app/code/Magento/Ui/view/base/web/js/form/element/image-uploader.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ define([
7878
'/type/image/?isAjax=true';
7979

8080
if (this.mediaGallery.initialOpenSubpath) {
81+
openDialogUrl += '/tree_path/' + this.mediaGallery.initialOpenSubpath;
8182
openDialogUrl += '&current_tree_path=' + Base64.mageEncode(this.mediaGallery.initialOpenSubpath);
8283
}
8384

lib/web/mage/adminhtml/browser.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ define([
2121
windowId: 'modal_dialog_message',
2222
modalLoaded: false,
2323
targetElementId: false,
24+
currentTreePath: '',
2425

2526
/**
2627
* @return {Number}
@@ -96,6 +97,7 @@ define([
9697
* @param {String} url
9798
*/
9899
setTargetElementId: function (options, url) {
100+
this.currentTreePath = url.match(/\/tree_path\/([\s\S].*?)(&|%26)/)[1];
99101
this.targetElementId = options && options.targetElementId ?
100102
options.targetElementId
101103
: url.match(/\/target_element_id\/([\s\S].*?)\//)[1];

0 commit comments

Comments
 (0)