Skip to content

Commit 95fc06f

Browse files
authored
Merge pull request #1 from magento/2.4-develop
allineamento
2 parents 10ab84e + 3e23510 commit 95fc06f

File tree

64 files changed

+922
-1204
lines changed

Some content is hidden

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

64 files changed

+922
-1204
lines changed

app/code/Magento/AuthorizenetGraphQl/Model/AuthorizenetDataProvider.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -49,21 +49,6 @@ public function getData(array $data): array
4949
__('Required parameter "authorizenet_acceptjs" for "payment_method" is missing.')
5050
);
5151
}
52-
if (!isset($data[self::PATH_ADDITIONAL_DATA]['opaque_data_descriptor'])) {
53-
throw new GraphQlInputException(
54-
__('Required parameter "opaque_data_descriptor" for "authorizenet_acceptjs" is missing.')
55-
);
56-
}
57-
if (!isset($data[self::PATH_ADDITIONAL_DATA]['opaque_data_value'])) {
58-
throw new GraphQlInputException(
59-
__('Required parameter "opaque_data_value" for "authorizenet_acceptjs" is missing.')
60-
);
61-
}
62-
if (!isset($data[self::PATH_ADDITIONAL_DATA]['cc_last_4'])) {
63-
throw new GraphQlInputException(
64-
__('Required parameter "cc_last_4" for "authorizenet_acceptjs" is missing.')
65-
);
66-
}
6752

6853
$additionalData = $this->arrayManager->get(static::PATH_ADDITIONAL_DATA, $data);
6954
foreach ($additionalData as $key => $value) {

app/code/Magento/BraintreeGraphQl/Model/BraintreeDataProvider.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,6 @@ public function getData(array $args): array
3131
__('Required parameter "braintree" for "payment_method" is missing.')
3232
);
3333
}
34-
35-
if (!isset($args[self::PATH_ADDITIONAL_DATA]['payment_method_nonce'])) {
36-
throw new GraphQlInputException(
37-
__('Required parameter "payment_method_nonce" for "braintree" is missing.')
38-
);
39-
}
40-
41-
if (!isset($args[self::PATH_ADDITIONAL_DATA]['is_active_payment_token_enabler'])) {
42-
throw new GraphQlInputException(
43-
__('Required parameter "is_active_payment_token_enabler" for "braintree" is missing.')
44-
);
45-
}
46-
4734
return $args[self::PATH_ADDITIONAL_DATA];
4835
}
4936
}

app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDatetimeProductAttributeTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<actionGroup ref="logout" stepKey="logout"/>
2828
</after>
2929
<!-- Generate the datetime default value -->
30-
<generateDate date="now" format="m/j/y g:i A" stepKey="generateDefaultValue"/>
30+
<generateDate date="now" format="n/j/y g:i A" stepKey="generateDefaultValue"/>
3131
<!-- Create new datetime product attribute -->
3232
<amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="goToProductAttributes"/>
3333
<waitForPageLoad stepKey="waitForPageLoadAttributes"/>

app/code/Magento/CatalogGraphQl/etc/graphql/di.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,4 +176,10 @@
176176
</argument>
177177
</arguments>
178178
</type>
179+
180+
<type name="Magento\Catalog\Helper\Data">
181+
<arguments>
182+
<argument name="templateFilterModel" xsi:type="string">Magento\Widget\Model\Template\FilterEmulate</argument>
183+
</arguments>
184+
</type>
179185
</config>

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,11 @@
2828
<label>Create Permanent Redirect for URLs if URL Key Changed</label>
2929
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
3030
</field>
31-
<field id="generate_category_product_rewrites" translate="label" type="select" sortOrder="6" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
31+
<field id="generate_category_product_rewrites" translate="label comment" type="select" sortOrder="6" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
3232
<label>Generate "category/product" URL Rewrites</label>
3333
<backend_model>Magento\CatalogUrlRewrite\Model\TableCleaner</backend_model>
3434
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
35-
<comment>
36-
<![CDATA[<strong style="color:red">Warning!</strong> Turning this option off will result in permanent removal of category/product URL rewrites without an ability to restore them.]]>
37-
</comment>
35+
<comment><![CDATA[<strong style="color:red">Warning!</strong> Turning this option off will result in permanent removal of category/product URL rewrites without an ability to restore them.]]></comment>
3836
<frontend_class>generate_category_product_rewrites</frontend_class>
3937
</field>
4038
</group>

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
"Product URL Suffix","Product URL Suffix"
66
"Use Categories Path for Product URLs","Use Categories Path for Product URLs"
77
"Create Permanent Redirect for URLs if URL Key Changed","Create Permanent Redirect for URLs if URL Key Changed"
8-
"Generate "category/product" URL Rewrites","Generate "category/product" URL Rewrites"
8+
"Generate ""category/product"" URL Rewrites","Generate ""category/product"" URL Rewrites"
99
"URL key ""%1"" matches a reserved endpoint name (%2). Use another URL key.","URL key ""%1"" matches a reserved endpoint name (%2). Use another URL key."
10+
"<strong style=""color:red"">Warning!</strong> Turning this option off will result in permanent removal of category/product URL rewrites without an ability to restore them.","<strong style=""color:red"">Warning!</strong> Turning this option off will result in permanent removal of category/product URL rewrites without an ability to restore them."

