Skip to content

Commit 33c6bef

Browse files
merge magento/2.4-develop into magento-tsg/2.4-develop-pr37
2 parents 264a494 + 2cea321 commit 33c6bef

File tree

8 files changed

+35
-11
lines changed

8 files changed

+35
-11
lines changed

app/code/Magento/Catalog/etc/view.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,9 @@
88
<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/view.xsd">
99
<vars module="Magento_Catalog">
1010
<var name="product_image_white_borders">1</var>
11+
<!-- Variable to enable lazy loading for catalog product images without borders.
12+
If you enable this setting your small size images without borders may be stretched in template.
13+
So be sure you have correct image sizes. -->
14+
<var name="enable_lazy_loading_for_images_without_borders">0</var>
1115
</vars>
1216
</view>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
/** @var $block \Magento\Catalog\Block\Product\Image */
99
/** @var $escaper \Magento\Framework\Escaper */
1010
?>
11-
11+
<!--deprecated template as image_with_borders is a primary one-->
1212
<img class="photo image <?= $escaper->escapeHtmlAttr($block->getClass()) ?>"
1313
<?php foreach ($block->getCustomAttributes() as $name => $value): ?>
1414
<?= $escaper->escapeHtmlAttr($name) ?>="<?= $escaper->escapeHtmlAttr($value) ?>"

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

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@
77
<?php
88
/** @var $block \Magento\Catalog\Block\Product\Image */
99
/** @var $escaper \Magento\Framework\Escaper */
10+
/**
11+
* Enable lazy loading for images with borders and if variable enable_lazy_loading_for_images_without_borders
12+
* is enabled in view.xml. Otherwise small size images without borders may be distorted. So max-width is used for them
13+
* to prevent stretching and lazy loading does not work.
14+
*/
15+
$borders = (bool)$block->getVar('product_image_white_borders', 'Magento_Catalog');
16+
$enableLazyLoadingWithoutBorders = (bool)$block->getVar(
17+
'enable_lazy_loading_for_images_without_borders',
18+
'Magento_Catalog'
19+
);
1020
?>
1121

1222
<span class="product-image-container"
@@ -19,7 +29,12 @@
1929
<?php endforeach; ?>
2030
src="<?= $escaper->escapeUrl($block->getImageUrl()) ?>"
2131
loading="lazy"
22-
width="<?= $escaper->escapeHtmlAttr($block->getWidth()) ?>"
23-
height="<?= $escaper->escapeHtmlAttr($block->getHeight()) ?>"
32+
<?php if ($borders || $enableLazyLoadingWithoutBorders): ?>
33+
width="<?= $escaper->escapeHtmlAttr($block->getWidth()) ?>"
34+
height="<?= $escaper->escapeHtmlAttr($block->getHeight()) ?>"
35+
<?php else: ?>
36+
max-width="<?= $escaper->escapeHtmlAttr($block->getWidth()) ?>"
37+
max-height="<?= $escaper->escapeHtmlAttr($block->getHeight()) ?>"
38+
<?php endif; ?>
2439
alt="<?= $escaper->escapeHtmlAttr($block->getLabel()) ?>"/></span>
2540
</span>

app/code/Magento/Customer/view/frontend/layout/customer_account_index.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
</action>
1515
</referenceBlock>
1616
<referenceContainer name="content">
17-
<block class="Magento\Customer\Block\Account\Dashboard\Info" name="customer_account_dashboard_info" as="info" template="Magento_Customer::account/dashboard/info.phtml" cacheable="false"/>
17+
<block class="Magento\Customer\Block\Account\Dashboard\Info" name="customer_account_dashboard_info" as="info" template="Magento_Customer::account/dashboard/info.phtml" cacheable="false">
18+
<container name="customer.account.dashboard.info.blocks" as="additional_blocks"/>
19+
</block>
1820
<block class="Magento\Customer\Block\Account\Dashboard\Address" name="customer_account_dashboard_address" as="address" template="Magento_Customer::account/dashboard/address.phtml" cacheable="false"/>
1921
</referenceContainer>
2022
</body>

app/code/Magento/Customer/view/frontend/templates/account/dashboard/info.phtml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,24 +29,26 @@
2929
</a>
3030
</div>
3131
</div>
32-
<?php if ($block->isNewsletterEnabled()) : ?>
32+
<?php if ($block->isNewsletterEnabled()): ?>
3333
<div class="box box-newsletter">
3434
<strong class="box-title">
3535
<span><?= $block->escapeHtml(__('Newsletters')) ?></span>
3636
</strong>
3737
<div class="box-content">
3838
<p>
39-
<?php if ($block->getIsSubscribed()) : ?>
39+
<?php if ($block->getIsSubscribed()): ?>
4040
<?= $block->escapeHtml(__('You are subscribed to "General Subscription".')) ?>
41-
<?php else : ?>
41+
<?php else: ?>
4242
<?= $block->escapeHtml(__('You aren\'t subscribed to our newsletter.')) ?>
4343
<?php endif; ?>
4444
</p>
4545
</div>
4646
<div class="box-actions">
47-
<a class="action edit" href="<?= $block->escapeUrl($block->getUrl('newsletter/manage')) ?>"><span><?= $block->escapeHtml(__('Edit')) ?></span></a>
47+
<a class="action edit" href="<?= $block->escapeUrl($block->getUrl('newsletter/manage')) ?>">
48+
<span><?= $block->escapeHtml(__('Edit')) ?></span></a>
4849
</div>
4950
</div>
5051
<?php endif; ?>
52+
<?= $block->getChildHtml('additional_blocks'); ?>
5153
</div>
5254
</div>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
<system>
1010
<section id="dev" translate="label" type="text" sortOrder="920" showInDefault="1" showInWebsite="1" showInStore="1">
1111
<group id="js">
12-
<field id="move_script_to_bottom" translate="label" type="select" sortOrder="25" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
12+
<field id="move_script_to_bottom" translate="label" type="select" sortOrder="25" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
1313
<label>Move JS code to the bottom of the page</label>
1414
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
1515
</field>
1616
</group>
1717
<group id="css">
18-
<field id="use_css_critical_path" translate="label comment" type="select" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
18+
<field id="use_css_critical_path" translate="label comment" type="select" sortOrder="30" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
1919
<label>Use CSS critical path</label>
2020
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
2121
<comment>

app/code/Magento/Theme/view/frontend/templates/html/header/criticalCss.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212

1313
<style type="text/css" data-type="criticalCss">
1414
<?= /* @noEscape */ $criticalCssViewModel->getCriticalCssData() ?>
15-
</style>
15+
</style>

dev/tests/api-functional/testsuite/Magento/Integration/Model/AdminTokenServiceTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ class AdminTokenServiceTest extends WebapiAbstract
4949
*/
5050
protected function setUp(): void
5151
{
52+
$this->markTestSkipped('Skipped until MC-34201 is addressed');
5253
$this->_markTestAsRestOnly();
5354
$this->tokenService = Bootstrap::getObjectManager()->get(\Magento\Integration\Model\AdminTokenService::class);
5455
$this->tokenModel = Bootstrap::getObjectManager()->get(\Magento\Integration\Model\Oauth\Token::class);

0 commit comments

Comments
 (0)