Skip to content

Commit 10311b0

Browse files
ENGCOM-4234: [Backport] Solved swagger response of product attribute option is_default #21164
- Merge Pull Request #21164 from mage2pratik/magento2:2.2-develop-PR-port-20913 - Merged commits: 1. 11cafc3 2. c1f3f36
2 parents b803b12 + c1f3f36 commit 10311b0

File tree

52 files changed

+973
-3779
lines changed

Some content is hidden

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

52 files changed

+973
-3779
lines changed

app/code/Magento/Backend/Controller/Adminhtml/System/Design/Save.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
*/
77
namespace Magento\Backend\Controller\Adminhtml\System\Design;
88

9+
/**
10+
* Save design action.
11+
*/
912
class Save extends \Magento\Backend\Controller\Adminhtml\System\Design
1013
{
1114
/**
@@ -26,6 +29,8 @@ protected function _filterPostData($data)
2629
}
2730

2831
/**
32+
* Save design action.
33+
*
2934
* @return \Magento\Backend\Model\View\Result\Redirect
3035
*/
3136
public function execute()
@@ -54,10 +59,10 @@ public function execute()
5459
} catch (\Exception $e) {
5560
$this->messageManager->addErrorMessage($e->getMessage());
5661
$this->_objectManager->get(\Magento\Backend\Model\Session::class)->setDesignData($data);
57-
return $resultRedirect->setPath('adminhtml/*/', ['id' => $design->getId()]);
62+
return $resultRedirect->setPath('*/*/edit', ['id' => $design->getId()]);
5863
}
5964
}
6065

61-
return $resultRedirect->setPath('adminhtml/*/');
66+
return $resultRedirect->setPath('*/*/');
6267
}
6368
}

app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/CustomOptions.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use Magento\Catalog\Model\Config\Source\Product\Options\Price as ProductOptionsPrice;
1212
use Magento\Framework\UrlInterface;
1313
use Magento\Framework\Stdlib\ArrayManager;
14+
use Magento\Ui\Component\Form\Element\Hidden;
1415
use Magento\Ui\Component\Modal;
1516
use Magento\Ui\Component\Container;
1617
use Magento\Ui\Component\DynamicRows;
@@ -867,10 +868,9 @@ protected function getPositionFieldConfig($sortOrder)
867868
'data' => [
868869
'config' => [
869870
'componentType' => Field::NAME,
870-
'formElement' => Input::NAME,
871+
'formElement' => Hidden::NAME,
871872
'dataScope' => static::FIELD_SORT_ORDER_NAME,
872873
'dataType' => Number::NAME,
873-
'visible' => false,
874874
'sortOrder' => $sortOrder,
875875
],
876876
],

app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/General.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,8 +361,10 @@ protected function customizeNameListeners(array $meta)
361361
'allowImport' => !$this->locator->getProduct()->getId(),
362362
];
363363