app/code/Magento/Customer/Model/ResourceModel/CustomerRepository.php

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use Magento\Customer\Model\Data\CustomerSecureFactory;
1818
use Magento\Customer\Model\Delegation\Data\NewOperation;
1919
use Magento\Customer\Model\Delegation\Storage as DelegatedStorage;
20+
use Magento\Customer\Model\ResourceModel\Customer\Collection;
2021
use Magento\Framework\Api\DataObjectHelper;
2122
use Magento\Framework\Api\ExtensibleDataObjectConverter;
2223
use Magento\Framework\Api\ExtensionAttribute\JoinProcessorInterface;
@@ -31,6 +32,8 @@
3132
/**
3233
* Customer repository.
3334
*
35+
* CRUD operations for customer entity
36+
*
3437
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
3538
* @SuppressWarnings(PHPMD.TooManyFields)
3639
*/
@@ -187,8 +190,7 @@ public function save(CustomerInterface $customer, $passwordHash = null)
187190
{
188191
/** @var NewOperation|null $delegatedNewOperation */
189192
$delegatedNewOperation = !$customer->getId() ? $this->delegatedStorage->consumeNewOperation() : null;
190-
$prevCustomerData = null;
191-
$prevCustomerDataArr = null;
193+
$prevCustomerData = $prevCustomerDataArr = null;
192194
if ($customer->getId()) {
193195
$prevCustomerData = $this->getById($customer->getId());
194196
$prevCustomerDataArr = $prevCustomerData->__toArray();
@@ -214,6 +216,7 @@ public function save(CustomerInterface $customer, $passwordHash = null)
214216
$prevCustomerData ? $prevCustomerData->getStoreId() : $this->storeManager->getStore()->getId()
215217
);
216218
}
219+
$this->setCustomerGroupId($customerModel, $customerArr, $prevCustomerDataArr);
217220
// Need to use attribute set or future updates can cause data loss
218221
if (!$customerModel->getAttributeSetId()) {
219222
$customerModel->setAttributeSetId(CustomerMetadataInterface::ATTRIBUTE_SET_ID_CUSTOMER);
@@ -452,4 +455,18 @@ private function setValidationFlag($customerArray, $customerModel)
452455
$customerModel->setData('ignore_validation_flag', true);
453456
}
454457
}
458+
459+
/**
460+
* Set customer group id
461+
*
462+
* @param Customer $customerModel
463+
* @param array $customerArr
464+
* @param array $prevCustomerDataArr
465+
*/
466+
private function setCustomerGroupId($customerModel, $customerArr, $prevCustomerDataArr)
467+
{
468+
if (!isset($customerArr['group_id']) && $prevCustomerDataArr && isset($prevCustomerDataArr['group_id'])) {
469+
$customerModel->setGroupId($prevCustomerDataArr['group_id']);
470+
}
471+
}
455472
}

app/code/Magento/Customer/Test/Unit/Model/ResourceModel/CustomerRepositoryTest.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ public function testSave()
211211
'setFirstFailure',
212212
'setLockExpires',
213213
'save',
214+
'setGroupId'
214215
]
215216
);
216217

@@ -245,9 +246,15 @@ public function testSave()
245246
$this->customer->expects($this->atLeastOnce())
246247
->method('getId')
247248
->willReturn($customerId);
248-
$this->customer->expects($this->atLeastOnce())
249+
$this->customer->expects($this->at(4))
249250
->method('__toArray')
250251
->willReturn([]);
252+
$this->customer->expects($this->at(3))
253+
->method('__toArray')
254+
->willReturn(['group_id' => 1]);
255+
$customerModel->expects($this->once())
256+
->method('setGroupId')
257+
->with(1);
251258
$this->customerRegistry->expects($this->atLeastOnce())
252259
->method('retrieve')
253260
->with($customerId)

