Skip to content

Commit 6930d43

Browse files
author
Natalia Momotenko
committed
Merge remote-tracking branch 'origin/develop' into bugfixes
2 parents b990fe3 + c29f3e7 commit 6930d43

File tree

35 files changed

+780
-71
lines changed

35 files changed

+780
-71
lines changed

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

Lines changed: 4 additions & 0 deletions
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/Catalog/Model/ResourceModel/AbstractResource.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ public function getAttributeRawValue($entityId, $attribute, $store)
502502
$staticTable,
503503
$staticAttributes
504504
)->join(
505-
['e' => $this->getTable('catalog_product_entity')],
505+
['e' => $this->getTable($this->getEntityTable())],
506506
'e.' . $this->getLinkField() . ' = ' . $staticTable . '.' . $this->getLinkField()
507507
)->where(
508508
'e.entity_id = :entity_id'
@@ -523,7 +523,7 @@ public function getAttributeRawValue($entityId, $attribute, $store)
523523
$select = $connection->select()
524524
->from(['default_value' => $table], ['attribute_id'])
525525
->join(
526-
['e' => $this->getTable('catalog_product_entity')],
526+
['e' => $this->getTable($this->getEntityTable())],
527527
'e.' . $this->getLinkField() . ' = ' . 'default_value.' . $this->getLinkField(),
528528
''
529529
)->where('default_value.attribute_id IN (?)', array_keys($_attributes))

app/code/Magento/CatalogInventory/Ui/DataProvider/Product/Form/Modifier/AdvancedInventory.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,6 @@ private function prepareMeta()
213213
'dataScope' => 'qty',
214214
'validation' => [
215215
'validate-number' => true,
216-
'validate-digits' => true,
217216
'less-than-equals-to' => StockDataFilter::MAX_QTY_VALUE,
218217
],
219218
'imports' => [

app/code/Magento/CatalogInventory/view/adminhtml/ui_component/product_form.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@
9595
<item name="dataScope" xsi:type="string">quantity_and_stock_status.qty</item>
9696
<item name="validation" xsi:type="array">
9797
<item name="validate-number" xsi:type="boolean">true</item>
98-
<item name="validate-digits" xsi:type="boolean">true</item>
9998
<item name="less-than-equals-to" xsi:type="number">99999999</item>
10099
</item>
101100
<item name="sortOrder" xsi:type="number">200</item>

app/code/Magento/CatalogInventory/view/adminhtml/web/js/components/qty-validator-changer.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ define([
1919
handleChanges: function (value) {
2020
var isDigits = value !== 1;
2121

22-
this.validation['validate-number'] = !isDigits;
23-
this.validation['validate-digits'] = isDigits;
22+
this.validation['validate-integer'] = isDigits;
2423
this.validation['less-than-equals-to'] = isDigits ? 99999999 : 99999999.9999;
2524
this.validate();
2625
}

app/code/Magento/Checkout/Block/Cart/Link.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function getHref()
6565
*/
6666
protected function _toHtml()
6767
{
68-
if ($this->_moduleManager->isOutputEnabled('Magento_Checkout')) {
68+
if (!$this->_moduleManager->isOutputEnabled('Magento_Checkout')) {
6969
return '';
7070
}
7171
return parent::_toHtml();

app/code/Magento/Checkout/Test/Unit/Block/Cart/LinkTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function testToHtml()
5757
)->with(
5858
'Magento_Checkout'
5959
)->will(
60-
$this->returnValue(true)
60+
$this->returnValue(false)
6161
);
6262
$this->assertSame('', $block->toHtml());
6363
}

app/code/Magento/Checkout/view/frontend/web/js/view/shipping.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ define(
242242
emailValidationResult = customer.isLoggedIn();
243243

244244
if (!quote.shippingMethod()) {
245-
this.errorValidationMessage('Please specify a shipping method.');
245+
this.errorValidationMessage($.mage.__('Please specify a shipping method.'));
246246

247247
return false;
248248
}

app/code/Magento/Cms/Controller/Adminhtml/Page/MassDelete.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@
1515
*/
1616
class MassDelete extends \Magento\Backend\App\Action
1717
{
18+
/**
19+
* Authorization level of a basic admin session
20+
*
21+
* @see _isAllowed()
22+
*/
23+
const ADMIN_RESOURCE = 'Magento_Cms::page_delete';
24+
1825
/**
1926
* @var Filter
2027
*/

app/code/Magento/Cms/etc/frontend/page_types.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
<type id="cms_index_defaultindex" label="CMS Home Default Page"/>
1010
<type id="cms_index_defaultnoroute" label="CMS No-Route Default Page"/>
1111
<type id="cms_index_index" label="CMS Home Page"/>
12-
<type id="cms_index_test" label="CMS Home Page"/>
1312
<type id="cms_index_nocookies" label="CMS No-Cookies Page"/>
1413
<type id="cms_index_noroute" label="CMS No-Route Page"/>
1514
<type id="cms_page_view" label="CMS Pages (All)"/>
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<?php
2+
/**
3+
* Copyright © 2016 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Developer\Model\Logger\Handler;
7+
8+
use Magento\Framework\App\Config\ScopeConfigInterface;
9+
use Magento\Framework\App\State;
10+
use Magento\Framework\Filesystem\DriverInterface;
11+
use Magento\Store\Model\ScopeInterface;
12+
13+
/**
14+
* Class Debug
15+
*/
16+
class Debug extends \Magento\Framework\Logger\Handler\Debug
17+
{
18+
/**
19+
* @var State
20+
*/
21+
private $state;
22+
23+
/**
24+
* @var ScopeConfigInterface
25+
*/
26+
private $scopeConfig;
27+
28+
/**
29+
* @param DriverInterface $filesystem
30+
* @param State $state
31+
* @param ScopeConfigInterface $scopeConfig
32+
* @param string $filePath
33+
*/
34+
public function __construct(
35+
DriverInterface $filesystem,
36+
State $state,
37+
ScopeConfigInterface $scopeConfig,
38+
$filePath = null
39+
) {
40+
parent::__construct($filesystem, $filePath);
41+
42+
$this->state = $state;
43+
$this->scopeConfig = $scopeConfig;
44+
}
45+
46+
/**
47+
* {@inheritdoc}
48+
*/
49+
public function isHandling(array $record)
50+
{
51+
return
52+
parent::isHandling($record)
53+
&& $this->state->getMode() !== State::MODE_PRODUCTION
54+
&& $this->scopeConfig->getValue('dev/debug/debug_logging', ScopeInterface::SCOPE_STORE);
55+
}
56+
}
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
<?php
2+
/**
3+
* Copyright © 2016 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Developer\Test\Unit\Model\Logger\Handler;
7+
8+
use Magento\Developer\Model\Logger\Handler\Debug;
9+
use Magento\Framework\App\Config\ScopeConfigInterface;
10+
use Magento\Framework\App\State;
11+
use Magento\Framework\Filesystem\DriverInterface;
12+
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
13+
use Magento\Store\Model\ScopeInterface;
14+
use Monolog\Formatter\FormatterInterface;
15+
use Monolog\Logger;
16+
17+
/**
18+
* Class DebugTest
19+
*/
20+
class DebugTest extends \PHPUnit_Framework_TestCase
21+
{
22+
/**
23+
* @var Debug
24+
*/
25+
private $model;
26+
27+
/**
28+
* @var DriverInterface|\PHPUnit_Framework_MockObject_MockObject
29+
*/
30+
private $filesystemMock;
31+
32+
/**
33+
* @var State|\PHPUnit_Framework_MockObject_MockObject
34+
*/
35+
private $stateMock;
36+
37+
/**
38+
* @var ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject
39+
*/
40+
private $scopeConfigMock;
41+
42+
/**
43+
* @var FormatterInterface|\PHPUnit_Framework_MockObject_MockObject
44+
*/
45+
private $formatterMock;
46+
47+
protected function setUp()
48+
{
49+
$this->filesystemMock = $this->getMockBuilder(DriverInterface::class)
50+
->getMockForAbstractClass();
51+
$this->stateMock = $this->getMockBuilder(State::class)
52+
->disableOriginalConstructor()
53+
->getMock();
54+
$this->scopeConfigMock = $this->getMockBuilder(ScopeConfigInterface::class)
55+
->getMockForAbstractClass();
56+
$this->formatterMock = $this->getMockBuilder(FormatterInterface::class)
57+
->getMockForAbstractClass();
58+
59+
$this->formatterMock->expects($this->any())
60+
->method('format')
61+
->willReturn(null);
62+
63+
$this->model = (new ObjectManager($this))->getObject(Debug::class, [
64+
'filesystem' => $this->filesystemMock,
65+
'state' => $this->stateMock,
66+
'scopeConfig' => $this->scopeConfigMock,
67+
]);
68+
$this->model->setFormatter($this->formatterMock);
69+
}
70+
71+
public function testHandle()
72+
{
73+
$this->stateMock->expects($this->once())
74+
->method('getMode')
75+
->willReturn(State::MODE_DEVELOPER);
76+
$this->scopeConfigMock->expects($this->once())
77+
->method('getValue')
78+
->with('dev/debug/debug_logging', ScopeInterface::SCOPE_STORE, null)
79+
->willReturn(true);
80+
81+
$this->model->handle(['formatted' => false, 'level' => Logger::DEBUG]);
82+
}
83+
84+
public function testHandleDisabledByProduction()
85+
{
86+
$this->stateMock->expects($this->once())
87+
->method('getMode')
88+
->willReturn(State::MODE_PRODUCTION);
89+
$this->scopeConfigMock->expects($this->never())
90+
->method('getValue');
91+
92+
$this->model->handle(['formatted' => false, 'level' => Logger::DEBUG]);
93+
}
94+
95+
public function testHandleDisabledByConfig()
96+
{
97+
$this->stateMock->expects($this->once())
98+
->method('getMode')
99+
->willReturn(State::MODE_DEVELOPER);
100+
$this->scopeConfigMock->expects($this->once())
101+
->method('getValue')
102+
->with('dev/debug/debug_logging', ScopeInterface::SCOPE_STORE, null)
103+
->willReturn(false);
104+
105+
$this->model->handle(['formatted' => false, 'level' => Logger::DEBUG]);
106+
}
107+
108+
public function testHandleDisabledByLevel()
109+
{
110+
$this->stateMock->expects($this->never())
111+
->method('getMode');
112+
$this->scopeConfigMock->expects($this->never())
113+
->method('getValue');
114+
115+
$this->model->handle(['formatted' => false, 'level' => Logger::API]);
116+
}
117+
}

app/code/Magento/Developer/etc/adminhtml/system.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@
2323
<backend_model>Magento\Developer\Model\Config\Backend\AllowedIps</backend_model>
2424
</field>
2525
</group>
26+
<group id="debug" translate="label" type="text" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
27+
<field id="debug_logging" translate="label comment" type="select" sortOrder="30" showInDefault="1" showInWebsite="0" showInStore="0">
28+
<label>Log to File</label>
29+
<comment>Not available in production mode.</comment>
30+
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
31+
</field>
32+
</group>
2633
</section>
2734
</system>
2835
</config>

app/code/Magento/Developer/etc/di.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<preference for="Magento\Framework\View\Asset\PreProcessor\ChainFactoryInterface" type="Magento\Framework\View\Asset\PreProcessor\ChainFactory"/>
1010
<preference for="Magento\Framework\Css\PreProcessor\ErrorHandlerInterface" type="Magento\Framework\Css\PreProcessor\ErrorHandler" />
1111
<preference for="Magento\Framework\View\Asset\PreProcessor\Helper\SortInterface" type="Magento\Framework\View\Asset\PreProcessor\Helper\Sort"/>
12+
<preference for="Magento\Framework\Logger\Handler\Debug" type="Magento\Developer\Model\Logger\Handler\Debug"/>
1213

1314
<type name="Magento\Framework\View\Result\Page">
1415
<arguments>

app/code/Magento/Eav/Model/Entity/AbstractEntity.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1015,7 +1015,11 @@ protected function _loadModelAttributes($object)
10151015
$selectGroups = $this->_resourceHelper->getLoadAttributesSelectGroups($selects);
10161016
foreach ($selectGroups as $selects) {
10171017
if (!empty($selects)) {
1018-
$select = $this->_prepareLoadSelect($selects);
1018+
if (is_array($selects)) {
1019+
$select = $this->_prepareLoadSelect($selects);
1020+
} else {
1021+
$select = $selects;
1022+
}
10191023
$values = $this->getConnection()->fetchAll($select);
10201024
foreach ($values as $valueRow) {
10211025
$this->_setAttributeValue($object, $valueRow);

app/code/Magento/Eav/Model/Entity/Collection/AbstractCollection.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1175,7 +1175,11 @@ public function _loadAttributes($printQuery = false, $logQuery = false)
11751175
foreach ($selectGroups as $selects) {
11761176
if (!empty($selects)) {
11771177
try {
1178-
$select = implode(' UNION ALL ', $selects);
1178+
if (is_array($selects)) {
1179+
$select = implode(' UNION ALL ', $selects);
1180+
} else {
1181+
$select = $selects;
1182+
}
11791183
$values = $this->getConnection()->fetchAll($select);
11801184
} catch (\Exception $e) {
11811185
$this->printLogQuery(true, true, $select);

app/code/Magento/Eav/Model/Entity/Setup/PropertyMapper.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class PropertyMapper extends PropertyMapperAbstract
2222
public function map(array $input, $entityTypeId)
2323
{
2424
return [
25+
'attribute_model' => $this->_getValue($input, 'attribute_model'),
2526
'backend_model' => $this->_getValue($input, 'backend'),
2627
'backend_type' => $this->_getValue($input, 'type', 'varchar'),
2728
'backend_table' => $this->_getValue($input, 'table'),

app/code/Magento/Eav/Model/ResourceModel/Helper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,6 @@ public function getLoadAttributesSelectGroups($selects)
8080
foreach ($selects as $selectGroup) {
8181
$mainGroup = array_merge($mainGroup, $selectGroup);
8282
}
83-
return [$mainGroup];
83+
return $mainGroup;
8484
}
8585
}

app/code/Magento/Paypal/etc/frontend/page_types.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
-->
88
<page_types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_types.xsd">
9-
<type id="paypal_billing_agreement_index" label="Billing Agreement"/>
9+
<type id="paypal_billing_agreement_index" label="Billing Agreements"/>
1010
<type id="paypal_billing_agreement_view" label="Billing Agreement View"/>
1111
<type id="paypal_express_review" label="PayPal Express Order Review Form"/>
1212
<type id="paypal_hostedpro_cancel" label="Paypal Hosted Pro Frame"/>
@@ -18,5 +18,5 @@
1818
<type id="paypal_payflowadvanced_cancelpayment" label="Paypal Payflow Advanced Cancel Payment"/>
1919
<type id="paypal_payflowadvanced_form" label="Paypal Payflow Advanced Form"/>
2020
<type id="paypal_payflowadvanced_returnurl" label="Paypal Payflow Advanced Return URL"/>
21-
<type id="paypal_payflowexpress_review" label="PayPal Express Order Review Form"/>
21+
<type id="paypal_payflowexpress_review" label="PayPal Payflow Express Order Review Form"/>
2222
</page_types>

0 commit comments

Comments
 (0)