Skip to content

Commit 39e1300

Browse files
🔃 [Magento Community Engineering] Community Contributions - 2.4-develop
Accepted Community Pull Requests: - #33452: #28239: resize command does not process hidden images (by @BogdanGorbach) - #33163: Update CONTRIBUTING.md (by @manavluhar) - #31969: [ReadMe] updated readMe file for NewRelicReporting-OfflineShipping modules (by @vlmed) - #33256: 32977 Fixed text area for Customizable Options on the Checkout Cart Page (by @AZiniukhin) - #33368: Fix overlap customer address edit text (by @mrtuvn) - #33341: MFTF: Print Packing Slips Without Created Shipment Test (by @DmitryTsymbal) - #33136: MFTF: Checkout With Minimum Order Amount Option Enabled Test (by @DmitryTsymbal) - #33097: #33094 Renamed confusing store select labels - Login As Customer (by @vovsky) - #33088: 32911 fixed product import with url key with spaces (by @SilinMykola) - #32927: Fix overlap display issue in cms page privacy theme luma (by @mrtuvn) - #28927: [vcl] don't set TTL to 0 (by @gquintard) Fixed GitHub Issues: - #28239: php bin/magento catalog:images:resize does not process hidden images. (reported by @gwharton) has been fixed in #33452 by @BogdanGorbach in 2.4-develop branch Related commits: 1. c35cd1f 2. d16ee89 3. 788b2fc - #33456: [Issue] Update CONTRIBUTING.md (reported by @m2-assistant[bot]) has been fixed in #33163 by @manavluhar in 2.4-develop branch Related commits: 1. 9703a56 - #4451: Fix for admin shipment, creditmemo, invoice pdf emulation (reported by @ksz2013) has been fixed in #31969 by @vlmed in 2.4-develop branch Related commits: 1. fad5e61 - #33404: [Issue] [ReadMe] updated readMe file for NewRelicReporting-OfflineShipping modules (reported by @m2-assistant[bot]) has been fixed in #31969 by @vlmed in 2.4-develop branch Related commits: 1. fad5e61 - #32977: Text Area for Customizable Options shows line break html<br/> on the front end in cart area if a user enters more than 55 characters (reported by @adamstapley) has been fixed in #33256 by @AZiniukhin in 2.4-develop branch Related commits: 1. f724fec 2. a3bf297 3. b506bb4 - #33357: Backend > Customers > Cannot edit an address when French language is selected (reported by @MarianneCA) has been fixed in #33368 by @mrtuvn in 2.4-develop branch Related commits: 1. a1a7dd2 - #33345: [Issue] MFTF: Print Packing Slips Without Created Shipment Test (reported by @m2-assistant[bot]) has been fixed in #33341 by @DmitryTsymbal in 2.4-develop branch Related commits: 1. e40d4b3 - #33460: [Issue] MFTF: Checkout With Minimum Order Amount Option Enabled Test (reported by @m2-assistant[bot]) has been fixed in #33136 by @DmitryTsymbal in 2.4-develop branch Related commits: 1. e79c0b2 - #33094: Rename confusing store select labels at admin login as customers related config and modal window (reported by @Den4ik) has been fixed in #33097 by @vovsky in 2.4-develop branch Related commits: 1. 4c26dfa 2. ae6a2a8 - #32911: CSV product import does not format url key when `url_key` column is used (reported by @rikwillems) has been fixed in #33088 by @SilinMykola in 2.4-develop branch Related commits: 1. a7b9176 - #32926: CMS menu issue - Luma Theme (reported by @addison74) has been fixed in #32927 by @mrtuvn in 2.4-develop branch Related commits: 1. 7f1092e
2 parents 77bfde9 + 9e9235c commit 39e1300

File tree

33 files changed

+966
-83
lines changed

33 files changed

+966
-83
lines changed

