Skip to content

Commit e7f5b9f

Browse files
author
Korshenko, Olexii(okorshenko)
committed
Merge pull request #279 from magento-extensibility/bugfix-2.0.1
[Extensibility] 2.0.1 bug fixes
2 parents f329397 + 151b768 commit e7f5b9f

File tree

7 files changed

+64
-332
lines changed

7 files changed

+64
-332
lines changed

app/code/Magento/PageCache/Model/App/FrontController/MessageBox.php

Lines changed: 0 additions & 100 deletions
This file was deleted.

app/code/Magento/PageCache/Test/Unit/Model/App/FrontController/MessageBoxTest.php

Lines changed: 0 additions & 148 deletions
This file was deleted.

app/code/Magento/PageCache/etc/frontend/di.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
<type name="Magento\Framework\App\FrontControllerInterface">
1010
<plugin name="front-controller-builtin-cache" type="Magento\PageCache\Model\App\FrontController\BuiltinPlugin"/>
1111
<plugin name="front-controller-varnish-cache" type="Magento\PageCache\Model\App\FrontController\VarnishPlugin"/>
12-
<plugin name="front-controller-message-box" type="Magento\PageCache\Model\App\FrontController\MessageBox" sortOrder="0"/>
1312
</type>
1413
<type name="Magento\Framework\Controller\ResultInterface">
1514
<plugin name="result-builtin-cache" type="Magento\PageCache\Model\Controller\Result\BuiltinPlugin"/>

app/code/Magento/PageCache/view/frontend/web/js/page-cache.js

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -51,28 +51,6 @@ define([
5151
return elements;
5252
};
5353

54-
/**
55-
* MsgBox Widget checks if message box is displayed and sets cookie
56-
*/
57-
$.widget('mage.msgBox', {
58-
options: {
59-
msgBoxCookieName: 'message_box_display',
60-
msgBoxSelector: '.main div.messages'
61-
},
62-
63-
/**
64-
* Creates widget 'mage.msgBox'
65-
* @private
66-
*/
67-
_create: function () {
68-
if ($.mage.cookies.get(this.options.msgBoxCookieName)) {
69-
$.mage.cookies.clear(this.options.msgBoxCookieName);
70-
} else {
71-
$(this.options.msgBoxSelector).hide();
72-
}
73-
}
74-
});
75-
7654
/**
7755
* FormKey Widget - this widget is generating from key, saves it to cookie and
7856
*/
@@ -272,14 +250,12 @@ define([
272250

273251
domReady(function () {
274252
$('body')
275-
.msgBox()
276253
.formKey();
277254
});
278255

279256
return {
280257
'pageCache': $.mage.pageCache,
281-
'formKey': $.mage.formKey,
282-
'msgBox': $.mage.msgBox
258+
'formKey': $.mage.formKey
283259
};
284260

285261
/**

dev/tests/js/jasmine/tests/app/code/Magento/PageCache/frontend/js/page-cache.test.js

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -64,64 +64,6 @@ define([
6464
});
6565
});
6666

67-
describe('Testing msgBox Widget', function () {
68-
var wdContainer,
69-
msgCookieName,
70-
msgContainer;
71-
72-
beforeEach(function () {
73-
wdContainer = $('<div />');
74-
msgContainer = $('<div />');
75-
msgCookieName = 'FAKE_COOKIE';
76-
});
77-
78-
afterEach(function () {
79-
$(wdContainer).remove();
80-
$(msgContainer).remove();
81-
});
82-
83-
it('widget extends jQuery object', function () {
84-
expect($.fn.msgBox).toBeDefined();
85-
});
86-
87-
it('widget gets options', function () {
88-
wdContainer.msgBox({
89-
'msgBoxCookieName': msgCookieName
90-
});
91-
expect(wdContainer.msgBox('option', 'msgBoxCookieName')).toBe('FAKE_COOKIE');
92-
});
93-
94-
it('widget disables cookie if it exist', function () {
95-
spyOn($.mage.cookies, 'get').and.returnValue('FAKE_MAGE_COOKIE');
96-
spyOn($.mage.cookies, 'clear');
97-
98-
wdContainer.msgBox({
99-
'msgBoxSelector': msgContainer
100-
});
101-
102-
expect($.mage.cookies.get).toHaveBeenCalled();
103-
expect($.mage.cookies.clear).toHaveBeenCalled();
104-
});
105-
106-
it('widget disables messageBox if cookie not exist', function () {
107-
spyOn($.mage.cookies, 'get');
108-
109-
wdContainer.msgBox({
110-
'msgBoxSelector': msgContainer
111-
});
112-
113-
expect($.mage.cookies.get).toHaveBeenCalled();
114-
expect(msgContainer.is(':hidden')).toBeTruthy();
115-
});
116-
117-
it('widget exist on load on body', function (done) {
118-
$(function () {
119-
expect($('body').data('mageMsgBox')).toBeDefined();
120-
done();
121-
});
122-
});
123-
});
124-
12567
describe('Testing FormKey Widget', function () {
12668
var wdContainer,
12769
msgCookieName,

lib/internal/Magento/Framework/App/ObjectManager/Environment/Developer.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ public function getObjectManagerConfigLoader()
6262
*/
6363
public function configureObjectManager(ConfigInterface $diConfig, &$sharedInstances)
6464
{
65+
$originalSharedInstances = $sharedInstances;
6566
$objectManager = ObjectManager::getInstance();
6667
$sharedInstances['Magento\Framework\ObjectManager\ConfigLoaderInterface'] = $objectManager
6768
->get('Magento\Framework\App\ObjectManager\ConfigLoader');
@@ -80,5 +81,9 @@ public function configureObjectManager(ConfigInterface $diConfig, &$sharedInstan
8081
$diConfig->setInterceptionConfig(
8182
$objectManager->get('Magento\Framework\Interception\Config\Config')
8283
);
84+
/** Reset the shared instances once interception config is set so classes can be intercepted if necessary */
85+
$sharedInstances = $originalSharedInstances;
86+
$sharedInstances['Magento\Framework\ObjectManager\ConfigLoaderInterface'] = $objectManager
87+
->get('Magento\Framework\App\ObjectManager\ConfigLoader');
8388
}
8489
}

0 commit comments

Comments
 (0)