Skip to content

Commit 5627715

Browse files
author
Mike Weis
committed
Merge branch 'develop' into FearlessKiwis-MAGETWO-51428-php_memory_limits
2 parents 5dcc618 + f553937 commit 5627715

File tree

523 files changed

+11150
-2598
lines changed

Some content is hidden

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

523 files changed

+11150
-2598
lines changed

ISSUE_TEMPLATE.md

+22-14
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,24 @@
1-
Steps to reproduce
2-
--
3-
1. Install Magento from `develop` branch.
4-
2. [Example] Add Configurable Product to the cart.
5-
3. ...
1+
<!--- Provide a general summary of the issue in the Title above -->
2+
<!--- Before adding new issues, please, check this article https://github.com/magento/magento2/wiki/Issue-reporting-guidelines-->
63

7-
Expected result
8-
--
9-
1. [Example] Configurable product added to the shopping cart.
10-
2. ...
4+
### Preconditions
5+
<!--- Provide a more detailed information of environment you use -->
6+
<!--- Magento version, tag, HEAD, etc., PHP & MySQL version, etc.. -->
7+
1.
8+
2.
119

12-
Actual result
13-
--
14-
1. [Example] Error message appears: "Cannot save quote".
15-
2. [Screenshot, logs]
16-
3. ...
10+
### Steps to reproduce
11+
<!--- Provide a set of unambiguous steps to reproduce this bug include code, if relevant -->
12+
1.
13+
2.
14+
3.
15+
16+
### Expected result
17+
<!--- Tell us what should happen -->
18+
1.
19+
20+
### Actual result
21+
<!--- Tell us what happens instead -->
22+
1. [Screenshot, logs]
23+
24+
<!--- (This may be platform independent comment) -->

app/bootstrap.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
#ini_set('display_errors', 1);
1212