.github/CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ This will allow you to collaborate with the Magento 2 development team, fork the
3333
1. Search current [listed issues](https://github.com/magento/magento2/issues) (open or closed) for similar proposals of intended contribution before starting work on a new contribution.
3434
2. Review the [Contributor License Agreement](https://opensource.adobe.com/cla.html) if this is your first time contributing.
3535
3. Create and test your work.
36-
4. Fork the Magento 2 repository according to the [Fork A Repository instructions](https://devdocs.magento.com/guides/v2.4/contributor-guide/contributing.html#fork) and when you are ready to send us a pull request – follow the [Create A Pull Request instructions](https://devdocs.magento.com/guides/v2.4/contributor-guide/contributing.html#pull_request).
36+
4. Follow the [Forks And Pull Requests Instructions](https://devdocs.magento.com/contributor-guide/contributing.html#forks-and-pull-requests) to fork the Magento 2 repository and send us a pull request.
3737
5. Once your contribution is received the Magento 2 development team will review the contribution and collaborate with you as needed.
3838

3939
## Code of Conduct
@@ -43,6 +43,6 @@ The full text is available in the repository [Wiki](https://github.com/magento/m
4343

4444
## Connecting with Community!
4545

46-
If you have any questions, join us in [#beginners](https://magentocommeng.slack.com/messages/CH8BGFX9D) Slack chat. If you are not on our slack, [click here](http://tinyurl.com/engcom-slack) to join.
46+
If you have any questions, join us in [#beginners](https://magentocommeng.slack.com/archives/CH8BGFX9D) Slack chat. If you are not on our slack, [click here](http://tinyurl.com/engcom-slack) to join.
4747

4848
Need to find a project? Check out the [Slack Channels](https://github.com/magento/magento2/wiki/Slack-Channels) (with listed project info) and the [Magento Community Portal](https://opensource.magento.com/).

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1432,4 +1432,18 @@
14321432
<data key="name" unique="suffix">ProductWithSku24MB06-</data>
14331433
<data key="sku" unique="suffix">24 MB06 </data>
14341434
</entity>
1435+
<entity name="SimpleProduct50" type="product">
1436+
<data key="name" unique="suffix">Simple Product </data>
1437+
<data key="sku" unique="suffix">SimpleProduct</data>
1438+
<data key="urlKey" unique="suffix">simple-product-</data>
1439+
<data key="type_id">simple</data>
1440+
<data key="attribute_set_id">4</data>
1441+
<data key="price">50.00</data>
1442+
<data key="visibility">4</data>
1443+
<data key="status">1</data>
1444+
<data key="quantity">1000</data>
1445+
<data key="weight">1</data>
1446+
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
1447+
<requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity>
1448+
</entity>
14351449
</entities>

app/code/Magento/CatalogImportExport/Model/Import/Product.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3019,7 +3019,7 @@ protected function getUrlKey($rowData)
30193019
{
30203020
if (!empty($rowData[self::URL_KEY])) {
30213021
$urlKey = (string) $rowData[self::URL_KEY];
3022-
return trim(strtolower($urlKey));
3022+
return $this->productUrl->formatUrlKey($urlKey);
30233023
}
30243024

30253025
if (!empty($rowData[self::COL_NAME])
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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="AssertStorefrontProceedToCheckoutButtonDisabledActionGroup">
12+
<seeElement selector="{{CheckoutCartSummarySection.proceedToCheckoutDisabled}}" stepKey="assertCheckoutBtnDisabled"/>
13+
</actionGroup>
14+
</actionGroups>

app/code/Magento/Checkout/Test/Mftf/Section/CheckoutCartSummarySection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,6 @@
3737
<element name="shippingPrice" type="text" selector="#co-shipping-method-form span .price"/>
3838
<element name="shippingMethodElementId" type="radio" selector="#s_method_{{carrierCode}}_{{methodCode}}" parameterized="true" timeout="30"/>
3939
<element name="estimateShippingAndTaxForm" type="block" selector="#shipping-zip-form"/>
40+
<element name="proceedToCheckoutDisabled" type="button" selector=".action.primary.checkout.disabled" timeout="60"/>
4041
</section>
4142
</sections>
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
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="StorefrontCheckoutWithEnabledMinimumOrderAmountOptionTest">
12+
<annotations>
13+
<features value="Sales"/>
14+
<stories value="Order Placement With Enabled Minimum Order Amount Option"/>
15+
<title value="Minimum Order Amount Option Enabled for Checkout"/>
16+
<description value="Customer should not be able to place an order with if minimum order amount was not reached"/>
17+
<severity value="MAJOR"/>
18+
<group value="checkout"/>
19+
</annotations>
20+
<before>
21+
<magentoCLI command="config:set {{EnableMinimumOrderAmountConfigData.path}} {{EnableMinimumOrderAmountConfigData.value}}" stepKey="enableMinimumOrderAmount"/>
22+
<magentoCLI command="config:set {{SetMinimumOrderAmount100ConfigData.path}} {{SetMinimumOrderAmount100ConfigData.value}}" stepKey="setMinimumOrderAmount100"/>
23+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
24+
<createData entity="SimpleSubCategory" stepKey="createCategory"/>
25+
<createData entity="SimpleProduct50" stepKey="createProduct">
26+
<requiredEntity createDataKey="createCategory"/>
27+
</createData>
28+
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanInvalidatedCaches">
29+
<argument name="tags" value="config full_page"/>
30+
</actionGroup>
31+
</before>
32+
<after>
33+
<magentoCLI command="config:set {{DisableMinimumOrderAmountConfigData.path}} {{DisableMinimumOrderAmountConfigData.value}}" stepKey="disableMinimumOrderAmount"/>
34+
<magentoCLI command="config:set {{SetDefaultMinimumOrderAmountConfigData.path}} {{SetDefaultMinimumOrderAmountConfigData.value}}" stepKey="setMinimumOrderAmountDefaultValue"/>
35+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
36+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
37+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer"/>
38+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
39+
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanInvalidatedCaches">
40+
<argument name="tags" value="config full_page"/>
41+
</actionGroup>
42+
</after>
43+
44+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount">
45+
<argument name="Customer" value="$createCustomer$"/>
46+
</actionGroup>
47+
<actionGroup ref="OpenProductFromCategoryPageActionGroup" stepKey="openProductFromCategory">
48+
<argument name="category" value="$createCategory$"/>
49+
<argument name="product" value="$createProduct$"/>
50+
</actionGroup>
51+
<actionGroup ref="StorefrontAddProductToCartWithQtyActionGroup" stepKey="addProductToTheCart">
52+
<argument name="productQty" value="1"/>
53+
</actionGroup>
54+
<actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="navigateToCartPage"/>
55+
<actionGroup ref="AssertMessageCustomerChangeAccountInfoActionGroup" stepKey="assertMessage">
56+
<argument name="message" value="Minimum order amount is $100.00"/>
57+
<argument name="messageType" value="notice"/>
58+
</actionGroup>
59+
<actionGroup ref="AssertStorefrontProceedToCheckoutButtonDisabledActionGroup" stepKey="assertCheckoutBtnDisabled"/>
60+
<actionGroup ref="OpenProductFromCategoryPageActionGroup" stepKey="navigateToProductPage">
61+
<argument name="category" value="$createCategory$"/>
62+
<argument name="product" value="$createProduct$"/>
63+
</actionGroup>
64+
<actionGroup ref="StorefrontAddProductToCartWithQtyActionGroup" stepKey="addSecondProductToTheCart">
65+
<argument name="productQty" value="1"/>
66+
</actionGroup>
67+
<actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="openShoppingCartPage"/>
68+
<actionGroup ref="StorefrontClickProceedToCheckoutActionGroup" stepKey="goToCheckout"/>
69+
<actionGroup ref="CheckoutSelectFlatRateShippingMethodActionGroup" stepKey="selectFlatRate"/>
70+
<actionGroup ref="StorefrontCheckoutForwardFromShippingStepActionGroup" stepKey="goToReview"/>
71+
<actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyOrder"/>
72+
<actionGroup ref="CheckoutPlaceOrderActionGroup" stepKey="clickOnPlaceOrder">
73+
<argument name="orderNumberMessage" value="CONST.successCheckoutOrderNumberMessage"/>
74+
<argument name="emailYouMessage" value="CONST.successCheckoutEmailYouMessage"/>
75+
</actionGroup>
76+
</test>
77+
</tests>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ $canApplyMsrp = $helper->isShowBeforeOrderConfirm($product) && $helper->isMinima
4848
<dt><?= $block->escapeHtml($_option['label']) ?></dt>
4949
<dd>
5050
<?php if (isset($_formatedOptionValue['full_view'])) :?>
51-
<?= $block->escapeHtml($_formatedOptionValue['full_view']) ?>
51+
<?= $block->escapeHtml($_formatedOptionValue['full_view'], ['span', 'a']) ?>
5252
<?php else :?>
5353
<?= $block->escapeHtml($_formatedOptionValue['value'], ['span', 'a']) ?>
5454
<?php endif; ?>

app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminCustomerConfigSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
<element name="loginAsCustomerSettingsHead" type="text" selector="#login_as_customer_general-head" timeout="30"/>
1414
<element name="enableExtensionLabel" type="text" selector="//span[contains(text(),'Enable Extension') and contains(@data-config-scope,'[GLOBAL]')]" timeout="30"/>
1515
<element name="disablePageCacheLabel" type="text" selector="//span[contains(text(),'Disable Page Cache For Admin User') and contains(@data-config-scope,'[GLOBAL]')]" timeout="30"/>
16-
<element name="storeViewToLoginToLabel" type="text" selector="//span[contains(text(),'Store View To Login To') and contains(@data-config-scope,'[GLOBAL]')]" timeout="30"/>
16+
<element name="storeViewToLoginToLabel" type="text" selector="//span[contains(text(),'Store To Login To') and contains(@data-config-scope,'[GLOBAL]')]" timeout="30"/>
1717
</section>
1818
</sections>

app/code/Magento/LoginAsCustomerAdminUi/Controller/Adminhtml/Login/Login.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ public function execute(): ResultInterface
200200
if ($this->config->isStoreManualChoiceEnabled()) {
201201
$storeId = (int)$this->_request->getParam('store_id');
202202
if (empty($storeId)) {
203-
$messages[] = __('Please select a Store View to login in.');
203+
$messages[] = __('Please select a Store to login in.');
204204
return $this->prepareJsonResult($messages);
205205
}
206206
} elseif ($this->share->isGlobalScope()) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
2020
</field>
2121
<field id="store_view_manual_choice_enabled" translate="label comment" type="select" sortOrder="40" showInDefault="1" canRestore="1">
22-
<label>Store View To Login To</label>
22+
<label>Store To Login To</label>
2323
<source_model>Magento\LoginAsCustomerAdminUi\Model\Config\Source\StoreViewLogin</source_model>
2424
<comment><![CDATA[
2525
Use the "Manual Selection" option on a multi-website setup that has "Share Customer Accounts" enabled globally.

app/code/Magento/LoginAsCustomerAdminUi/view/adminhtml/web/js/confirmation-popup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ define([
3636
data: {
3737
showStoreViewOptions: self.showStoreViewOptions,
3838
storeViewOptions: self.storeViewOptions,
39-
label: $t('Store View')
39+
label: $t('Store')
4040
}
4141
}) + content;
4242
}

app/code/Magento/MediaStorage/Console/Command/ImagesResizeCommand.php

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
use Symfony\Component\Console\Output\OutputInterface;
1919
use Symfony\Component\Console\Input\InputOption;
2020
use Symfony\Component\Console\Command\Command;
21-
use Magento\Catalog\Model\ResourceModel\Product\Image as ProductImage;
21+
2222

2323
/**
2424
* Resizes product images according to theme view definitions.
@@ -30,6 +30,11 @@ class ImagesResizeCommand extends Command
3030
*/
3131
const ASYNC_RESIZE = 'async';
3232

33+
/**
34+
* Do not process images marked as hidden from product page
35+
*/
36+
const SKIP_HIDDEN_IMAGES = 'skip_hidden_images';
37+
3338
/**
3439
* @var ImageResizeScheduler
3540
*/
@@ -51,31 +56,28 @@ class ImagesResizeCommand extends Command
5156
private $progressBarFactory;
5257

5358
/**
54-
* @var ProductImage
59+
* @var bool
5560
*/
56-
private $productImage;
61+
private $skipHiddenImages = false;
5762

5863
/**
5964
* @param State $appState
6065
* @param ImageResize $imageResize
6166
* @param ImageResizeScheduler $imageResizeScheduler
6267
* @param ProgressBarFactory $progressBarFactory
63-
* @param ProductImage $productImage
6468
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
6569
*/
6670
public function __construct(
6771
State $appState,
6872
ImageResize $imageResize,
6973
ImageResizeScheduler $imageResizeScheduler,
70-
ProgressBarFactory $progressBarFactory,
71-
ProductImage $productImage
74+
ProgressBarFactory $progressBarFactory
7275
) {
7376
parent::__construct();
7477
$this->appState = $appState;
7578
$this->imageResize = $imageResize;
7679
$this->imageResizeScheduler = $imageResizeScheduler;
7780
$this->progressBarFactory = $progressBarFactory;
78-
$this->productImage = $productImage;
7981
}
8082

8183
/**
@@ -102,6 +104,12 @@ private function getOptionsList() : array
102104
InputOption::VALUE_NONE,
103105
'Resize image in asynchronous mode'
104106
),
107+
new InputOption(
108+
self::SKIP_HIDDEN_IMAGES,
109+
null,
110+
InputOption::VALUE_NONE,
111+
'Do not process images marked as hidden from product page'
112+
),
105113
];
106114
}
107115

@@ -112,6 +120,7 @@ private function getOptionsList() : array
112120
*/
113121
protected function execute(InputInterface $input, OutputInterface $output)
114122
{
123+
$this->skipHiddenImages = $input->getOption(self::SKIP_HIDDEN_IMAGES);
115124
$result = $input->getOption(self::ASYNC_RESIZE) ?
116125
$this->executeAsync($output) : $this->executeSync($output);
117126

@@ -129,7 +138,7 @@ private function executeSync(OutputInterface $output): int
129138
try {
130139
$errors = [];
131140
$this->appState->setAreaCode(Area::AREA_GLOBAL);
132-
$generator = $this->imageResize->resizeFromThemes();
141+
$generator = $this->imageResize->resizeFromThemes(null, $this->skipHiddenImages);
133142

134143
/** @var ProgressBar $progress */
135144
$progress = $this->progressBarFactory->create(
@@ -194,7 +203,7 @@ private function executeAsync(OutputInterface $output): int
194203
$progress = $this->progressBarFactory->create(
195204
[
196205
'output' => $output,
197-
'max' => $this->productImage->getCountUsedProductImages()
206+
'max' => $this->imageResize->getCountProductImages($this->skipHiddenImages)
198207
]
199208
);
200209
$progress->setFormat(
@@ -205,7 +214,7 @@ private function executeAsync(OutputInterface $output): int
205214
$progress->setOverwrite(false);
206215
}
207216

208-
$productImages = $this->productImage->getUsedProductImages();
217+
$productImages = $this->imageResize->getProductImages($this->skipHiddenImages);
209218
foreach ($productImages as $image) {
210219
$result = $this->imageResizeScheduler->schedule($image['filepath']);
211220

app/code/Magento/MediaStorage/Service/ImageResize.php

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,17 +171,18 @@ public function resizeFromImageName(string $originalImageName)
171171
* Create resized images of different sizes from themes.
172172
*
173173
* @param array|null $themes
174+
* @param bool $skipHiddenImages
174175
* @return Generator
175176
* @throws NotFoundException
176177
*/
177-
public function resizeFromThemes(array $themes = null): Generator
178+
public function resizeFromThemes(array $themes = null, bool $skipHiddenImages = false): Generator
178179
{
179-
$count = $this->productImage->getCountUsedProductImages();
180+
$count = $this->getCountProductImages($skipHiddenImages);
180181
if (!$count) {
181182
throw new NotFoundException(__('Cannot resize images - product images not found'));
182183
}
183184

184-
$productImages = $this->productImage->getUsedProductImages();
185+
$productImages = $this->getProductImages($skipHiddenImages);
185186
$viewImages = $this->getViewImages($themes ?? $this->getThemesInUse());
186187

187188
foreach ($productImages as $image) {
@@ -210,6 +211,26 @@ public function resizeFromThemes(array $themes = null): Generator
210211
}
211212
}
212213

214+
/**
215+
* @param bool $skipHiddenImages
216+
* @return int
217+
*/
218+
public function getCountProductImages(bool $skipHiddenImages = false): int
219+
{
220+
return $skipHiddenImages ?
221+
$this->productImage->getCountUsedProductImages() : $this->productImage->getCountAllProductImages();
222+
}
223+
224+
/**
225+
* @param bool $skipHiddenImages
226+
* @return Generator
227+
*/
228+
public function getProductImages(bool $skipHiddenImages = false): \Generator
229+
{
230+
return $skipHiddenImages ?
231+
$this->productImage->getUsedProductImages() : $this->productImage->getAllProductImages();
232+
}
233+
213234
/**
214235
* Search the current theme.
215236
*

0 commit comments

Comments
 (0)