Skip to content

Commit 728de46

Browse files
authored
ENGCOM-5727: #23966: WYSIWYG image upload dialog hangs up. #24333
2 parents 5dd29c8 + cb97520 commit 728de46

File tree

6 files changed

+19
-21
lines changed

6 files changed

+19
-21
lines changed

app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGProductTest.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
<description value="Admin should be able to add image to WYSIWYG Editor on Product Page"/>
1717
<severity value="CRITICAL"/>
1818
<testCaseId value="MAGETWO-84375"/>
19-
<skip>
20-
<issueId value="MC-17232"/>
21-
</skip>
2219
</annotations>
2320
<before>
2421
<actionGroup ref="LoginActionGroup" stepKey="login"/>
@@ -78,6 +75,8 @@
7875
<waitForLoadingMaskToDisappear stepKey="waitForLoading13"/>
7976
<see selector="{{ProductShortDescriptionWYSIWYGToolbarSection.CreateFolder}}" userInput="Create Folder" stepKey="seeCreateFolderBtn2" />
8077
<waitForLoadingMaskToDisappear stepKey="waitForLoading14"/>
78+
<click userInput="Storage Root" stepKey="clickOnRootFolder" />
79+
<waitForLoadingMaskToDisappear stepKey="waitForLoading15"/>
8180
<dontSeeElement selector="{{ProductShortDescriptionWYSIWYGToolbarSection.InsertFile}}" stepKey="dontSeeAddSelectedBtn3" />
8281
<attachFile selector="{{ProductShortDescriptionWYSIWYGToolbarSection.BrowseUploadImage}}" userInput="{{ImageUpload3.value}}" stepKey="uploadImage3"/>
8382
<waitForLoadingMaskToDisappear stepKey="waitForFileUpload3"/>

app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGBlockTest.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
<description value="Admin should be able to add image to WYSIWYG content of Block"/>
1717
<severity value="CRITICAL"/>
1818
<testCaseId value="MAGETWO-84376"/>
19-
<skip>
20-
<issueId value="MC-17232"/>
21-
</skip>
2219
</annotations>
2320
<before>
2421
<createData entity="_defaultCmsPage" stepKey="createCMSPage" />

app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGCMSTest.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
<description value="Admin should be able to add image to WYSIWYG content of CMS Page"/>
1717
<severity value="CRITICAL"/>
1818
<testCaseId value="MAGETWO-85825"/>
19-
<skip>
20-
<issueId value="MC-17232"/>
21-
</skip>
2219
</annotations>
2320
<before>
2421
<createData entity="_defaultCmsPage" stepKey="createCMSPage" />

app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddImageToWYSIWYGNewsletterTest.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
<description value="Admin should be able to add image to WYSIWYG content Newsletter"/>
1717
<severity value="CRITICAL"/>
1818
<testCaseId value="MAGETWO-84377"/>
19-
<skip>
20-
<issueId value="MC-17233"/>
21-
</skip>
2219
</annotations>
2320
<before>
2421
<actionGroup ref="LoginActionGroup" stepKey="login"/>

lib/web/mage/adminhtml/browser.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,11 @@ define([
5252
content = '<div class="popup-window" id="' + windowId + '"></div>',
5353
self = this;
5454

55-
if (this.modalLoaded === true) {
56-
if (options && typeof options.closed !== 'undefined') {
55+
if (this.modalLoaded === true
56+
&& options
57+
&& self.targetElementId
58+
&& self.targetElementId === options.targetElementId) {
59+
if (typeof options.closed !== 'undefined') {
5760
this.modal.modal('option', 'closed', options.closed);
5861
}
5962
this.modal.modal('openModal');
@@ -85,6 +88,7 @@ define([
8588
}).done(function (data) {
8689
self.modal.html(data).trigger('contentUpdated');
8790
self.modalLoaded = true;
91+
self.targetElementId = options.targetElementId;
8892
});
8993
},
9094

lib/web/mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@ define([
377377
var typeTitle = this.translate('Select Images'),
378378
storeId = this.config['store_id'] !== null ? this.config['store_id'] : 0,
379379
frameDialog = jQuery('div.mce-container[role="dialog"]'),
380+
self = this,
380381
wUrl = this.config['files_browser_window_url'] +
381382
'target_element_id/' + this.getId() + '/' +
382383
'store/' + storeId + '/';
@@ -393,14 +394,17 @@ define([
393394

394395
require(['mage/adminhtml/browser'], function () {
395396
MediabrowserUtility.openDialog(wUrl, false, false, typeTitle, {
396-
/**
397-
* Closed.
398-
*/
399-
closed: function () {
400-
frameDialog.show();
401-
jQuery('#mce-modal-block').show();
397+
/**
398+
* Closed.
399+
*/
400+
closed: function () {
401+
frameDialog.show();
402+
jQuery('#mce-modal-block').show();
403+
},
404+
405+
targetElementId: self.activeEditor() ? self.activeEditor().id : null
402406
}
403-
});
407+
);
404408
});
405409
},
406410

0 commit comments

Comments
 (0)