Skip to content

Commit 2f04078

Browse files
author
Vaha
committed
Merge branch '2.4-develop' into 26240-improved-map-for-swatches
2 parents 2d2f1e0 + f2aa57e commit 2f04078

File tree

45 files changed

+346
-1114
lines changed

Some content is hidden

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

45 files changed

+346
-1114
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/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/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

app/code/Magento/UrlRewrite/Controller/Router.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ protected function processRedirect($request, $rewrite)
118118
if ($rewrite->getEntityType() !== Rewrite::ENTITY_TYPE_CUSTOM
119119
|| ($prefix = substr($target, 0, 6)) !== 'http:/' && $prefix !== 'https:'
120120
) {
121-
$target = $this->url->getUrl('', ['_direct' => $target]);
121+
$target = $this->url->getUrl('', ['_direct' => $target, '_query' => $request->getParams()]);
122122
}
123123
return $this->redirect($request, $target, $rewrite->getRedirectType());
124124
}

app/code/Magento/UrlRewrite/Test/Unit/Controller/RouterTest.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ public function testNoRewriteAfterStoreSwitcherWhenOldRewriteEqualsToNewOne()
260260
*/
261261
public function testMatchWithRedirect()
262262
{
263+
$queryParams = [];
263264
$this->storeManager->expects($this->any())->method('getStore')->will($this->returnValue($this->store));
264265
$urlRewrite = $this->getMockBuilder(UrlRewrite::class)
265266
->disableOriginalConstructor()->getMock();
@@ -268,7 +269,11 @@ public function testMatchWithRedirect()
268269
$this->urlFinder->expects($this->any())->method('findOneByData')->will($this->returnValue($urlRewrite));
269270
$this->response->expects($this->once())->method('setRedirect')
270271
->with('new-target-path', 'redirect-code');
271-
$this->url->expects($this->once())->method('getUrl')->with('', ['_direct' => 'target-path'])
272+
$this->request->expects($this->once())->method('getParams')->willReturn($queryParams);
273+
$this->url->expects($this->once())->method('getUrl')->with(
274+
'',
275+
['_direct' => 'target-path', '_query' => $queryParams]
276+
)
272277
->will($this->returnValue('new-target-path'));
273278
$this->request->expects($this->once())->method('setDispatched')->with(true);
274279
$this->actionFactory->expects($this->once())->method('create')
@@ -282,15 +287,20 @@ public function testMatchWithRedirect()
282287
*/
283288
public function testMatchWithCustomInternalRedirect()
284289
{
290+
$queryParams = [];
285291
$this->storeManager->expects($this->any())->method('getStore')->will($this->returnValue($this->store));
286292
$urlRewrite = $this->getMockBuilder(UrlRewrite::class)
287293
->disableOriginalConstructor()->getMock();
288294
$urlRewrite->expects($this->any())->method('getEntityType')->will($this->returnValue('custom'));
289295
$urlRewrite->expects($this->any())->method('getRedirectType')->will($this->returnValue('redirect-code'));
290296
$urlRewrite->expects($this->any())->method('getTargetPath')->will($this->returnValue('target-path'));
291297
$this->urlFinder->expects($this->any())->method('findOneByData')->will($this->returnValue($urlRewrite));
298+
$this->request->expects($this->any())->method('getParams')->willReturn($queryParams);
292299
$this->response->expects($this->once())->method('setRedirect')->with('a', 'redirect-code');
293-
$this->url->expects($this->once())->method('getUrl')->with('', ['_direct' => 'target-path'])->willReturn('a');
300+
$this->url->expects($this->once())->method('getUrl')->with(
301+
'',
302+
['_direct' => 'target-path', '_query' => $queryParams]
303+
)->willReturn('a');
294304
$this->request->expects($this->once())->method('setDispatched')->with(true);
295305
$this->actionFactory->expects($this->once())->method('create')
296306
->with(\Magento\Framework\App\Action\Redirect::class);
@@ -312,6 +322,7 @@ public function testMatchWithCustomExternalRedirect($targetPath)
312322
$urlRewrite->expects($this->any())->method('getTargetPath')->will($this->returnValue($targetPath));
313323
$this->urlFinder->expects($this->any())->method('findOneByData')->will($this->returnValue($urlRewrite));
314324
$this->response->expects($this->once())->method('setRedirect')->with($targetPath, 'redirect-code');
325+
$this->request->expects($this->never())->method('getParams');
315326
$this->url->expects($this->never())->method('getUrl');
316327
$this->request->expects($this->once())->method('setDispatched')->with(true);
317328
$this->actionFactory->expects($this->once())->method('create')

0 commit comments

Comments
 (0)