Skip to content

Commit fc4d9cc

Browse files
authored
Merge pull request #8108 from magento-l3/PR-L3-2023-01-31
PR-L3-2023-01-31
2 parents 09384df + 5ed0f34 commit fc4d9cc

File tree

51 files changed

+1001
-103
lines changed

Some content is hidden

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

51 files changed

+1001
-103
lines changed

app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Creditmemo.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public function draw()
101101
}
102102

103103
if (!isset($drawItems[$optionId])) {
104-
$drawItems[$optionId] = ['lines' => [], 'height' => 15];
104+
$drawItems[$optionId] = ['lines' => [], 'height' => 20];
105105
}
106106

107107
// draw selection attributes
@@ -112,7 +112,7 @@ public function draw()
112112
'feed' => $x,
113113
];
114114

115-
$drawItems[$optionId] = ['lines' => [$line], 'height' => 15];
115+
$drawItems[$optionId] = ['lines' => [$line], 'height' => 20];
116116

117117
$line = [];
118118
$prevOptionId = $attributes['option_id'];
@@ -199,17 +199,18 @@ public function draw()
199199
if ($option['value']) {
200200
$text = [];
201201
$printValue = $option['print_value'] ?? $this->filterManager->stripTags($option['value']);
202+
$printValue = str_replace(PHP_EOL, ', ', $printValue);
202203
$values = explode(', ', $printValue);
203204
foreach ($values as $value) {
204-
foreach ($this->string->split($value, 30, true, true) as $subValue) {
205+
foreach ($this->string->split($value, 50, true, true) as $subValue) {
205206
$text[] = $subValue;
206207
}
207208
}
208209

209210
$lines[][] = ['text' => $text, 'feed' => $leftBound + 5];
210211
}
211212

212-
$drawItems[] = ['lines' => $lines, 'height' => 15];
213+
$drawItems[] = ['lines' => $lines, 'height' => 20, 'shift' => 5];
213214
}
214215
}
215216

app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Invoice.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ private function drawChildrenItems(): array
105105
}
106106

107107
if (!isset($drawItems[$optionId])) {
108-
$drawItems[$optionId] = ['lines' => [], 'height' => 15];
108+
$drawItems[$optionId] = ['lines' => [], 'height' => 20];
109109
}
110110

111111
if ($childItem->getOrderItem()->getParentItem() && $prevOptionId != $attributes['option_id']) {
@@ -239,17 +239,18 @@ private function drawCustomOptions(array $draw): array
239239
if ($option['value']) {
240240
$text = [];
241241
$printValue = $option['print_value'] ?? $this->filterManager->stripTags($option['value']);
242+
$printValue = str_replace(PHP_EOL, ', ', $printValue);
242243
$values = explode(', ', $printValue);
243244
foreach ($values as $value) {
244-
foreach ($this->string->split($value, 30, true, true) as $subValue) {
245+
foreach ($this->string->split($value, 50, true, true) as $subValue) {
245246
$text[] = $subValue;
246247
}
247248
}
248249

249250
$lines[][] = ['text' => $text, 'feed' => 40];
250251
}
251252

252-
$draw[] = ['lines' => $lines, 'height' => 15];
253+
$draw[] = ['lines' => $lines, 'height' => 20, 'shift' => 5];
253254
}
254255
}
255256

app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Shipment.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public function draw()
9999
}
100100

101101
if (!isset($drawItems[$optionId])) {
102-
$drawItems[$optionId] = ['lines' => [], 'height' => 15];
102+
$drawItems[$optionId] = ['lines' => [], 'height' => 20];
103103
}
104104

105105
if ($childItem->getParentItem() && $prevOptionId != $attributes['option_id']) {
@@ -109,7 +109,7 @@ public function draw()
109109
'feed' => 100,
110110
];
111111

112-
$drawItems[$optionId] = ['lines' => [$line], 'height' => 15];
112+
$drawItems[$optionId] = ['lines' => [$line], 'height' => 20];
113113

114114
$line = [];
115115

@@ -169,23 +169,24 @@ public function draw()
169169
true
170170
),
171171
'font' => 'italic',
172-
'feed' => 60,
172+
'feed' => 110,
173173
];
174174

175175
if ($option['value']) {
176176
$text = [];
177177
$printValue = $option['print_value'] ?? $this->filterManager->stripTags($option['value']);
178+
$printValue = str_replace(PHP_EOL, ', ', $printValue);
178179
$values = explode(', ', $printValue);
179180
foreach ($values as $value) {
180181
foreach ($this->string->split($value, 50, true, true) as $subValue) {
181182
$text[] = $subValue;
182183
}
183184
}
184185

185-
$lines[][] = ['text' => $text, 'feed' => 65];
186+
$lines[][] = ['text' => $text, 'feed' => 115];
186187
}
187188

188-
$drawItems[] = ['lines' => $lines, 'height' => 15];
189+
$drawItems[] = ['lines' => $lines, 'height' => 20, 'shift' => 5];
189190
}
190191
}
191192

