Skip to content

Commit cc2c0c7

Browse files
author
Dmytro Aponasenko
committed
Merge branch 'develop' of https://github.corp.magento.com/magento2/magento2ce into develop
2 parents 85b6197 + 222b77c commit cc2c0c7

File tree

103 files changed

+2425
-1140
lines changed

Some content is hidden

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

103 files changed

+2425
-1140
lines changed

app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Checkbox.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,17 +77,25 @@ public function render(\Magento\Framework\DataObject $row)
7777
{
7878
$values = $this->_getValues();
7979
$value = $row->getData($this->getColumn()->getIndex());
80+
$checked = '';
8081
if (is_array($values)) {
8182
$checked = in_array($value, $values) ? ' checked="checked"' : '';
8283
} else {
83-
$checked = $value === $this->getColumn()->getValue() ? ' checked="checked"' : '';
84+
$checkedValue = $this->getColumn()->getValue();
85+
if ($checkedValue !== null) {
86+
$checked = $value === $checkedValue ? ' checked="checked"' : '';
87+
}
8488
}
8589

90+
$disabled = '';
8691
$disabledValues = $this->getColumn()->getDisabledValues();
8792
if (is_array($disabledValues)) {
8893
$disabled = in_array($value, $disabledValues) ? ' disabled="disabled"' : '';
8994
} else {
90-
$disabled = $value === $this->getColumn()->getDisabledValue() ? ' disabled="disabled"' : '';
95+
$disabledValue = $this->getColumn()->getDisabledValue();
96+
if ($disabledValue !== null) {
97+
$disabled = $value === $disabledValue ? ' disabled="disabled"' : '';
98+
}
9199
}
92100

93101
$this->setDisabled($disabled);

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ class AdminConfig extends Config
3030
protected $_frontNameResolver;
3131

3232
/**
33-
* @var \Magento\Store\Model\StoreManagerInterface
33+
* @var \Magento\Backend\App\BackendAppList
3434
*/
35-
protected $_storeManager;
35+
private $backendAppList;
3636

3737
/**
38-
* @var \Magento\Backend\App\BackendAppList
38+
* @var \Magento\Backend\Model\UrlFactory
3939
*/
40-
private $backendAppList;
40+
private $backendUrlFactory;
4141

4242
/**
4343
* @param \Magento\Framework\ValidatorFactory $validatorFactory
@@ -49,7 +49,7 @@ class AdminConfig extends Config
4949
* @param string $scopeType
5050
* @param \Magento\Backend\App\BackendAppList $backendAppList
5151
* @param FrontNameResolver $frontNameResolver
52-
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
52+
* @param \Magento\Backend\Model\UrlFactory $backendUrlFactory
5353
* @param string $lifetimePath
5454
* @param string $sessionName
5555
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
@@ -64,7 +64,7 @@ public function __construct(
6464
$scopeType,
6565
\Magento\Backend\App\BackendAppList $backendAppList,
6666
FrontNameResolver $frontNameResolver,
67-
\Magento\Store\Model\StoreManagerInterface $storeManager,
67+
\Magento\Backend\Model\UrlFactory $backendUrlFactory,
6868
$lifetimePath = self::XML_PATH_COOKIE_LIFETIME,
6969
$sessionName = self::SESSION_NAME_ADMIN
7070
) {
@@ -79,8 +79,8 @@ public function __construct(
7979
$lifetimePath
8080
);
8181
$this->_frontNameResolver = $frontNameResolver;
82-
$this->_storeManager = $storeManager;
8382
$this->backendAppList = $backendAppList;
83+
$this->backendUrlFactory = $backendUrlFactory;
8484
$adminPath = $this->extractAdminPath();
8585
$this->setCookiePath($adminPath);
8686
$this->setName($sessionName);
@@ -95,7 +95,7 @@ private function extractAdminPath()
9595
{
9696
$backendApp = $this->backendAppList->getCurrentApp();
9797
$cookiePath = null;
98-
$baseUrl = parse_url($this->_storeManager->getStore()->getBaseUrl(), PHP_URL_PATH);
98+
$baseUrl = parse_url($this->backendUrlFactory->create()->getBaseUrl(), PHP_URL_PATH);
9999
if (!$backendApp) {
100100
$cookiePath = $baseUrl . $this->_frontNameResolver->getFrontName();
101101
return $cookiePath;

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

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ class AdminConfigTest extends \PHPUnit_Framework_TestCase
2929
private $objectManager;
3030

3131
/**
32-
* @var \Magento\Store\Model\StoreManagerInterface | \PHPUnit_Framework_MockObject_MockObject
32+
* @var \Magento\Backend\Model\UrlFactory | \PHPUnit_Framework_MockObject_MockObject
3333
*/
34-
private $storeManagerMock;
34+
private $backendUrlFactory;
3535

3636
/**
3737
* @var \Magento\Framework\Filesystem|\PHPUnit_Framework_MockObject_MockObject
@@ -56,13 +56,10 @@ protected function setUp()
5656
$this->validatorFactory = $this->getMockBuilder('Magento\Framework\ValidatorFactory')
5757
->disableOriginalConstructor()
5858
->getMock();
59-
60-
$storeMock = $this->getMockBuilder('\Magento\Store\Model\Store')
61-
->disableOriginalConstructor()
62-
->getMock();
63-
$storeMock->expects($this->once())->method('getBaseUrl')->will($this->returnValue('/'));
64-
$this->storeManagerMock = $this->getMockForAbstractClass('\Magento\Store\Model\StoreManagerInterface');
65-
$this->storeManagerMock->expects($this->once())->method('getStore')->will($this->returnValue($storeMock));
59+
$backendUrl = $this->getMock('\Magento\Backend\Model\Url', [], [], '', false);
60+
$backendUrl->expects($this->once())->method('getBaseUrl')->will($this->returnValue('/'));
61+
$this->backendUrlFactory = $this->getMock('Magento\Backend\Model\UrlFactory', ['create'], [], '', false);
62+
$this->backendUrlFactory->expects($this->any())->method('create')->willReturn($backendUrl);
6663

6764
$this->filesystemMock = $this->getMock('\Magento\Framework\Filesystem', [], [], '', false);
6865
$dirMock = $this->getMockForAbstractClass('Magento\Framework\Filesystem\Directory\WriteInterface');
@@ -99,7 +96,7 @@ public function testSetCookiePathNonDefault()
9996
'validatorFactory' => $this->validatorFactory,
10097
'request' => $this->requestMock,
10198
'frontNameResolver' => $mockFrontNameResolver,
102-
'storeManager' => $this->storeManagerMock,
99+
'backendUrlFactory' => $this->backendUrlFactory,
103100
'filesystem' => $this->filesystemMock,
104101
]
105102
);
@@ -134,7 +131,7 @@ public function testSetSessionNameByConstructor()
134131
'validatorFactory' => $this->validatorFactory,
135132
'request' => $this->requestMock,
136133
'sessionName' => $sessionName,
137-
'storeManager' => $this->storeManagerMock,
134+
'backendUrlFactory' => $this->backendUrlFactory,
138135
'filesystem' => $this->filesystemMock,
139136
]
140137
);

app/code/Magento/Backend/view/adminhtml/templates/widget/form/renderer/fieldset.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ if (!isset($advancedLabel)) {
2222
$advancedLabel = __('Additional Settings');
2323
}
2424

25-
$cssClass = ($isField) ? 'field ' . $element->getClass() : 'fieldset admin__fieldset' . $element->getClass();
25+
$cssClass = ($isField) ? 'field ' . $element->getClass() : 'fieldset admin__fieldset ' . $element->getClass();
2626

2727
if ($isField) {
2828
$count = $element->getCountBasicChildren();

app/code/Magento/Braintree/Model/PaymentMethod.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use \Braintree_Transaction;
1212
use \Braintree_Result_Successful;
1313
use Magento\Framework\Exception\LocalizedException;
14+
use Magento\Sales\Model\Order\Payment\Transaction;
1415
use Magento\Sales\Model\ResourceModel\Order\Payment\Transaction\CollectionFactory as TransactionCollectionFactory;
1516
use Magento\Sales\Model\Order\Payment\Transaction as PaymentTransaction;
1617
use Magento\Payment\Model\InfoInterface;
@@ -648,13 +649,15 @@ public function refund(InfoInterface $payment, $amount)
648649
}
649650
}
650651

652+
// transaction should be voided if it not settled
651653
$canVoid = ($transaction->status === \Braintree_Transaction::AUTHORIZED
652654
|| $transaction->status === \Braintree_Transaction::SUBMITTED_FOR_SETTLEMENT);
653655
$result = $canVoid
654656
? $this->braintreeTransaction->void($transactionId)
655657
: $this->braintreeTransaction->refund($transactionId, $amount);
656658
$this->_debug($this->_convertObjToArray($result));
657659
if ($result->success) {
660+
$payment->setTransactionId($transactionId . '-' . Transaction::TYPE_REFUND);
658661
$payment->setIsTransactionClosed(true);
659662
} else {
660663
throw new LocalizedException($this->errorHelper->parseBraintreeError($result));

app/code/Magento/Braintree/Test/Unit/Model/PaymentMethodTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
use Magento\Braintree\Model\PaymentMethod;
1010
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
11+
use Magento\Sales\Model\Order\Payment\Transaction;
1112
use \Magento\Sales\Model\ResourceModel\Order\Payment\Transaction\CollectionFactory as TransactionCollectionFactory;
1213
use Magento\Framework\Exception\LocalizedException;
1314
use \Braintree_Result_Successful;
@@ -2378,6 +2379,7 @@ public function testRefund()
23782379

23792380
$this->model->refund($paymentObject, $amount);
23802381
$this->assertEquals(1, $paymentObject->getIsTransactionClosed());
2382+
$this->assertEquals($refundTransactionId . '-' .Transaction::TYPE_REFUND, $paymentObject->getTransactionId());
23812383
}
23822384

23832385
/**

app/code/Magento/Braintree/view/adminhtml/templates/form.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ $ccExpYear = $block->getInfoData('cc_exp_year');
133133
</div>
134134
</fieldset>
135135
<?php endif; ?>
136-
<?php if($_useVault): ?>
136+
<?php if($useVault): ?>
137137
<fieldset class="admin__fieldset hide_if_token_selected">
138138
<div id="<?php /* @noEscape */ echo $code; ?>_store_in_vault_div" style="text-align:left;" class="">
139139
<input type="checkbox" title="<?php echo $block->escapeHtml(__('Save this card for future use')); ?>"

app/code/Magento/Braintree/view/frontend/templates/creditcard/index.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ $storedCards = $block->getCurrentCustomerStoredCards();
1919
<?php endif; ?>
2020
</div>
2121
<?php echo $block->getLayout()->getMessagesBlock()->getGroupedHtml(); ?>
22-
<?php if (count($_storedCards)): ?>
22+
<?php if (count($storedCards)): ?>
2323
<table class="data-table" id="my-quotes-table">
2424
<col width="1" />
2525
<col width="1" />

app/code/Magento/Braintree/view/frontend/web/template/payment/cc-form.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,10 @@
8080
<!-- ko if: (isCcDetectionEnabled())-->
8181
<ul class="credit-card-types">
8282
<!-- ko foreach: {data: getCcAvailableTypesValues(), as: 'item'} -->
83-
<li class="item" data-bind="css: {_active: $parent.selectedCardType() == item.value} ">
83+
<li class="item" data-bind="css: {
84+
_active: $parent.selectedCardType() == item.value,
85+
_inactive: $parent.selectedCardType() != null && $parent.selectedCardType() != item.value
86+
} ">
8487
<!--ko if: $parent.getIcons(item.value) -->
8588
<img data-bind="attr: {
8689
'src': $parent.getIcons(item.value).url,

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,11 @@
494494
</argument>
495495
</arguments>
496496
</type>
497+
<type name="Magento\Catalog\Console\Command\ImagesResizeCommand">
498+
<arguments>
499+
<argument name="productRepository" xsi:type="object">Magento\Catalog\Api\ProductRepositoryInterface\Proxy</argument>
500+
</arguments>
501+
</type>
497502
<type name="Magento\Framework\Config\View">
498503
<arguments>
499504
<argument name="xpath" xsi:type="array">

app/code/Magento/Cookie/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/module-cookie",
33
"description": "N/A",
44
"require": {
5-
"php": "~5.4.11|~5.5.0|~5.6.0",
5+
"php": "~5.5.0|~5.6.0|~7.0.0",
66
"magento/module-store": "1.0.0-beta",
77
"magento/framework": "1.0.0-beta"
88
},

app/code/Magento/Customer/Console/Command/UpgradeHashAlgorithmCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ public function __construct(
4040
) {
4141
parent::__construct();
4242
$this->customerCollectionFactory = $customerCollectionFactory;
43-
$this->collection = $customerCollectionFactory->create();
4443
$this->encryptor = $encryptor;
4544
}
4645

@@ -58,6 +57,7 @@ protected function configure()
5857
*/
5958
protected function execute(InputInterface $input, OutputInterface $output)
6059
{
60+
$this->collection = $this->customerCollectionFactory->create();
6161
$this->collection->addAttributeToSelect('*');
6262
$customerCollection = $this->collection->getItems();
6363
/** @var $customer Customer */

0 commit comments

Comments
 (0)