Skip to content

Commit 2f3c26d

Browse files
author
Ivan Gavryshko
committed
Merge remote-tracking branch 'mainline/develop' into MAGETWO-44042-issues-after-create-project
2 parents bc38381 + c743dec commit 2f3c26d

File tree

534 files changed

+7862
-4993
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

534 files changed

+7862
-4993
lines changed

.htaccess

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,13 @@
129129

130130
</IfModule>
131131

132+
############################################
133+
## workaround for Apache 2.4.6 CentOS build when working via ProxyPassMatch with HHVM (or any other)
134+
## Please, set it on virtual host configuration level
135+
136+
## SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
137+
############################################
138+
132139
<IfModule mod_rewrite.c>
133140

134141
############################################

app/bootstrap.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,15 @@
3131
require_once __DIR__ . '/autoload.php';
3232
require_once BP . '/app/functions.php';
3333

34-
if (!empty($_SERVER['MAGE_PROFILER'])) {
35-
\Magento\Framework\Profiler::applyConfig($_SERVER['MAGE_PROFILER'], BP, !empty($_REQUEST['isAjax']));
34+
if (!empty($_SERVER['MAGE_PROFILER'])
35+
&& isset($_SERVER['HTTP_ACCEPT'])
36+
&& strpos($_SERVER['HTTP_ACCEPT'], 'text/html') !== false
37+
) {
38+
\Magento\Framework\Profiler::applyConfig(
39+
$_SERVER['MAGE_PROFILER'],
40+
BP,
41+
!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest'
42+
);
3643
}
3744
if (ini_get('date.timezone') == '') {
3845
date_default_timezone_set('UTC');

app/code/Magento/Authorizenet/Controller/Directpost/Payment.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ protected function _returnCustomerQuote($cancelOrder = false, $errorMsg = '')
130130
$order = $this->_objectManager->create('Magento\Sales\Model\Order')->loadByIncrementId($incrementId);
131131
if ($order->getId()) {
132132
try {
133-
/** @var \Magento\Quote\Model\QuoteRepository $quoteRepository */
134-
$quoteRepository = $this->_objectManager->create('Magento\Quote\Model\QuoteRepository');
133+
/** @var \Magento\Quote\Api\CartRepositoryInterface $quoteRepository */
134+
$quoteRepository = $this->_objectManager->create('Magento\Quote\Api\CartRepositoryInterface');
135135
/** @var \Magento\Quote\Model\Quote $quote */
136136
$quote = $quoteRepository->get($order->getQuoteId());
137137

app/code/Magento/Authorizenet/Model/Directpost.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ class Directpost extends \Magento\Authorizenet\Model\Authorizenet implements Tra
9393
protected $storeManager;
9494

9595
/**
96-
* @var \Magento\Quote\Model\QuoteRepository
96+
* @var \Magento\Quote\Api\CartRepositoryInterface
9797
*/
9898
protected $quoteRepository;
9999

@@ -136,7 +136,7 @@ class Directpost extends \Magento\Authorizenet\Model\Authorizenet implements Tra
136136
* @param \Magento\Framework\HTTP\ZendClientFactory $httpClientFactory
137137
* @param \Magento\Sales\Model\OrderFactory $orderFactory
138138
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
139-
* @param \Magento\Quote\Model\QuoteRepository $quoteRepository
139+
* @param \Magento\Quote\Api\CartRepositoryInterface $quoteRepository
140140
* @param OrderSender $orderSender
141141
* @param \Magento\Sales\Api\TransactionRepositoryInterface $transactionRepository
142142
* @param \Magento\Framework\Model\ResourceModel\AbstractResource $resource
@@ -161,7 +161,7 @@ public function __construct(
161161
ZendClientFactory $httpClientFactory,
162162
\Magento\Sales\Model\OrderFactory $orderFactory,
163163
\Magento\Store\Model\StoreManagerInterface $storeManager,
164-
\Magento\Quote\Model\QuoteRepository $quoteRepository,
164+
\Magento\Quote\Api\CartRepositoryInterface $quoteRepository,
165165
\Magento\Sales\Model\Order\Email\Sender\OrderSender $orderSender,
166166
\Magento\Sales\Api\TransactionRepositoryInterface $transactionRepository,
167167
\Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,

app/code/Magento/Backend/Model/Session/Quote.php

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class Quote extends \Magento\Framework\Session\SessionManager
6060
/**
6161
* Sales quote repository
6262
*
63-
* @var \Magento\Quote\Model\QuoteRepository
63+
* @var \Magento\Quote\Api\CartRepositoryInterface
6464
*/
6565
protected $quoteRepository;
6666

@@ -74,6 +74,11 @@ class Quote extends \Magento\Framework\Session\SessionManager
7474
*/
7575
protected $groupManagement;
7676

77+
/**
78+
* @var \Magento\Quote\Model\QuoteFactory
79+
*/
80+
protected $quoteFactory;
81+
7782
/**
7883
* @param \Magento\Framework\App\Request\Http $request
7984
* @param \Magento\Framework\Session\SidResolverInterface $sidResolver
@@ -85,11 +90,11 @@ class Quote extends \Magento\Framework\Session\SessionManager
8590
* @param \Magento\Framework\Stdlib\Cookie\CookieMetadataFactory $cookieMetadataFactory
8691
* @param \Magento\Framework\App\State $appState
8792
* @param CustomerRepositoryInterface $customerRepository
88-
* @param \Magento\Quote\Model\QuoteRepository $quoteRepository
93+
* @param \Magento\Quote\Api\CartRepositoryInterface $quoteRepository
8994
* @param \Magento\Sales\Model\OrderFactory $orderFactory
9095
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
9196
* @param GroupManagementInterface $groupManagement
92-
* @throws \Magento\Framework\Exception\SessionException
97+
* @param \Magento\Quote\Model\QuoteFactory $quoteFactory
9398
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
9499
*/
95100
public function __construct(
@@ -103,16 +108,18 @@ public function __construct(
103108
\Magento\Framework\Stdlib\Cookie\CookieMetadataFactory $cookieMetadataFactory,
104109
\Magento\Framework\App\State $appState,
105110
CustomerRepositoryInterface $customerRepository,
106-
\Magento\Quote\Model\QuoteRepository $quoteRepository,
111+
\Magento\Quote\Api\CartRepositoryInterface $quoteRepository,
107112
\Magento\Sales\Model\OrderFactory $orderFactory,
108113
\Magento\Store\Model\StoreManagerInterface $storeManager,
109-
GroupManagementInterface $groupManagement
114+
GroupManagementInterface $groupManagement,
115+
\Magento\Quote\Model\QuoteFactory $quoteFactory
110116
) {
111117
$this->customerRepository = $customerRepository;
112118
$this->quoteRepository = $quoteRepository;
113119
$this->_orderFactory = $orderFactory;
114120
$this->_storeManager = $storeManager;
115121
$this->groupManagement = $groupManagement;
122+
$this->quoteFactory = $quoteFactory;
116123
parent::__construct(
117124
$request,
118125
$sidResolver,
@@ -137,7 +144,7 @@ public function __construct(
137144
public function getQuote()
138145
{
139146
if ($this->_quote === null) {
140-
$this->_quote = $this->quoteRepository->create();
147+
$this->_quote = $this->quoteFactory->create();
141148
if ($this->getStoreId()) {
142149
if (!$this->getQuoteId()) {
143150
$this->_quote->setCustomerGroupId($this->groupManagement->getDefaultGroup()->getId())

app/code/Magento/Backend/Test/Unit/Model/Session/QuoteTest.php

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
/**
99
* Class QuoteTest
1010
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
11+
* @SuppressWarnings(PHPMD.TooManyFields)
1112
*/
1213
class QuoteTest extends \PHPUnit_Framework_TestCase
1314
{
@@ -86,6 +87,11 @@ class QuoteTest extends \PHPUnit_Framework_TestCase
8687
*/
8788
protected $groupManagementMock;
8889

90+
/**
91+
* @var \PHPUnit_Framework_MockObject_MockObject
92+
*/
93+
protected $quoteFactoryMock;
94+
8995
/**
9096
* Set up
9197
*
@@ -122,13 +128,7 @@ protected function setUp()
122128
true,
123129
['getValue']
124130
);
125-
$this->quoteRepositoryMock = $this->getMock(
126-
'Magento\Quote\Model\QuoteRepository',
127-
['create', 'save', 'get'],
128-
[],
129-
'',
130-
false
131-
);
131+
$this->quoteRepositoryMock = $this->getMock('Magento\Quote\Api\CartRepositoryInterface');
132132

133133
$this->requestMock = $this->getMock(
134134
'Magento\Framework\App\Request\Http',
@@ -196,6 +196,8 @@ protected function setUp()
196196
false
197197
);
198198

199+
$this->quoteFactoryMock = $this->getMock('\Magento\Quote\Model\QuoteFactory', ['create'], [], '', false);
200+
199201
$this->quote = $this->getMock(
200202
'Magento\Backend\Model\Session\Quote',
201203
['getStoreId', 'getQuoteId', 'setQuoteId', 'hasCustomerId', 'getCustomerId'],
@@ -214,6 +216,7 @@ protected function setUp()
214216
'orderFactory' => $this->orderFactoryMock,
215217
'storeManager' => $this->storeManagerMock,
216218
'groupManagement' => $this->groupManagementMock,
219+
'quoteFactory' => $this->quoteFactoryMock
217220
],
218221
'',
219222
true
@@ -302,7 +305,7 @@ public function testGetQuoteWithoutQuoteId()
302305
->method('setIsSuperMode')
303306
->with(true);
304307

305-
$this->quoteRepositoryMock->expects($this->once())
308+
$this->quoteFactoryMock->expects($this->once())
306309
->method('create')
307310
->will($this->returnValue($quoteMock));
308311
$this->quoteRepositoryMock->expects($this->once())
@@ -377,7 +380,7 @@ public function testGetQuoteWithQuoteId($customerId, $quoteCustomerId, $expected
377380
->method('getCustomerId')
378381
->will($this->returnValue($quoteCustomerId));
379382

380-
$this->quoteRepositoryMock->expects($this->once())
383+
$this->quoteFactoryMock->expects($this->once())
381384
->method('create')
382385
->will($this->returnValue($quoteMock));
383386
$this->quoteRepositoryMock->expects($this->once())

app/code/Magento/Backend/view/adminhtml/layout/default.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,6 @@
6767
</container>
6868
</container>
6969
</referenceContainer>
70-
<referenceContainer name="backend.page">
71-
<block class="Magento\Framework\View\Element\Template" name="page.loader" template="Magento_Backend::admin/loader.phtml" after="-"/>
72-
</referenceContainer>
7370
<referenceContainer name="after.body.start">
7471
<block class="Magento\RequireJs\Block\Html\Head\Config" name="requirejs-config"/>
7572
<block class="Magento\Translation\Block\Html\Head\Config" name="translate-config"/>

0 commit comments

Comments
 (0)