364-
if (!in_array($listener, $textListeners)) {
365-
$importsConfig['elementTmpl'] = 'ui/form/element/input';
364+
if (in_array($listener, $textListeners)) {
365+
$importsConfig['cols'] = 15;
366+
$importsConfig['rows'] = 2;
367+
$importsConfig['elementTmpl'] = 'ui/form/element/textarea';
366368
}
367369

368370
$meta = $this->arrayManager->merge($listenerPath . static::META_CONFIG_PATH, $meta, $importsConfig);

app/code/Magento/Catalog/view/adminhtml/ui_component/product_listing.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,13 @@
190190
<label translate="true">Websites</label>
191191
</settings>
192192
</column>
193+
<column name="cost" class="Magento\Catalog\Ui\Component\Listing\Columns\Price" sortOrder="120">
194+
<settings>
195+
<addField>true</addField>
196+
<filter>textRange</filter>
197+
<label translate="true">Cost</label>
198+
</settings>
199+
</column>
193200
<actionsColumn name="actions" class="Magento\Catalog\Ui\Component\Listing\Columns\ProductActions" sortOrder="200">
194201
<settings>
195202
<indexField>entity_id</indexField>

app/code/Magento/Catalog/view/frontend/templates/product/view/addtocart.phtml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
<input type="number"
2121
name="qty"
2222
id="qty"
23+
min="0"
2324
value="<?= /* @escapeNotVerified */ $block->getProductDefaultQty() * 1 ?>"
2425
title="<?= /* @escapeNotVerified */ __('Qty') ?>"
2526
class="input-text qty"

app/code/Magento/Checkout/view/frontend/templates/cart/item/configure/updatecart.phtml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
<input type="number"
2121
name="qty"
2222
id="qty"
23+
min="0"
2324
value=""
2425
title="<?= /* @escapeNotVerified */ __('Qty') ?>"
2526
class="input-text qty"

app/code/Magento/CheckoutAgreements/Model/ResourceModel/Agreement/Grid/Collection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ private function getStoresForAgreements()
6363

6464
if (!empty($agreementId)) {
6565
$select = $this->getConnection()->select()->from(
66-
['agreement_store' => 'checkout_agreement_store']
66+
['agreement_store' => $this->getResource()->getTable('checkout_agreement_store')]
6767
)->where(
6868
'agreement_store.agreement_id IN (?)',
6969
$agreementId

app/code/Magento/Customer/Model/Vat.php

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,18 +179,21 @@ public function checkVatNumber($countryCode, $vatNumber, $requesterCountryCode =
179179
return $gatewayResponse;
180180
}
181181

182+
$countryCodeForVatNumber = $this->getCountryCodeForVatNumber($countryCode);
183+
$requesterCountryCodeForVatNumber = $this->getCountryCodeForVatNumber($requesterCountryCode);
184+
182185
try {
183186
$soapClient = $this->createVatNumberValidationSoapClient();
184187

185188
$requestParams = [];
186-
$requestParams['countryCode'] = $countryCode;
189+
$requestParams['countryCode'] = $countryCodeForVatNumber;
187190
$vatNumberSanitized = $this->isCountryInEU($countryCode)
188-
? str_replace([' ', '-', $countryCode], ['', '', ''], $vatNumber)
191+
? str_replace([' ', '-', $countryCodeForVatNumber], ['', '', ''], $vatNumber)
189192
: str_replace([' ', '-'], ['', ''], $vatNumber);
190193
$requestParams['vatNumber'] = $vatNumberSanitized;
191-
$requestParams['requesterCountryCode'] = $requesterCountryCode;
194+
$requestParams['requesterCountryCode'] = $requesterCountryCodeForVatNumber;
192195
$reqVatNumSanitized = $this->isCountryInEU($requesterCountryCode)
193-
? str_replace([' ', '-', $requesterCountryCode], ['', '', ''], $requesterVatNumber)
196+
? str_replace([' ', '-', $requesterCountryCodeForVatNumber], ['', '', ''], $requesterVatNumber)
194197
: str_replace([' ', '-'], ['', ''], $requesterVatNumber);
195198
$requestParams['requesterVatNumber'] = $reqVatNumSanitized;
196199
// Send request to service
@@ -301,4 +304,22 @@ public function isCountryInEU($countryCode, $storeId = null)
301304
);
302305
return in_array($countryCode, $euCountries);
303306
}
307+
308+
/**
309+
* Returns the country code to use in the VAT number which is not always the same as the normal country code
310+
*
311+
* @param string $countryCode
312+
* @return string
313+
*/
314+
private function getCountryCodeForVatNumber(string $countryCode): string
315+
{
316+
// Greece uses a different code for VAT numbers then its country code
317+
// See: http://ec.europa.eu/taxation_customs/vies/faq.html#item_11
318+
// And https://en.wikipedia.org/wiki/VAT_identification_number:
319+
// "The full identifier starts with an ISO 3166-1 alpha-2 (2 letters) country code
320+
// (except for Greece, which uses the ISO 639-1 language code EL for the Greek language,
321+
// instead of its ISO 3166-1 alpha-2 country code GR)"
322+
323+
return $countryCode === 'GR' ? 'EL' : $countryCode;
324+
}
304325
}

app/code/Magento/GroupedProduct/view/frontend/templates/product/view/type/grouped.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
</thead>
3434

3535
<?php if ($_hasAssociatedProducts): ?>
36-
<?php foreach ($_associatedProducts as $_item): ?>
3736
<tbody>
37+
<?php foreach ($_associatedProducts as $_item): ?>
3838
<tr>
3939
<td data-th="<?= $block->escapeHtml(__('Product Name')) ?>" class="col item">
4040
<strong class="product-item-name"><?= $block->escapeHtml($_item->getName()) ?></strong>
@@ -80,8 +80,8 @@
8080
</td>
8181
</tr>
8282
<?php endif; ?>
83-
</tbody>
8483
<?php endforeach; ?>
84+
</tbody>
8585
<?php else: ?>
8686
<tbody>
8787
<tr>

app/code/Magento/Ui/view/base/web/templates/grid/filters/elements/ui-select.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
class="action-select admin__action-multiselect"
3737
data-role="advanced-select"
3838
data-bind="
39-
css: {_active: multiselectFocus},
39+
css: {_active: listVisible},
4040
click: function(data, event) {
4141
toggleListVisible(data, event)
4242
}
@@ -52,7 +52,7 @@
5252
class="action-select admin__action-multiselect"
5353
data-role="advanced-select"
5454
data-bind="
55-
css: {_active: multiselectFocus},
55+
css: {_active: listVisible},
5656
click: function(data, event) {
5757
toggleListVisible(data, event)
5858
}

0 commit comments

Comments
 (0)