app/code/Magento/Payment/Model/Info.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class Info extends AbstractExtensibleModel implements InfoInterface
3838
* @param \Magento\Framework\Model\Context $context
3939
* @param \Magento\Framework\Registry $registry
4040
* @param \Magento\Framework\Api\ExtensionAttributesFactory $extensionFactory
41-
* @param \Magento\Framework\Api\AttributeValueFactory $customAttributeFactory,
41+
* @param \Magento\Framework\Api\AttributeValueFactory $customAttributeFactory
4242
* @param \Magento\Payment\Helper\Data $paymentData
4343
* @param \Magento\Framework\Encryption\EncryptorInterface $encryptor
4444
* @param \Magento\Framework\Model\ResourceModel\AbstractResource $resource
@@ -188,6 +188,7 @@ public function getAdditionalInformation($key = null)
188188
*/
189189
public function unsAdditionalInformation($key = null)
190190
{
191+
$this->_initAdditionalInformation();
191192
if ($key && isset($this->_additionalInformation[$key])) {
192193
unset($this->_additionalInformation[$key]);
193194
return $this->setData('additional_information', $this->_additionalInformation);

app/code/Magento/Sales/Block/Order/History.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,4 +188,14 @@ public function getBackUrl()
188188
{
189189
return $this->getUrl('customer/account/');
190190
}
191+
192+
/**
193+
* Get message for no orders.
194+
*
195+
* @return \Magento\Framework\Phrase
196+
*/
197+
public function getEmptyOrdersMessage()
198+
{
199+
return __('You have placed no orders.');
200+
}
191201
}

app/code/Magento/Sales/Model/Order/Payment/Info.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ public function getAdditionalInformation($key = null)
192192
*/
193193
public function unsAdditionalInformation($key = null)
194194
{
195+
$this->initAdditionalInformation();
195196
if ($key && isset($this->additionalInformation[$key])) {
196197
unset($this->additionalInformation[$key]);
197198
return $this->setData('additional_information', $this->additionalInformation);

app/code/Magento/Sales/view/frontend/templates/order/history.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,5 @@
5959
<div class="order-products-toolbar toolbar bottom"><?= $block->getPagerHtml() ?></div>
6060
<?php endif ?>
6161
<?php else : ?>
62-
<div class="message info empty"><span><?= $block->escapeHtml(__('You have placed no orders.')) ?></span></div>
62+
<div class="message info empty"><span><?= $block->escapeHtml($block->getEmptyOrdersMessage()) ?></span></div>
6363
<?php endif ?>

app/code/Magento/Theme/view/frontend/templates/html/pager.phtml

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,33 @@
1010
* @see \Magento\Theme\Block\Html\Pager
1111
*/
1212
?>
13-
<?php if ($block->getCollection()->getSize()) : ?>
13+
<?php if ($block->getCollection()->getSize()): ?>
1414

15-
<?php if ($block->getUseContainer()) : ?>
15+
<?php if ($block->getUseContainer()): ?>
1616
<div class="pager">
1717
<?php endif ?>
1818

19-
<?php if ($block->getShowAmounts()) : ?>
19+
<?php if ($block->getShowAmounts()): ?>
2020
<p class="toolbar-amount">
2121
<span class="toolbar-number">
22-
<?php if ($block->getLastPageNum()>1) : ?>
23-
<?= $block->escapeHtml(__('Items %1 to %2 of %3 total', $block->getFirstNum(), $block->getLastNum(), $block->getTotalNum())) ?>
24-
<?php elseif ($block->getTotalNum() == 1) : ?>
22+
<?php if ($block->getLastPageNum()>1): ?>
23+
<?= $block->escapeHtml(
24+
__('Items %1 to %2 of %3 total', $block->getFirstNum(), $block->getLastNum(), $block->getTotalNum())
25+
) ?>
26+
<?php elseif ($block->getTotalNum() == 1): ?>
2527
<?= $block->escapeHtml(__('%1 Item', $block->getTotalNum())) ?>
26-
<?php else : ?>
28+
<?php else: ?>
2729
<?= $block->escapeHtml(__('%1 Item(s)', $block->getTotalNum())) ?>
2830
<?php endif; ?>
2931
</span>
3032
</p>
3133
<?php endif ?>
3234

33-
<?php if ($block->getLastPageNum()>1) : ?>
35+
<?php if ($block->getLastPageNum()>1): ?>
3436
<div class="pages">
3537
<strong class="label pages-label" id="paging-label"><?= $block->escapeHtml(__('Page')) ?></strong>
3638
<ul class="items pages-items" aria-labelledby="paging-label">
37-
<?php if (!$block->isFirstPage()) : ?>
39+
<?php if (!$block->isFirstPage()): ?>
3840
<li class="item pages-item-previous">
3941
<?php $text = $block->getAnchorTextForPrevious() ? $block->getAnchorTextForPrevious() : '';?>
4042
<a class="<?= $block->escapeHtmlAttr($text ? 'link ' : 'action ') ?> previous"
@@ -46,7 +48,7 @@
4648
</li>
4749
<?php endif;?>
4850

49-
<?php if ($block->canShowFirst()) : ?>
51+
<?php if ($block->canShowFirst()): ?>
5052
<li class="item">
5153
<a class="page first" href="<?= $block->escapeUrl($block->getFirstPageUrl()) ?>">
5254
<span class="label"><?= $block->escapeHtml(__('Page')) ?></span>
@@ -55,7 +57,7 @@
5557
</li>
5658
<?php endif;?>
5759

58-
<?php if ($block->canShowPreviousJump()) : ?>
60+
<?php if ($block->canShowPreviousJump()): ?>
5961
<li class="item">
6062
<a class="page previous jump"
6163
title=""
@@ -65,15 +67,15 @@
6567
</li>
6668
<?php endif;?>
6769

68-
<?php foreach ($block->getFramePages() as $_page) : ?>
69-
<?php if ($block->isPageCurrent($_page)) : ?>
70+
<?php foreach ($block->getFramePages() as $_page): ?>
71+
<?php if ($block->isPageCurrent($_page)): ?>
7072
<li class="item current">
7173
<strong class="page">
7274
<span class="label"><?= $block->escapeHtml(__('You\'re currently reading page')) ?></span>
7375
<span><?= $block->escapeHtml($_page) ?></span>
7476
</strong>
7577
</li>
76-
<?php else : ?>
78+
<?php else: ?>
7779
<li class="item">
7880
<a href="<?= $block->escapeUrl($block->getPageUrl($_page)) ?>" class="page">
7981
<span class="label"><?= $block->escapeHtml(__('Page')) ?></span>
@@ -83,15 +85,15 @@
8385
<?php endif;?>
8486
<?php endforeach;?>
8587

86-
<?php if ($block->canShowNextJump()) : ?>
88+
<?php if ($block->canShowNextJump()): ?>
8789
<li class="item">
8890
<a class="page next jump" title="" href="<?= $block->escapeUrl($block->getNextJumpUrl()) ?>">
8991
<span>...</span>
9092
</a>
9193
</li>
9294
<?php endif;?>
9395

94-
<?php if ($block->canShowLast()) : ?>
96+
<?php if ($block->canShowLast()): ?>
9597
<li class="item">
9698
<a class="page last" href="<?= $block->escapeUrl($block->getLastPageUrl()) ?>">
9799
<span class="label"><?= $block->escapeHtml(__('Page')) ?></span>
@@ -100,7 +102,7 @@
100102
</li>
101103
<?php endif;?>
102104

103-
<?php if (!$block->isLastPage()) : ?>
105+
<?php if (!$block->isLastPage()): ?>
104106
<li class="item pages-item-next">
105107
<?php $text = $block->getAnchorTextForNext() ? $block->getAnchorTextForNext() : '';?>
106108
<a class="<?= /* @noEscape */ $text ? 'link ' : 'action ' ?> next"
@@ -115,13 +117,13 @@
115117
</div>
116118
<?php endif; ?>
117119

118-
<?php if ($block->isShowPerPage()) : ?>
120+
<?php if ($block->isShowPerPage()): ?>
119121
<div class="limiter">
120122
<strong class="limiter-label"><?= $block->escapeHtml(__('Show')) ?></strong>
121123
<select id="limiter" data-mage-init='{"redirectUrl": {"event":"change"}}' class="limiter-options">
122-
<?php foreach ($block->getAvailableLimit() as $_key => $_limit) : ?>
123-
<option value="<?= $block->escapeHtmlAttr($block->getLimitUrl($_key)) ?>"
124-
<?php if ($block->isLimitCurrent($_key)) : ?>
124+
<?php foreach ($block->getAvailableLimit() as $_key => $_limit): ?>
125+
<option value="<?= $block->escapeUrl($block->getLimitUrl($_key)) ?>"
126+
<?php if ($block->isLimitCurrent($_key)): ?>
125127
selected="selected"<?php endif ?>>
126128
<?= $block->escapeHtml($_limit) ?>
127129
</option>
@@ -131,7 +133,7 @@
131133
</div>
132134
<?php endif ?>
133135

134-
<?php if ($block->getUseContainer()) : ?>
136+
<?php if ($block->getUseContainer()): ?>
135137
</div>
136138
<?php endif ?>
137139

0 commit comments

Comments
 (0)