Skip to content

Commit c0ef780

Browse files
Merge remote-tracking branch 'origin/2.2-develop' into feature-country-selection-3483
2 parents 2fb34ef + 816ec39 commit c0ef780

File tree

30 files changed

+304
-80
lines changed

30 files changed

+304
-80
lines changed

app/bootstrap.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
if (!defined('PHP_VERSION_ID') || !(PHP_VERSION_ID === 70002 || PHP_VERSION_ID === 70004 || PHP_VERSION_ID >= 70006)) {
1515
if (PHP_SAPI == 'cli') {
1616
echo 'Magento supports 7.0.2, 7.0.4, and 7.0.6 or later. ' .
17-
'Please read http://devdocs.magento.com/guides/v1.0/install-gde/system-requirements.html';
17+
'Please read http://devdocs.magento.com/guides/v2.2/install-gde/system-requirements.html';
1818
} else {
1919
echo <<<HTML
2020
<div style="font:12px/1.35em arial, helvetica, sans-serif;">
2121
<p>Magento supports PHP 7.0.2, 7.0.4, and 7.0.6 or later. Please read
22-
<a target="_blank" href="http://devdocs.magento.com/guides/v1.0/install-gde/system-requirements.html">
22+
<a target="_blank" href="http://devdocs.magento.com/guides/v2.2/install-gde/system-requirements.html">
2323
Magento System Requirements</a>.
2424
</div>
2525
HTML;

app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/cc-form.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ define(
7979
*/
8080
onError: function (response) {
8181
braintree.showError($t('Payment ' + this.getTitle() + ' can\'t be initialized'));
82+
this.isPlaceOrderActionAllowed(true);
8283
throw response.message;
8384
},
8485

app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/attribute/options.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ $stores = $block->getStoresSortedBySortOrder();
5757
<input type="hidden" id="option-count-check" value="" />
5858
</div>
5959
<script id="row-template" type="text/x-magento-template">
60-
<tr>
60+
<tr <% if (data.rowClasses) { %>class="<%- data.rowClasses %>"<% } %>>
6161
<td class="col-draggable">
6262
<?php if (!$block->getReadOnly() && !$block->canManageOptionDefaultOnly()): ?>
6363
<div data-role="draggable-handle" class="draggable-handle"

app/code/Magento/Catalog/view/adminhtml/web/js/options.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ define([
2424
totalItems: 0,
2525
rendered: 0,
2626
template: mageTemplate('#row-template'),
27+
newOptionClass: 'new-option',
2728
isReadOnly: config.isReadOnly,
2829
add: function (data, render) {
2930
var isNewOption = false,
@@ -32,7 +33,8 @@ define([
3233
if (typeof data.id == 'undefined') {
3334
data = {
3435
'id': 'option_' + this.itemCount,
35-
'sort_order': this.itemCount + 1
36+
'sort_order': this.itemCount + 1,
37+
'rowClasses': this.newOptionClass
3638
};
3739
isNewOption = true;
3840
}
@@ -84,6 +86,10 @@ define([
8486
this.totalItems--;
8587
this.updateItemsCountField();
8688
}
89+
90+
if (element.hasClassName(this.newOptionClass)) {
91+
element.remove();
92+
}
8793
},
8894
updateItemsCountField: function () {
8995
$('option-count-check').value = this.totalItems > 0 ? '1' : '';

app/code/Magento/Catalog/view/base/web/template/product/link.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* See COPYING.txt for license details.
55
*/
66
-->
7-
<a class="product-item-link"
7+
<a if="isAllowed()"
8+
class="product-item-link"
89
attr="href: $row().url"
910
text="label"/>

app/code/Magento/ConfigurableProduct/Model/ResourceModel/Attribute/OptionSelectBuilder.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,12 @@ public function getSelect(AbstractAttribute $superAttribute, int $productId, Sco
9191
]
9292
),
9393
[]
94+
)->joinInner(
95+
['attribute_option' => $this->attributeResource->getTable('eav_attribute_option')],
96+
'attribute_option.option_id = entity_value.value',
97+
[]
98+
)->order(
99+
'attribute_option.sort_order ASC'
94100
)->where(
95101
'super_attribute.product_id = ?',
96102
$productId

app/code/Magento/ConfigurableProduct/Test/Unit/Model/ResourceModel/Attribute/OptionSelectBuilderTest.php

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ protected function setUp()
6666
->disableOriginalConstructor()
6767
->getMockForAbstractClass();
6868
$this->select = $this->getMockBuilder(Select::class)
69-
->setMethods(['from', 'joinInner', 'joinLeft', 'where', 'columns'])
69+
->setMethods(['from', 'joinInner', 'joinLeft', 'where', 'columns', 'order'])
7070
->disableOriginalConstructor()
7171
->getMock();
7272
$this->connectionMock->expects($this->atLeastOnce())
@@ -112,10 +112,28 @@ public function testGetSelect()
112112
{
113113
$this->select->expects($this->exactly(1))->method('from')->willReturnSelf();
114114
$this->select->expects($this->exactly(1))->method('columns')->willReturnSelf();
115-
$this->select->expects($this->exactly(5))->method('joinInner')->willReturnSelf();
115+
$this->select->expects($this->exactly(6))->method('joinInner')->willReturnSelf();
116116
$this->select->expects($this->exactly(3))->method('joinLeft')->willReturnSelf();
117+
$this->select->expects($this->exactly(1))->method('order')->willReturnSelf();
117118
$this->select->expects($this->exactly(2))->method('where')->willReturnSelf();
118119

120+
$this->attributeResourceMock->expects($this->exactly(9))
121+
->method('getTable')
122+
->will(
123+
$this->returnValueMap(
124+
[
125+
['catalog_product_super_attribute', 'catalog_product_super_attribute value'],
126+
['catalog_product_entity', 'catalog_product_entity value'],
127+
['catalog_product_super_link', 'catalog_product_super_link value'],
128+
['eav_attribute', 'eav_attribute value'],
129+
['catalog_product_entity', 'catalog_product_entity value'],
130+
['catalog_product_super_attribute_label', 'catalog_product_super_attribute_label value'],
131+
['eav_attribute_option', 'eav_attribute_option value'],
132+
['eav_attribute_option_value', 'eav_attribute_option_value value']
133+
]
134+
)
135+
);
136+
119137
$this->abstractAttributeMock->expects($this->atLeastOnce())
120138
->method('getAttributeId')
121139
->willReturn('getAttributeId value');
@@ -138,10 +156,27 @@ public function testGetSelectWithBackendModel()
138156
{
139157
$this->select->expects($this->exactly(1))->method('from')->willReturnSelf();
140158
$this->select->expects($this->exactly(0))->method('columns')->willReturnSelf();
141-
$this->select->expects($this->exactly(5))->method('joinInner')->willReturnSelf();
159+
$this->select->expects($this->exactly(6))->method('joinInner')->willReturnSelf();
142160
$this->select->expects($this->exactly(1))->method('joinLeft')->willReturnSelf();
161+
$this->select->expects($this->exactly(1))->method('order')->willReturnSelf();
143162
$this->select->expects($this->exactly(2))->method('where')->willReturnSelf();
144163

164+
$this->attributeResourceMock->expects($this->exactly(7))
165+
->method('getTable')
166+
->will(
167+
$this->returnValueMap(
168+
[
169+
['catalog_product_super_attribute', 'catalog_product_super_attribute value'],
170+
['catalog_product_entity', 'catalog_product_entity value'],
171+
['catalog_product_super_link', 'catalog_product_super_link value'],
172+
['eav_attribute', 'eav_attribute value'],
173+
['catalog_product_entity', 'catalog_product_entity value'],
174+
['catalog_product_super_attribute_label', 'catalog_product_super_attribute_label value'],
175+
['eav_attribute_option', 'eav_attribute_option value']
176+
]
177+
)
178+
);
179+
145180
$this->abstractAttributeMock->expects($this->atLeastOnce())
146181
->method('getAttributeId')
147182
->willReturn('getAttributeId value');

app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/variations.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,12 +357,12 @@ define([
357357
var element;
358358

359359
_.each(this.disabledAttributes, function (attribute) {
360-
registry.get('index = ' + attribute).disabled(false);
360+
registry.get('code = ' + attribute, 'index = ' + attribute).disabled(false);
361361
});
362362
this.disabledAttributes = [];
363363

364364
_.each(attributes, function (attribute) {
365-
element = registry.get('index = ' + attribute.code);
365+
element = registry.get('code = ' + attribute.code, 'index = ' + attribute.code);
366366

367367
if (!_.isUndefined(element)) {
368368
element.disabled(true);

app/code/Magento/Deploy/Console/Command/SetModeCommand.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
101101
$modeController->enableProductionMode();
102102
}
103103
break;
104+
case State::MODE_DEFAULT:
105+
$modeController->enableDefaultMode();
106+
break;
104107
default:
105108
throw new LocalizedException(__('Cannot switch into given mode "%1"', $toMode));
106109
}

app/code/Magento/Deploy/Model/Mode.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,25 @@ public function enableDeveloperMode()
177177
$this->setStoreMode(State::MODE_DEVELOPER);
178178
}
179179

180+
/**
181+
* Enable Default mode
182+
*
183+
* @return void
184+
*/
185+
public function enableDefaultMode()
186+
{
187+
$this->filesystem->cleanupFilesystem(
188+
[
189+
DirectoryList::CACHE,
190+
DirectoryList::GENERATED_CODE,
191+
DirectoryList::GENERATED_METADATA,
192+
DirectoryList::TMP_MATERIALIZATION_DIR,
193+
DirectoryList::STATIC_VIEW,
194+
]
195+
);
196+
$this->setStoreMode(State::MODE_DEFAULT);
197+
}
198+
180199
/**
181200
* Get current mode information
182201
*

app/code/Magento/Deploy/Test/Unit/Console/Command/SetModeCommandTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,18 @@ public function testSetDeveloperMode()
6767
);
6868
}
6969

70+
public function testSetDefaultMode()
71+
{
72+
$this->modeMock->expects($this->once())->method('enableDefaultMode');
73+
74+
$tester = new CommandTester($this->command);
75+
$tester->execute(['mode' => 'default']);
76+
$this->assertContains(
77+
"default mode",
78+
$tester->getDisplay()
79+
);
80+
}
81+
7082
public function testSetProductionSkipCompilation()
7183
{
7284
$this->modeMock->expects($this->once())->method('enableProductionModeMinimal');

app/code/Magento/Paypal/Model/Express.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,14 +669,19 @@ public function getApi()
669669
public function assignData(\Magento\Framework\DataObject $data)
670670
{
671671
parent::assignData($data);
672-
672+
673673
$additionalData = $data->getData(PaymentInterface::KEY_ADDITIONAL_DATA);
674674

675675
if (!is_array($additionalData)) {
676676
return $this;
677677
}
678678

679679
foreach ($additionalData as $key => $value) {
680+
// Skip extension attributes
681+
if ($key === \Magento\Framework\Api\ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY) {
682+
continue;
683+
}
684+
680685
$this->getInfoInstance()->setAdditionalInformation($key, $value);
681686
}
682687
return $this;

app/code/Magento/Paypal/Test/Unit/Model/ExpressTest.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,21 @@ public function testAssignData()
161161
{
162162
$transportValue = 'something';
163163

164+
$extensionAttribute = $this->getMockForAbstractClass(
165+
\Magento\Quote\Api\Data\PaymentExtensionInterface::class,
166+
[],
167+
'',
168+
false,
169+
false
170+
);
171+
164172
$data = new DataObject(
165173
[
166174
PaymentInterface::KEY_ADDITIONAL_DATA => [
167175
Express\Checkout::PAYMENT_INFO_TRANSPORT_BILLING_AGREEMENT => $transportValue,
168176
Express\Checkout::PAYMENT_INFO_TRANSPORT_PAYER_ID => $transportValue,
169-
Express\Checkout::PAYMENT_INFO_TRANSPORT_TOKEN => $transportValue
177+
Express\Checkout::PAYMENT_INFO_TRANSPORT_TOKEN => $transportValue,
178+
\Magento\Framework\Api\ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY => $extensionAttribute
170179
]
171180
]
172181
);

app/code/Magento/Paypal/view/frontend/web/js/action/set-payment-method.js

Lines changed: 3 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -4,48 +4,12 @@
44
*/
55

66
define([
7-
'jquery',
87
'Magento_Checkout/js/model/quote',
9-
'Magento_Checkout/js/model/url-builder',
10-
'mage/storage',
11-
'Magento_Checkout/js/model/error-processor',
12-
'Magento_Customer/js/model/customer',
13-
'Magento_Checkout/js/model/full-screen-loader'
14-
], function ($, quote, urlBuilder, storage, errorProcessor, customer, fullScreenLoader) {
8+
'Magento_Checkout/js/action/set-payment-information'
9+
], function (quote, setPaymentInformation) {
1510
'use strict';
1611

1712
return function (messageContainer) {
18-
var serviceUrl,
19-
payload,
20-
paymentData = quote.paymentMethod();
21-
22-
/**
23-
* Checkout for guest and registered customer.
24-
*/
25-
if (!customer.isLoggedIn()) {
26-
serviceUrl = urlBuilder.createUrl('/guest-carts/:cartId/set-payment-information', {
27-
cartId: quote.getQuoteId()
28-
});
29-
payload = {
30-
cartId: quote.getQuoteId(),
31-
email: quote.guestEmail,
32-
paymentMethod: paymentData
33-
};
34-
} else {
35-
serviceUrl = urlBuilder.createUrl('/carts/mine/set-payment-information', {});
36-
payload = {
37-
cartId: quote.getQuoteId(),
38-
paymentMethod: paymentData
39-
};
40-
}
41-
fullScreenLoader.startLoader();
42-
43-
return storage.post(
44-
serviceUrl, JSON.stringify(payload)
45-
).fail(function (response) {
46-
errorProcessor.process(response, messageContainer);
47-
}).always(function () {
48-
fullScreenLoader.stopLoader();
49-
});
13+
return setPaymentInformation(messageContainer, quote.paymentMethod());
5014
};
5115
});

app/code/Magento/Sales/Controller/Adminhtml/Order/Invoice/Save.php

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -191,14 +191,7 @@ public function execute()
191191
}
192192
$transactionSave->save();
193193

194-
if (isset($shippingResponse) && $shippingResponse->hasErrors()) {
195-
$this->messageManager->addError(
196-
__(
197-
'The invoice and the shipment have been created. ' .
198-
'The shipping label cannot be created now.'
199-
)
200-
);
201-
} elseif (!empty($data['do_shipment'])) {
194+
if (!empty($data['do_shipment'])) {
202195
$this->messageManager->addSuccess(__('You created the invoice and shipment.'));
203196
} else {
204197
$this->messageManager->addSuccess(__('The invoice has been created.'));

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,6 @@ Sales,Sales
233233
"You can't create an invoice without products.","You can't create an invoice without products."
234234
"New Invoice","New Invoice"
235235
"We can't save the invoice right now.","We can't save the invoice right now."
236-
"The invoice and the shipment have been created. The shipping label cannot be created now.","The invoice and the shipment have been created. The shipping label cannot be created now."
237236
"You created the invoice and shipment.","You created the invoice and shipment."
238237
"The invoice has been created.","The invoice has been created."
239238
"We can't send the invoice email right now.","We can't send the invoice email right now."

app/code/Magento/Translation/Model/Js/DataProvider.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ class DataProvider implements DataProviderInterface
4646
/**
4747
* Basic translate renderer
4848
*
49-
* @var \Magento\Framework\Phrase\Renderer\Translate
49+
* @var \Magento\Framework\Phrase\RendererInterface
5050
*/
5151
protected $translate;
5252

5353
/**
5454
* @param \Magento\Framework\App\State $appState
5555
* @param Config $config
5656
* @param \Magento\Framework\Filesystem\File\ReadFactory $fileReadFactory
57-
* @param \Magento\Framework\Phrase\Renderer\Translate $translate
57+
* @param \Magento\Framework\Phrase\RendererInterface $translate
5858
* @param \Magento\Framework\Component\ComponentRegistrar $componentRegistrar
5959
* @param \Magento\Framework\Component\DirSearch $dirSearch
6060
* @param \Magento\Framework\View\Design\Theme\ThemePackageList $themePackageList
@@ -64,7 +64,7 @@ public function __construct(
6464
\Magento\Framework\App\State $appState,
6565
Config $config,
6666
\Magento\Framework\Filesystem\File\ReadFactory $fileReadFactory,
67-
\Magento\Framework\Phrase\Renderer\Translate $translate,
67+
\Magento\Framework\Phrase\RendererInterface $translate,
6868
\Magento\Framework\Component\ComponentRegistrar $componentRegistrar,
6969
\Magento\Framework\Component\DirSearch $dirSearch,
7070
\Magento\Framework\View\Design\Theme\ThemePackageList $themePackageList,

app/code/Magento/Ui/Controller/Adminhtml/Index/Render.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public function execute()
8888
} catch (\Exception $e) {
8989
$this->logger->critical($e);
9090
$result = [
91-
'error' => _('UI component could not be rendered because of system exception'),
91+
'error' => __('UI component could not be rendered because of system exception'),
9292
'errorcode' => $this->escaper->escapeHtml($e->getCode())
9393
];
9494
/** @var \Magento\Framework\Controller\Result\Json $resultJson */

app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/main/actions-bar/_store-switcher.less

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,14 @@
4242
max-height: 250px;
4343
overflow-y: auto;
4444
padding-top: .25em;
45+
&::-webkit-scrollbar {
46+
-webkit-appearance: none;
47+
width: 7px;
48+
}
49+
&::-webkit-scrollbar-thumb {
50+
border-radius: 4px;
51+
background-color: rgba(0, 0, 0, .5);
52+
}
4553

4654
li {
4755
border: 0;

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
"ext-dom": "*",
6060
"ext-simplexml": "*",
6161
"ext-mcrypt": "*",
62+
"ext-bcmath": "*",
6263
"ext-hash": "*",
6364
"ext-curl": "*",
6465
"ext-iconv": "*",

0 commit comments

Comments
 (0)