app/code/Magento/Bundle/Test/Unit/Model/Sales/Order/Pdf/Items/InvoiceTestProvider.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function getData(): array
2424
'display_both' => [
2525
'expected' => [
2626
1 => [
27-
'height' => 15,
27+
'height' => 20,
2828
'lines' => [
2929
[
3030
[
@@ -176,7 +176,7 @@ public function getData(): array
176176
'including_tax' => [
177177
'expected' => [
178178
1 => [
179-
'height' => 15,
179+
'height' => 20,
180180
'lines' => [
181181
[
182182
[
@@ -251,7 +251,7 @@ public function getData(): array
251251
'excluding_tax' => [
252252
'expected' => [
253253
1 => [
254-
'height' => 15,
254+
'height' => 20,
255255
'lines' => [
256256
[
257257
[

app/code/Magento/Catalog/Controller/Category/View.php

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use Magento\Catalog\Model\Design;
1414
use Magento\Catalog\Model\Layer\Resolver;
1515
use Magento\Catalog\Model\Product\ProductList\ToolbarMemorizer;
16+
use Magento\Catalog\Model\Product\ProductList\Toolbar;
1617
use Magento\Catalog\Model\Session;
1718
use Magento\CatalogUrlRewrite\Model\CategoryUrlPathGenerator;
1819
use Magento\Framework\App\Action\Action;
@@ -22,7 +23,7 @@
2223
use Magento\Framework\App\ActionInterface;
2324
use Magento\Framework\App\ObjectManager;
2425
use Magento\Framework\Controller\Result\ForwardFactory;
25-
use Magento\Framework\Controller\ResultInterface;
26+
use Magento\Framework\Controller\ResultFactory;
2627
use Magento\Framework\DataObject;
2728
use Magento\Framework\Exception\LocalizedException;
2829
use Magento\Framework\Exception\NoSuchEntityException;
@@ -209,6 +210,7 @@ public function execute()
209210
//phpcs:ignore Magento2.Legacy.ObsoleteResponse
210211
return $this->resultRedirectFactory->create()->setUrl($this->_redirect->getRedirectUrl());
211212
}
213+
212214
$category = $this->_initCategory();
213215
if ($category) {
214216
$this->layerResolver->create(Resolver::CATALOG_LAYER_CATEGORY);
@@ -247,6 +249,9 @@ public function execute()
247249
->addBodyClass('categorypath-' . $this->categoryUrlPathGenerator->getUrlPath($category))
248250
->addBodyClass('category-' . $category->getUrlKey());
249251

252+
if ($this->shouldRedirectOnToolbarAction()) {
253+
$this->getResponse()->setRedirect($this->_redirect->getRedirectUrl());
254+
}
250255
return $page;
251256
} elseif (!$this->getResponse()->isRedirect()) {
252257
$result = $this->resultForwardFactory->create()->forward('noroute');
@@ -294,4 +299,21 @@ private function applyLayoutUpdates(
294299
$page->addPageLayoutHandles($settings->getPageLayoutHandles());
295300
}
296301
}
302+
303+
/**
304+
* Checks for toolbar actions
305+
*
306+
* @return bool
307+
*/
308+
private function shouldRedirectOnToolbarAction(): bool
309+
{
310+
$params = $this->getRequest()->getParams();
311+
312+
return $this->toolbarMemorizer->isMemorizingAllowed() && empty(array_intersect([
313+
Toolbar::ORDER_PARAM_NAME,
314+
Toolbar::DIRECTION_PARAM_NAME,
315+
Toolbar::MODE_PARAM_NAME,
316+
Toolbar::LIMIT_PARAM_NAME
317+
], array_keys($params))) === false;
318+
}
297319
}

app/code/Magento/Catalog/Controller/Product/View.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ protected function noProductRedirect()
125125
$resultForward->forward('noroute');
126126
return $resultForward;
127127
}
128+
return $this->getResponse();
128129
}
129130

130131
/**
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AssertMetaDescriptionInProductEditFormActionGroup">
12+
<arguments>
13+
<argument name="productMetaDescription" type="string"/>
14+
</arguments>
15+
<scrollTo selector="{{AdminProductSEOSection.sectionHeader}}" x="0" y="-150" stepKey="scrollToContentSection"/>
16+
<click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickSearchEngineOptimizationTab"/>
17+
<seeInField selector="{{AdminProductSEOSection.metaDescriptionInput}}" userInput="{{productMetaDescription}}" stepKey="seeProductMetaDescription"/>
18+
</actionGroup>
19+
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1484,5 +1484,8 @@
14841484
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
14851485
<requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity>
14861486
</entity>
1487-
1488-
</entities>
1487+
<entity name="ProductWithSpecialCharsInSKU" extends="SimpleProduct" type="product">
1488+
<data key="name">Simple Product with special characters in SKU</data>
1489+
<data key="sku">s000&amp;01</data>
1490+
</entity>
1491+
</entities>
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="AdminSimpleProductSetEditMetaDescriptionContentTest">
12+
<annotations>
13+
<features value="Catalog"/>
14+
<stories value="Create/edit simple product"/>
15+
<title value="Admin should be able to set/edit product Content when editing a simple product. Meta description should be autogenerated."/>
16+
<description value="Admin should be able to set/edit product Content when editing a simple product"/>
17+
<severity value="MINOR"/>
18+
<testCaseId value="AC-6971"/>
19+
<group value="Catalog"/>
20+
<group value="WYSIWYGDisabled"/>
21+
</annotations>
22+
<before>
23+
<!--Admin Login-->
24+
<actionGroup stepKey="loginToAdminPanel" ref="AdminLoginActionGroup"/>
25+
<actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/>
26+
</before>
27+
<after>
28+
<!--Admin Logout-->
29+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
30+
</after>
31+
32+
<!-- Create product -->
33+
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndex"/>
34+
<actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct">
35+
<argument name="product" value="SimpleProduct"/>
36+
</actionGroup>
37+
<actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillProductForm">
38+
<argument name="product" value="SimpleProduct"/>
39+
</actionGroup>
40+
41+
<!--Add content-->
42+
<!--A generic scroll scrolls past this element, in doing this it fails to execute certain actions on the element and others below it. By scrolling slightly above it resolves this issue.-->
43+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="scrollTo"/>
44+
<actionGroup ref="AdminOpenContentSectionOnProductPageActionGroup" stepKey="openDescriptionDropDown"/>
45+
<actionGroup ref="AdminFillInProductDescriptionActionGroup" stepKey="fillLongDescription">
46+
<argument name="description" value="&lt;style&gt;#html-body [data-pb-style=A463JYO]&lt;/style&gt;&lt;div data-content-type='block' data-appearance='default' data-element='main' data-pb-style='B1D1SCO'&gt;{{widget type='Magento\Cms\Block\Widget\Block' template='widget/static_block/default.phtml' block_id='1' type_name='CMS Static Block'}}&lt;/div&gt;&lt;p&gt;HTML description&lt;/p&gt;"/>
47+
</actionGroup>
48+
<actionGroup ref="AdminFillProductNameOnProductFormActionGroup" stepKey="fillProductName">
49+
<argument name="productName" value="simple"/>
50+
</actionGroup>
51+
52+
<!--Checking SEO content admin-->
53+
<actionGroup ref="AssertMetaDescriptionInProductEditFormActionGroup" stepKey="seeProductMetaDescription">
54+
<argument name="productMetaDescription" value="simple HTML description"/>
55+
</actionGroup>
56+
</test>
57+
</tests>

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

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,25 +32,18 @@
3232
<createData entity="RememberPaginationCatalogStorefrontConfig" stepKey="setRememberPaginationCatalogStorefrontConfig"/>
3333
</before>
3434

35-
<actionGroup ref="GoToStorefrontCategoryPageByParametersActionGroup" stepKey="GoToStorefrontCategory1Page">
36-
<argument name="category" value="$$defaultCategory1.custom_attributes[url_key]$$"/>
37-
<argument name="mode" value="grid"/>
38-
<argument name="numOfProductsPerPage" value="12"/>
39-
</actionGroup>
40-
41-
<actionGroup ref="VerifyCategoryPageParametersActionGroup" stepKey="verifyCategory1PageParameters">
42-
<argument name="category" value="$$defaultCategory1$$"/>
43-
<argument name="mode" value="grid"/>
44-
<argument name="numOfProductsPerPage" value="12"/>
45-
</actionGroup>
35+
<amOnPage url="{{StorefrontCategoryPage.url($$defaultCategory1.custom_attributes[url_key]$$)}}" stepKey="GoToStorefrontCategory1Page"/>
36+
<selectOption selector="{{StorefrontCategoryBottomToolbarSection.perPage}}" userInput="24" stepKey="selectPerPageCategory1" />
37+
<waitForPageLoad stepKey="waitForCategory1PageToLoad"/>
38+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="verifyCategory1PageParameters"/>
4639

4740
<amOnPage url="{{StorefrontCategoryPage.url($$defaultCategory2.custom_attributes[url_key]$$)}}" stepKey="navigateToCategory2Page"/>
4841
<waitForPageLoad stepKey="waitForCategory2PageToLoad"/>
4942

5043
<actionGroup ref="VerifyCategoryPageParametersActionGroup" stepKey="verifyCategory2PageParameters">
5144
<argument name="category" value="$$defaultCategory2$$"/>
5245
<argument name="mode" value="grid"/>
53-
<argument name="numOfProductsPerPage" value="12"/>
46+
<argument name="numOfProductsPerPage" value="24"/>
5447
</actionGroup>
5548

5649
<after>

0 commit comments

Comments
 (0)