1313
/* PHP version validation */
14-
if (!defined('PHP_VERSION_ID') || !(PHP_VERSION_ID >= 50600 && PHP_VERSION_ID < 50700 || PHP_VERSION_ID === 70002 || PHP_VERSION_ID >= 70006)) {
14+
if (!defined('PHP_VERSION_ID') || !(PHP_VERSION_ID >= 50600 && PHP_VERSION_ID < 50700 || PHP_VERSION_ID === 70002 || PHP_VERSION_ID === 70004 || PHP_VERSION_ID >= 70006)) {
1515
if (PHP_SAPI == 'cli') {
16-
echo 'Magento supports PHP 5.6, 7.0.2, and 7.0.6 or later. ' .
16+
echo 'Magento supports PHP 5.6, 7.0.2, 7.0.4, and 7.0.6 or later. ' .
1717
'Please read http://devdocs.magento.com/guides/v1.0/install-gde/system-requirements.html';
1818
} else {
1919
echo <<<HTML
2020
<div style="font:12px/1.35em arial, helvetica, sans-serif;">
21-
<p>Magento supports PHP 5.6, 7.0.2, and 7.0.6 or later. Please read
21+
<p>Magento supports PHP 5.6, 7.0.2, 7.0.4, and 7.0.6 or later. Please read
2222
<a target="_blank" href="http://devdocs.magento.com/guides/v1.0/install-gde/system-requirements.html">
2323
Magento System Requirements</a>.
2424
</div>

app/code/Magento/AdminNotification/Block/Grid/Renderer/Actions.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,14 @@ public function render(\Magento\Framework\DataObject $row)
4141
{
4242
$readDetailsHtml = $row->getUrl() ? '<a class="action-details" target="_blank" href="' . $row->getUrl() . '">' . __(
4343
'Read Details'
44-
) . '</a> | ' : '';
44+
) . '</a>' : '';
4545

4646
$markAsReadHtml = !$row->getIsRead() ? '<a class="action-mark" href="' . $this->getUrl(
4747
'*/*/markAsRead/',
4848
['_current' => true, 'id' => $row->getId()]
4949
) . '">' . __(
5050
'Mark as Read'
51-
) . '</a> | ' : '';
51+
) . '</a>' : '';
5252

5353
$encodedUrl = $this->_urlHelper->getEncodedUrl();
5454
return sprintf(

app/code/Magento/AdminNotification/Block/Grid/Renderer/Notice.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@ class Notice extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\Abstract
1818
public function render(\Magento\Framework\DataObject $row)
1919
{
2020
return '<span class="grid-row-title">' .
21-
$row->getTitle() .
21+
$this->escapeHtml($row->getTitle()) .
2222
'</span>' .
23-
($row->getDescription() ? '<br />' .
24-
$row->getDescription() : '');
23+
($row->getDescription() ? '<br />' . $this->escapeHtml($row->getDescription()) : '');
2524
}
2625
}

app/code/Magento/AdminNotification/composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/module-admin-notification",
33
"description": "N/A",
44
"require": {
5-
"php": "~5.6.0|7.0.2|~7.0.6",
5+
"php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
66
"magento/module-store": "100.2.*",
77
"magento/module-backend": "100.2.*",
88
"magento/module-media-storage": "100.2.*",

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

+14-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,20 @@
88
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
99
<body>
1010
<referenceContainer name="notifications">
11-
<block class="Magento\AdminNotification\Block\System\Messages" name="system_messages" as="system_messages" before="-" template="Magento_AdminNotification::system/messages.phtml"/>
12-
<block class="Magento\AdminNotification\Block\System\Messages\UnreadMessagePopup" name="unread_system_messages" as="unread_system_messages" after="system_messages" template="Magento_AdminNotification::system/messages/popup.phtml"/>
13-
<block class="Magento\AdminNotification\Block\Window" name="notification_window" as="notification_window" acl="Magento_AdminNotification::show_toolbar" template="notification/window.phtml"/>
11+
<block class="Magento\AdminNotification\Block\System\Messages"
12+
name="system_messages"
13+
as="system_messages"
14+
before="-"
15+
template="Magento_AdminNotification::system/messages.phtml"/>
16+
<block class="Magento\AdminNotification\Block\System\Messages\UnreadMessagePopup"
17+
name="unread_system_messages"
18+
as="unread_system_messages"
19+
template="Magento_AdminNotification::system/messages/popup.phtml"/>
20+
<block class="Magento\AdminNotification\Block\Window"
21+
name="notification_window"
22+
as="notification_window"
23+
acl="Magento_AdminNotification::show_toolbar"
24+
template="notification/window.phtml"/>
1425
</referenceContainer>
1526
<referenceContainer name="header">
1627
<block class="Magento\AdminNotification\Block\ToolbarEntry" name="notification.messages" before="user" template="toolbar_entry.phtml"/>

app/code/Magento/AdvancedPricingImportExport/composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/module-advanced-pricing-import-export",
33
"description": "N/A",
44
"require": {
5-
"php": "~5.6.0|7.0.2|~7.0.6",
5+
"php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
66
"magento/module-catalog": "101.1.*",
77
"magento/module-catalog-inventory": "100.2.*",
88
"magento/module-eav": "100.2.*",

app/code/Magento/Authorization/composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/module-authorization",
33
"description": "Authorization module provides access to Magento ACL functionality.",
44
"require": {
5-
"php": "~5.6.0|7.0.2|~7.0.6",
5+
"php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
66
"magento/module-backend": "100.2.*",
77
"magento/framework": "100.2.*"
88
},

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

+4
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Magento\Framework\Registry;
1616
use Magento\Payment\Model\IframeConfigProvider;
1717
use Magento\Quote\Api\CartManagementInterface;
18+
use Magento\Framework\Exception\LocalizedException;
1819

1920
/**
2021
* Class Place
@@ -125,6 +126,9 @@ protected function placeCheckoutOrder()
125126
'action' => $this
126127
]
127128
);
129+
} catch (LocalizedException $exception) {
130+
$result->setData('error', true);
131+
$result->setData('error_messages', $exception->getMessage());
128132
} catch (\Exception $exception) {
129133
$result->setData('error', true);
130134
$result->setData('error_messages', __('Unable to place order. Please try again later.'));

app/code/Magento/Authorizenet/composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/module-authorizenet",
33
"description": "N/A",
44
"require": {
5-
"php": "~5.6.0|7.0.2|~7.0.6",
5+
"php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
66
"magento/module-sales": "100.2.*",
77
"magento/module-store": "100.2.*",
88
"magento/module-quote": "100.2.*",

app/code/Magento/Backend/Block/Page/System/Config/Robots/Reset.php

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
/**
1414
* "Reset to Defaults" button renderer
1515
*
16+
* @deprecated
1617
* @author Magento Core Team <core@magentocommerce.com>
1718
*/
1819
class Reset extends \Magento\Config\Block\System\Config\Form\Field

app/code/Magento/Backend/Test/Unit/Block/Page/System/Config/Robots/ResetTest.php

+5
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
*/
1010
namespace Magento\Backend\Test\Unit\Block\Page\System\Config\Robots;
1111

12+
/**
13+
* Class ResetTest
14+
* @deprecated
15+
* @package Magento\Backend\Test\Unit\Block\Page\System\Config\Robots
16+
*/
1217
class ResetTest extends \PHPUnit_Framework_TestCase
1318
{
1419
/**

app/code/Magento/Backend/composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/module-backend",
33
"description": "N/A",
44
"require": {
5-
"php": "~5.6.0|7.0.2|~7.0.6",
5+
"php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
66
"magento/module-store": "100.2.*",
77
"magento/module-directory": "100.2.*",
88
"magento/module-developer": "100.2.*",

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

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<head>
1010
<title>Magento Admin</title>
1111
<meta name="viewport" content="width=1024"/>
12+
<meta name="format-detection" content="telephone=no"/>
1213
<link src="requirejs/require.js"/>
1314
<css src="extjs/resources/css/ext-all.css"/>
1415
<css src="extjs/resources/css/ytheme-magento.css"/>

app/code/Magento/Backend/view/adminhtml/templates/system/shipping/applicable_country.phtml

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ CountryModel.prototype = {
3737
var showMethodElement = $(applyCountryElement.id.replace(/sallowspecific/, 'showmethod'));
3838
//var specifErrMsgElement = $(applyCountryElement.id.replace(/sallowspecific/, 'specificerrmsg'));
3939
if (specifCountryElement) {
40-
if (applyCountryElement.value == 1) {
40+
if (applyCountryElement.value == 1 && !specifCountryElement.hasAttribute('disabled')) {
4141
//if specific country element selected
4242
specifCountryElement.enable();
4343
if (showMethodElement) {

app/code/Magento/Backup/composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/module-backup",
33
"description": "N/A",
44
"require": {
5-
"php": "~5.6.0|7.0.2|~7.0.6",
5+
"php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
66
"magento/module-store": "100.2.*",
77
"magento/module-backend": "100.2.*",
88
"magento/module-cron": "100.2.*",

app/code/Magento/Braintree/Model/Report/Row/TransactionMap.php

+4
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,13 @@ public function setCustomAttribute($attributeCode, $attributeValue)
115115
*/
116116
public function getCustomAttributes()
117117
{
118+
$shouldBeLocalized = ['paymentInstrumentType', 'type', 'status'];
118119
$output = [];
119120
foreach ($this->getMappedValues() as $key => $value) {
120121
$attribute = $this->attributeValueFactory->create();
122+
if(in_array($key, $shouldBeLocalized)) {
123+
$value = __($value);
124+
}
121125
$output[] = $attribute->setAttributeCode($key)->setValue($value);
122126
}
123127
return $output;

app/code/Magento/Braintree/Model/Ui/ConfigProvider.php

-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ public function getConfig()
7979
'payment' => [
8080
self::CODE => [
8181
'isActive' => $this->config->isActive(),
82-
'isSingleUse' => !$isPayPalActive,
8382
'clientToken' => $this->getClientToken(),
8483
'ccTypesMapper' => $this->config->getCctypesMapper(),
8584
'sdkUrl' => $this->config->getSdkUrl(),

app/code/Magento/Braintree/Test/Unit/Model/Report/TransactionMapTest.php

+61-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
use Magento\Braintree\Model\Report\Row\TransactionMap;
1212
use Magento\Framework\Api\AttributeValue;
1313
use Magento\Framework\Api\AttributeValueFactory;
14+
use Magento\Framework\Phrase;
15+
use Magento\Framework\Phrase\RendererInterface;
1416
use Magento\Store\Model\StoreManagerInterface;
1517

1618
/**
@@ -30,6 +32,16 @@ class TransactionMapTest extends \PHPUnit_Framework_TestCase
3032
*/
3133
private $attributeValueFactoryMock;
3234

35+
/**
36+
* @var RendererInterface|\PHPUnit_Framework_MockObject_MockObject
37+
*/
38+
private $defaultRenderer;
39+
40+
/**
41+
* @var RendererInterface|\PHPUnit_Framework_MockObject_MockObject
42+
*/
43+
private $rendererMock;
44+
3345
/**
3446
* Setup
3547
*/
@@ -39,6 +51,9 @@ protected function setUp()
3951
->setMethods(['create'])
4052
->disableOriginalConstructor()
4153
->getMock();
54+
$this->defaultRenderer = Phrase::getRenderer();
55+
$this->rendererMock = $this->getMockBuilder(RendererInterface::class)
56+
->getMock();
4257
}
4358

4459
/**
@@ -65,6 +80,8 @@ public function testGetCustomAttributes($transaction)
6580
$this->transactionStub
6681
);
6782

83+
Phrase::setRenderer($this->rendererMock);
84+
6885
/** @var AttributeValue[] $result */
6986
$result = $map->getCustomAttributes();
7087

@@ -77,6 +94,31 @@ public function testGetCustomAttributes($transaction)
7794
$result[6]->getValue()
7895
);
7996
$this->assertEquals(implode(', ', $transaction['refundIds']), $result[11]->getValue());
97+
$this->assertEquals($transaction['merchantAccountId'], $result[1]->getValue());
98+
$this->assertEquals($transaction['orderId'], $result[2]->getValue());
99+
$this->assertEquals($transaction['amount'], $result[7]->getValue());
100+
$this->assertEquals($transaction['processorSettlementResponseCode'], $result[8]->getValue());
101+
$this->assertEquals($transaction['processorSettlementResponseText'], $result[10]->getValue());
102+
$this->assertEquals($transaction['settlementBatchId'], $result[12]->getValue());
103+
$this->assertEquals($transaction['currencyIsoCode'], $result[13]->getValue());
104+
105+
$this->rendererMock->expects($this->at(0))
106+
->method('render')
107+
->with([$transaction['paymentInstrumentType']])
108+
->willReturn('Credit card');
109+
$this->assertEquals('Credit card', $result[3]->getValue()->render());
110+
111+
$this->rendererMock->expects($this->at(0))
112+
->method('render')
113+
->with([$transaction['type']])
114+
->willReturn('Sale');
115+
$this->assertEquals('Sale', $result[5]->getValue()->render());
116+
117+
$this->rendererMock->expects($this->at(0))
118+
->method('render')
119+
->with([$transaction['status']])
120+
->willReturn('Pending for settlement');
121+
$this->assertEquals('Pending for settlement', $result[9]->getValue()->render());
80122
}
81123

82124
/**
@@ -90,9 +132,27 @@ public function getConfigDataProvider()
90132
'id' => 1,
91133
'createdAt' => new \DateTime(),
92134
'paypalDetails' => new PayPalDetails(['paymentId' => 10]),
93-
'refundIds' => [1, 2, 3, 4, 5]
135+
'refundIds' => [1, 2, 3, 4, 5],
136+
'merchantAccountId' => 'MerchantId',
137+
'orderId' => 1,
138+
'paymentInstrumentType' => 'credit_card',
139+
'type' => 'sale',
140+
'amount' => '$19.99',
141+
'processorSettlementResponseCode' => 1,
142+
'status' => 'pending_for_settlement',
143+
'processorSettlementResponseText' => 'sample text',
144+
'settlementBatchId' => 2,
145+
'currencyIsoCode' => 'USD'
94146
]
95147
]
96148
];
97149
}
150+
151+
/**
152+
* @return void
153+
*/
154+
protected function tearDown()
155+
{
156+
Phrase::setRenderer($this->defaultRenderer);
157+
}
98158
}

app/code/Magento/Braintree/Test/Unit/Model/Report/TransactionsCollectionTest.php

+38
Original file line numberDiff line numberDiff line change
@@ -184,4 +184,42 @@ public function testGetItemsWithNullLimit()
184184
$this->assertEquals(TransactionsCollection::TRANSACTION_MAXIMUM_COUNT, count($items));
185185
$this->assertInstanceOf(DocumentInterface::class, $items[1]);
186186
}
187+
188+
/**
189+
* Add fields to filter
190+
*
191+
* @dataProvider addToFilterDataProvider
192+
*/
193+
public function testAddToFilter($field, $condition, $filterMapperCall, $expectedCondition)
194+
{
195+
$this->filterMapperMock->expects(static::exactly($filterMapperCall))
196+
->method('getFilter')
197+
->with($field, $expectedCondition)
198+
->willReturn(new BraintreeSearchNodeStub());
199+
200+
$collection = new TransactionsCollection(
201+
$this->entityFactoryMock,
202+
$this->braintreeAdapterMock,
203+
$this->filterMapperMock
204+
);
205+
206+
static::assertInstanceOf(
207+
TransactionsCollection::class,
208+
$collection->addFieldToFilter($field, $condition)
209+
);
210+
}
211+
212+
/**
213+
* addToFilter DataProvider
214+
*
215+
* @return array
216+
*/
217+
public function addToFilterDataProvider()
218+
{
219+
return [
220+
['orderId', ['like' => 1], 1, ['like' => 1]],
221+
['type', 'sale', 1, ['eq' => 'sale']],
222+
[['type', 'orderId'], [], 0, []],
223+
];
224+
}
187225
}

app/code/Magento/Braintree/Test/Unit/Model/Ui/ConfigProviderTest.php

-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ public function getConfigDataProvider()
154154
'payment' => [
155155
ConfigProvider::CODE => [
156156
'isActive' => true,
157-
'isSingleUse' => false,
158157
'clientToken' => self::CLIENT_TOKEN,
159158
'ccTypesMapper' => ['visa' => 'VI', 'american-express' => 'AE'],
160159
'sdkUrl' => self::SDK_URL,

0 commit comments

Comments
 (0)