Skip to content

Commit 051987f

Browse files
committed
ACP2E-3058: Missing label in LayeredNavigation with option name 0
1 parent 533f57f commit 051987f

File tree

9 files changed

+125
-259
lines changed

9 files changed

+125
-259
lines changed

app/code/Magento/LayeredNavigation/Test/Mftf/ActionGroup/StorefrontLayeredNavigationAttributeOptionActionGroup.xml

Lines changed: 0 additions & 35 deletions
This file was deleted.

app/code/Magento/LayeredNavigation/Test/Mftf/Test/StorefrontMultipleSelectAttributeInLayeredNavigationTest.xml

Lines changed: 0 additions & 128 deletions
This file was deleted.

app/code/Magento/LayeredNavigation/ViewModel/Layer/State.php

Lines changed: 0 additions & 46 deletions
This file was deleted.

app/code/Magento/LayeredNavigation/view/frontend/layout/catalog_category_view_type_layered.xml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,7 @@
1010
<attribute name="class" value="page-with-filter"/>
1111
<referenceContainer name="sidebar.main">
1212
<block class="Magento\LayeredNavigation\Block\Navigation\Category" name="catalog.leftnav" before="-" template="Magento_LayeredNavigation::layer/view.phtml">
13-
<block class="Magento\LayeredNavigation\Block\Navigation\State" name="catalog.navigation.state" as="state" >
14-
<arguments>
15-
<argument name="view_model" xsi:type="object">Magento\LayeredNavigation\ViewModel\Layer\State</argument>
16-
</arguments>
17-
</block>
13+
<block class="Magento\LayeredNavigation\Block\Navigation\State" name="catalog.navigation.state" as="state" />
1814
<block class="Magento\LayeredNavigation\Block\Navigation\FilterRenderer" name="catalog.navigation.renderer" as="renderer" template="Magento_LayeredNavigation::layer/filter.phtml">
1915
<arguments>
2016
<argument name="product_layer_view_model" xsi:type="object">Magento\LayeredNavigation\ViewModel\Layer\Filter</argument>

app/code/Magento/LayeredNavigation/view/frontend/layout/catalogsearch_result_index.xml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,7 @@
1010
<attribute name="class" value="page-with-filter"/>
1111
<referenceContainer name="sidebar.main">
1212
<block class="Magento\LayeredNavigation\Block\Navigation\Search" name="catalogsearch.leftnav" before="-" template="Magento_LayeredNavigation::layer/view.phtml">
13-
<block class="Magento\LayeredNavigation\Block\Navigation\State" name="catalogsearch.navigation.state" as="state" >
14-
<arguments>
15-
<argument name="view_model" xsi:type="object">Magento\LayeredNavigation\ViewModel\Layer\State</argument>
16-
</arguments>
17-
</block>
13+
<block class="Magento\LayeredNavigation\Block\Navigation\State" name="catalogsearch.navigation.state" as="state" />
1814
<block class="Magento\LayeredNavigation\Block\Navigation\FilterRenderer" name="catalogsearch.navigation.renderer" as="renderer" template="Magento_LayeredNavigation::layer/filter.phtml">
1915
<arguments>
2016
<argument name="product_layer_view_model" xsi:type="object">Magento\LayeredNavigation\ViewModel\Layer\Filter</argument>

app/code/Magento/LayeredNavigation/view/frontend/templates/layer/state.phtml

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,45 +8,39 @@
88
/**
99
* Category layered navigation state
1010
*
11-
* @var $escaper \Magento\Framework\Escaper
1211
* @var $block \Magento\LayeredNavigation\Block\Navigation\State
13-
* @var $viewModel \Magento\LayeredNavigation\ViewModel\Layer\State
1412
*/
15-
$viewModel = $block->getViewModel();
1613
?>
1714
<?php $_filters = $block->getActiveFilters() ?>
18-
<?php if (!empty($_filters)): ?>
15+
<?php if (!empty($_filters)) : ?>
1916
<div class="filter-current">
2017
<strong class="block-subtitle filter-current-subtitle"
2118
role="heading"
2219
aria-level="2"
23-
data-count="<?= /* @noEscape */ count($_filters) ?>"><?= $escaper->escapeHtml(__('Now Shopping by')) ?>
24-
</strong>
20+
data-count="<?= /* @noEscape */ count($_filters) ?>"><?= $block->escapeHtml(__('Now Shopping by')) ?></strong>
2521
<ol class="items">
26-
<?php foreach ($_filters as $_filter): ?>
22+
<?php foreach ($_filters as $_filter) : ?>
2723
<li class="item">
28-
<span class="filter-label"><?= $escaper->escapeHtml(__($_filter->getName())) ?></span>
29-
<span class="filter-value"><?= $escaper->escapeHtml($viewModel->stripTags($_filter->getLabel())) ?></span>
24+
<span class="filter-label"><?= $block->escapeHtml(__($_filter->getName())) ?></span>
25+
<span class="filter-value"><?= $block->escapeHtml($block->stripTags($_filter->getLabel())) ?></span>
3026
<?php
3127
$clearLinkUrl = $_filter->getClearLinkUrl();
32-
$currentFilterName = $escaper->escapeHtmlAttr(
33-
__($_filter->getName()) . " " . $block->stripTags($_filter->getLabel())
34-
);
35-
if ($clearLinkUrl):
28+
$currentFilterName = $block->escapeHtmlAttr(__($_filter->getName()) . " " . $block->stripTags($_filter->getLabel()));
29+
if ($clearLinkUrl) :
3630
?>
37-
<a class="action previous" href="<?= $escaper->escapeUrl($_filter->getRemoveUrl()) ?>"
38-
title="<?= $escaper->escapeHtmlAttr(__('Previous')) ?>">
39-
<span><?= $escaper->escapeHtml(__('Previous')) ?></span>
31+
<a class="action previous" href="<?= $block->escapeUrl($_filter->getRemoveUrl()) ?>"
32+
title="<?= $block->escapeHtmlAttr(__('Previous')) ?>">
33+
<span><?= $block->escapeHtml(__('Previous')) ?></span>
4034
</a>
4135
<a class="action remove"
42-
title="<?= $escaper->escapeHtmlAttr($_filter->getFilter()->getClearLinkText()) ?>"
43-
href="<?= $escaper->escapeUrl($clearLinkUrl) ?>">
44-
<span><?= $escaper->escapeHtml($_filter->getFilter()->getClearLinkText()) ?></span>
36+
title="<?= $block->escapeHtmlAttr($_filter->getFilter()->getClearLinkText()) ?>"
37+
href="<?= $block->escapeUrl($clearLinkUrl) ?>">
38+
<span><?= $block->escapeHtml($_filter->getFilter()->getClearLinkText()) ?></span>
4539
</a>
46-
<?php else: ?>
47-
<a class="action remove" href="<?= $escaper->escapeUrl($_filter->getRemoveUrl()) ?>"
48-
title="<?= /* @noEscape */ $escaper->escapeHtmlAttr(__('Remove')) . " " . $currentFilterName ?>">
49-
<span><?= $escaper->escapeHtml(__('Remove This Item')) ?></span>
40+
<?php else : ?>
41+
<a class="action remove" href="<?= $block->escapeUrl($_filter->getRemoveUrl()) ?>"
42+
title="<?= /* @noEscape */ $block->escapeHtmlAttr(__('Remove')) . " " . $currentFilterName ?>">
43+
<span><?= $block->escapeHtml(__('Remove This Item')) ?></span>
5044
</a>
5145
<?php endif; ?>
5246
</li>

0 commit comments

Comments
 (0)