Skip to content

Commit 1d674e5

Browse files
author
Yevhen Miroshnychenko
committed
Merge branch 'develop' into MAGETWO-63381
2 parents fd02a30 + a005167 commit 1d674e5

File tree

446 files changed

+24165
-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.

446 files changed

+24165
-4993
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ addons:
99
- postfix
1010
language: php
1111
php:
12-
- 5.6
12+
- 5.6.29
1313
- 7.0
1414
env:
1515
global:

README.md

Lines changed: 6 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -3,61 +3,14 @@
33
<h2>Welcome</h2>
44
Welcome to Magento 2 installation! We're glad you chose to install Magento 2, a cutting edge, feature-rich eCommerce solution that gets results.
55

6-
The installation instructions that used to be here are now published on our GitHub site. Use the information on this page to get started or go directly to the <a href="http://devdocs.magento.com/guides/v2.0/install-gde/bk-install-guide.html" target="_blank">guide</a>.
6+
## Magento system requirements
7+
[Magento system requirements](http://devdocs.magento.com/magento-system-requirements.html)
78

8-
<h2>New to Magento? Need some help?</h2>
9-
If you're not sure about the following, you probably need a little help before you start installing the Magento software:
9+
## Install Magento
10+
To install Magento, see either:
1011

11-
* Is the Magento software <a href="http://devdocs.magento.com/guides/v2.0/install-gde/basics/basics_magento-installed.html">installed already</a>?
12-
* What's a <a href="http://devdocs.magento.com/guides/v2.0/install-gde/basics/basics_login.html">terminal, command prompt, or Secure Shell (ssh)</a>?
13-
* Where's my <a href="http://devdocs.magento.com/guides/v2.0/install-gde/basics/basics_login.html">Magento server</a> and how do I access it?
14-
* What's <a href="http://devdocs.magento.com/guides/v2.0/install-gde/basics/basics_software.html">PHP</a>?
15-
* What's <a href="http://devdocs.magento.com/guides/v2.0/install-gde/basics/basics_software.html">Apache</a>?
16-
* What's <a href="http://devdocs.magento.com/guides/v2.0/install-gde/basics/basics_software.html">MySQL</a>?
17-
18-
<h2>Step 1: Verify your prerequisites</h2>
19-
20-
Use the following table to verify you have the correct prerequisites to install the Magento software.
21-
22-
<table>
23-
<tbody>
24-
<tr>
25-
<th>Prerequisite</th>
26-
<th>How to check</th>
27-
<th>For more information</th>
28-
</tr>
29-
<tr>
30-
<td>Apache 2.2 or 2.4</td>
31-
<td>Ubuntu: <code>apache2 -v</code><br>
32-
CentOS: <code>httpd -v</code></td>
33-
<td><a href="http://devdocs.magento.com/guides/v2.0/install-gde/prereq/apache.html">Apache</a></td>
34-
</tr>
35-
<tr>
36-
<td>PHP 5.6.x, 7.0.2, 7.0.4 or 7.0.6</td>
37-
<td><code>php -v</code></td>
38-
<td><a href="http://devdocs.magento.com/guides/v2.0/install-gde/prereq/php-ubuntu.html">PHP Ubuntu</a><br><a href="http://devdocs.magento.com/guides/v2.0/install-gde/prereq/php-centos.html">PHP CentOS</a></td>
39-
</tr>
40-
<tr><td>MySQL 5.6.x</td>
41-
<td><code>mysql -u [root user name] -p</code></td>
42-
<td><a href="http://devdocs.magento.com/guides/v2.0/install-gde/prereq/mysql.html">MySQL</a></td>
43-
</tr>
44-
</tbody>
45-
</table>
46-
47-
<h2>Step 2: Prepare to install</h2>
48-
49-
After verifying your prerequisites, perform the following tasks in order to prepare to install the Magento software.
50-
51-
1. <a href="http://devdocs.magento.com/guides/v2.0/install-gde/install/composer-clone.html#instgde-prereq-compose-install">Install Composer</a>
52-
2. <a href="http://devdocs.magento.com/guides/v2.0/install-gde/install/composer-clone.html#instgde-prereq-compose-clone">Clone the Magento repository</a>
53-
54-
<h2>Step 3: Install and verify the installation</h2>
55-
56-
1. <a href="http://devdocs.magento.com/guides/v2.0/install-gde/install/prepare-install.html">Update installation dependencies</a>
57-
2. Install Magento:
58-
* <a href="http://devdocs.magento.com/guides/v2.0/install-gde/install/install-web.html">Install Magento software using the web interface</a>
59-
* <a href="http://devdocs.magento.com/guides/v2.0/install-gde/install/install-cli.html">Install Magento software using the command line</a>
60-
2. <a href="http://devdocs.magento.com/guides/v2.0/install-gde/install/verify.html">Verify the installation</a>
12+
* [Magento DevBox](https://magento.com/tech-resources/download), the easiest way to get started with Magento.
13+
* [Installation guide](http://devdocs.magento.com/guides/v2.0/install-gde/bk-install-guide.html)
6114

6215
<h2>Contributing to the Magento 2 code base</h2>
6316
Contributions can take the form of new components or features, changes to existing features, tests, documentation (such as developer guides, user guides, examples, or specifications), bug fixes, optimizations, or just good suggestions.

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

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
use Magento\Payment\Model\IframeConfigProvider;
1717
use Magento\Quote\Api\CartManagementInterface;
1818
use Magento\Framework\Exception\LocalizedException;
19+
use Psr\Log\LoggerInterface;
20+
use Magento\Framework\App\ObjectManager;
1921

2022
/**
2123
* Class Place
@@ -44,26 +46,36 @@ class Place extends Payment
4446
*/
4547
protected $jsonHelper;
4648

49+
/**
50+
* Logger for exception details
51+
*
52+
* @var LoggerInterface
53+
*/
54+
private $logger;
55+
4756
/**
4857
* @param Context $context
4958
* @param Registry $coreRegistry
5059
* @param DataFactory $dataFactory
5160
* @param CartManagementInterface $cartManagement
5261
* @param Onepage $onepageCheckout
5362
* @param JsonHelper $jsonHelper
63+
* @param LoggerInterface|null $logger
5464
*/
5565
public function __construct(
5666
Context $context,
5767
Registry $coreRegistry,
5868
DataFactory $dataFactory,
5969
CartManagementInterface $cartManagement,
6070
Onepage $onepageCheckout,
61-
JsonHelper $jsonHelper
71+
JsonHelper $jsonHelper,
72+
LoggerInterface $logger = null
6273
) {
6374
$this->eventManager = $context->getEventManager();
6475
$this->cartManagement = $cartManagement;
6576
$this->onepageCheckout = $onepageCheckout;
6677
$this->jsonHelper = $jsonHelper;
78+
$this->logger = $logger ?: ObjectManager::getInstance()->get(LoggerInterface::class);
6779
parent::__construct($context, $coreRegistry, $dataFactory);
6880
}
6981

@@ -127,9 +139,11 @@ protected function placeCheckoutOrder()
127139
]
128140
);
129141
} catch (LocalizedException $exception) {
142+
$this->logger->critical($exception);
130143
$result->setData('error', true);
131144
$result->setData('error_messages', $exception->getMessage());
132145
} catch (\Exception $exception) {
146+
$this->logger->critical($exception);
133147
$result->setData('error', true);
134148
$result->setData(
135149
'error_messages',

app/code/Magento/Authorizenet/Test/Unit/Controller/Directpost/Payment/PlaceTest.php

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use Magento\Payment\Model\IframeConfigProvider;
2121
use Magento\Quote\Api\CartManagementInterface;
2222
use Magento\Quote\Model\Quote;
23+
use Magento\Framework\Exception\LocalizedException;
2324

2425
/**
2526
* Class PlaceTest
@@ -94,6 +95,11 @@ class PlaceTest extends \PHPUnit_Framework_TestCase
9495
*/
9596
protected $quoteMock;
9697

98+
/**
99+
* @var \PHPUnit_Framework_MockObject_MockObject
100+
*/
101+
private $loggerMock;
102+
97103
/**
98104
* @var CheckoutSession|\PHPUnit_Framework_MockObject_MockObject
99105
*/
@@ -152,6 +158,9 @@ protected function setUp()
152158
->getMockBuilder(\Magento\Framework\App\Response\Http::class)
153159
->disableOriginalConstructor()
154160
->getMockForAbstractClass();
161+
$this->loggerMock = $this
162+
->getMockBuilder(\Psr\Log\LoggerInterface::class)
163+
->getMock();
155164

156165
$this->objectManager = new ObjectManager($this);
157166
$this->placeOrderController = $this->objectManager->getObject(
@@ -165,6 +174,7 @@ protected function setUp()
165174
'cartManagement' => $this->cartManagementMock,
166175
'onepageCheckout' => $this->onepageCheckout,
167176
'jsonHelper' => $this->jsonHelperMock,
177+
'logger' => $this->loggerMock,
168178
]
169179
);
170180
}
@@ -214,13 +224,15 @@ public function testExecute(
214224
* @param $controller
215225
* @param $quoteId
216226
* @param $result
227+
* @param \Exception $exception Exception to check
217228
* @dataProvider textExecuteFailedPlaceOrderDataProvider
218229
*/
219230
public function testExecuteFailedPlaceOrder(
220231
$paymentMethod,
221232
$controller,
222233
$quoteId,
223-
$result
234+
$result,
235+
$exception
224236
) {
225237
$this->requestMock->expects($this->at(0))
226238
->method('getParam')
@@ -238,7 +250,11 @@ public function testExecuteFailedPlaceOrder(
238250

239251
$this->cartManagementMock->expects($this->once())
240252
->method('placeOrder')
241-
->willThrowException(new \Exception());
253+
->willThrowException($exception);
254+
255+
$this->loggerMock->expects($this->once())
256+
->method('critical')
257+
->with($exception);
242258

243259
$this->jsonHelperMock->expects($this->any())
244260
->method('jsonEncode')
@@ -278,19 +294,35 @@ public function textExecuteDataProvider()
278294
*/
279295
public function textExecuteFailedPlaceOrderDataProvider()
280296
{
281-
$objectFailed = new \Magento\Framework\DataObject();
282-
$objectFailed->setData('error', true);
283-
$objectFailed->setData(
284-
'error_messages',
285-
__('An error occurred on the server. Please try to place the order again.')
297+
$objectFailed1 = new \Magento\Framework\DataObject(
298+
[
299+
'error' => true,
300+
'error_messages' => __('An error occurred on the server. Please try to place the order again.')
301+
]
302+
);
303+
$generalException = new \Exception('Exception logging will save the world!');
304+
$localizedException = new LocalizedException(__('Electronic payments save the trees.'));
305+
$objectFailed2 = new \Magento\Framework\DataObject(
306+
[
307+
'error' => true,
308+
'error_messages' => $localizedException->getMessage()
309+
]
286310
);
287311

288312
return [
289313
[
290314
['method' => 'authorizenet_directpost'],
291315
IframeConfigProvider::CHECKOUT_IDENTIFIER,
292316
1,
293-
$objectFailed
317+
$objectFailed1,
318+
$generalException,
319+
],
320+
[
321+
['method' => 'authorizenet_directpost'],
322+
IframeConfigProvider::CHECKOUT_IDENTIFIER,
323+
1,
324+
$objectFailed2,
325+
$localizedException,
294326
],
295327
];
296328
}

app/code/Magento/Backend/Block/Dashboard/Tab/Products/Viewed.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
*/
66
namespace Magento\Backend\Block\Dashboard\Tab\Products;
77

8+
use Magento\Catalog\Model\Product;
9+
use Magento\Catalog\Pricing\Price\FinalPrice;
10+
811
/**
912
* Adminhtml dashboard most viewed products grid
1013
*
@@ -66,8 +69,14 @@ protected function _prepareCollection()
6669
);
6770

6871
$this->setCollection($collection);
72+
parent::_prepareCollection();
73+
74+
/** @var Product $product */
75+
foreach ($collection as $product) {
76+
$product->setPrice($product->getPriceInfo()->getPrice(FinalPrice::PRICE_CODE)->getValue());
77+
}
6978

70-
return parent::_prepareCollection();
79+
return $this;
7180
}
7281

7382
/**

app/code/Magento/Backend/i18n/en_US.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ Minute,Minute
250250
"JavaScript may be disabled in your browser.","JavaScript may be disabled in your browser."
251251
"To use this website you must first enable JavaScript in your browser.","To use this website you must first enable JavaScript in your browser."
252252
"This is only a demo store. You can browse and place orders, but nothing will be processed.","This is only a demo store. You can browse and place orders, but nothing will be processed."
253-
"Report Bugs","Report Bugs"
253+
"Report a Bug","Report a Bug"
254254
"Store View:","Store View:"
255255
"Stores Configuration","Stores Configuration"
256256
"Please confirm scope switching. All data that hasn\'t been saved will be lost.","Please confirm scope switching. All data that hasn\'t been saved will be lost."

app/code/Magento/Backend/view/adminhtml/templates/page/report.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88

99
?>
1010
<?php if ($block->getBugreportUrl()): ?>
11-
<a class="link-report" href="<?php /* @escapeNotVerified */ echo $block->getBugreportUrl(); ?>" id="footer_bug_tracking"><?php /* @escapeNotVerified */ echo __('Report Bugs') ?></a>
11+
<a class="link-report" href="<?php /* @escapeNotVerified */ echo $block->getBugreportUrl(); ?>" id="footer_bug_tracking"><?php /* @escapeNotVerified */ echo __('Report a Bug') ?></a>
1212
<?php endif; ?>

app/code/Magento/Braintree/Controller/Paypal/PlaceOrder.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
use Magento\Framework\Controller\ResultFactory;
1212
use Magento\Framework\Exception\LocalizedException;
1313
use Magento\Braintree\Gateway\Config\PayPal\Config;
14+
use Psr\Log\LoggerInterface;
15+
use Magento\Framework\App\ObjectManager;
1416

1517
/**
1618
* Class PlaceOrder
@@ -22,22 +24,32 @@ class PlaceOrder extends AbstractAction
2224
*/
2325
private $orderPlace;
2426

27+
/**
28+
* Logger for exception details
29+
*
30+
* @var LoggerInterface
31+
*/
32+
private $logger;
33+
2534
/**
2635
* Constructor
2736
*
2837
* @param Context $context
2938
* @param Config $config
3039
* @param Session $checkoutSession
3140
* @param Helper\OrderPlace $orderPlace
41+
* @param LoggerInterface|null $logger
3242
*/
3343
public function __construct(
3444
Context $context,
3545
Config $config,
3646
Session $checkoutSession,
37-
Helper\OrderPlace $orderPlace
47+
Helper\OrderPlace $orderPlace,
48+
LoggerInterface $logger = null
3849
) {
3950
parent::__construct($context, $config, $checkoutSession);
4051
$this->orderPlace = $orderPlace;
52+
$this->logger = $logger ?: ObjectManager::getInstance()->get(LoggerInterface::class);
4153
}
4254

4355
/**
@@ -58,6 +70,7 @@ public function execute()
5870
/** @var \Magento\Framework\Controller\Result\Redirect $resultRedirect */
5971
return $resultRedirect->setPath('checkout/onepage/success', ['_secure' => true]);
6072
} catch (\Exception $e) {
73+
$this->logger->critical($e);
6174
$this->messageManager->addExceptionMessage($e, $e->getMessage());
6275
}
6376

app/code/Magento/Braintree/Test/Unit/Controller/Paypal/PlaceOrderTest.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ class PlaceOrderTest extends \PHPUnit_Framework_TestCase
6060
*/
6161
private $placeOrder;
6262

63+
/**
64+
* @var \PHPUnit_Framework_MockObject_MockObject
65+
*/
66+
private $loggerMock;
67+
6368
protected function setUp()
6469
{
6570
/** @var Context|\PHPUnit_Framework_MockObject_MockObject $contextMock */
@@ -94,11 +99,15 @@ protected function setUp()
9499
->method('getMessageManager')
95100
->willReturn($this->messageManagerMock);
96101

102+
$this->loggerMock = $this->getMockBuilder(\Psr\Log\LoggerInterface::class)
103+
->disableOriginalConstructor()
104+
->getMock();
97105
$this->placeOrder = new PlaceOrder(
98106
$contextMock,
99107
$this->configMock,
100108
$this->checkoutSessionMock,
101-
$this->orderPlaceMock
109+
$this->orderPlaceMock,
110+
$this->loggerMock
102111
);
103112
}
104113

app/code/Magento/Bundle/view/adminhtml/layout/adminhtml_order_shipment_view.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
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
<referenceBlock name="shipment_items">
11-
<block class="Magento\Bundle\Block\Adminhtml\Sales\Order\Items\Renderer" name="shipment_item_bundle" as="shipment_item_bundle" template="sales/shipment/view/items/renderer.phtml"/>
11+
<block class="Magento\Bundle\Block\Adminhtml\Sales\Order\Items\Renderer" name="bundle" as="bundle" template="sales/shipment/view/items/renderer.phtml"/>
1212
</referenceBlock>
1313
</body>
1414
</page>

0 commit comments

Comments
 (0)