Skip to content

Commit ae54862

Browse files
author
Alexander Akimov
authored
Merge pull request #2640 from magento-tsg/2.2-develop-pr27
[TSG] Backporting for 2.2 (pr27) (2.2.6)
2 parents e5add7e + 76fa9e2 commit ae54862

File tree

7 files changed

+27
-8
lines changed

7 files changed

+27
-8
lines changed

app/code/Magento/Catalog/view/frontend/templates/product/compare/list.phtml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
?>
1111
<?php $_total = $block->getItems()->getSize() ?>
1212
<?php if ($_total): ?>
13-
<a href="#" class="action print" title="<?= /* @escapeNotVerified */ __('Print This Page') ?>">
13+
<a href="#" class="action print hidden-print" title="<?= /* @escapeNotVerified */ __('Print This Page') ?>">
1414
<span><?= /* @escapeNotVerified */ __('Print This Page') ?></span>
1515
</a>
1616
<div class="table-wrapper comparison">
@@ -29,7 +29,7 @@
2929
<?php if ($_i++ == 0): ?>
3030
<th scope="row" class="cell label remove"><span><?= /* @escapeNotVerified */ __('Remove Product') ?></span></th>
3131
<?php endif; ?>
32-
<td class="cell remove product">
32+
<td class="cell remove product hidden-print">
3333
<?php $compareHelper = $this->helper('Magento\Catalog\Helper\Product\Compare');?>
3434
<a href="#" data-post='<?= /* @escapeNotVerified */ $compareHelper->getPostDataRemove($_item) ?>'
3535
class="action delete" title="<?= /* @escapeNotVerified */ __('Remove Product') ?>">
@@ -59,7 +59,7 @@
5959
</strong>
6060
<?= $block->getReviewsSummaryHtml($_item, 'short') ?>
6161
<?= /* @escapeNotVerified */ $block->getProductPrice($_item, '-compare-list-top') ?>
62-
<div class="product-item-actions">
62+
<div class="product-item-actions hidden-print">
6363
<div class="actions-primary">
6464
<?php if ($_item->isSaleable()): ?>
6565
<form data-role="tocart-form" action="<?= /* @escapeNotVerified */ $this->helper('Magento\Catalog\Helper\Product\Compare')->getAddToCartUrl($_item) ?>" method="post">

app/code/Magento/Eav/Model/Entity/Attribute/Frontend/AbstractFrontend.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ public function getValue(\Magento\Framework\DataObject $object)
165165
$options = $opt->getAllOptions();
166166
if ($options) {
167167
foreach ($options as $option) {
168-
if ($option['value'] == $value) {
168+
if ($option['value'] === $value) {
169169
$valueOption = $option['label'];
170170
}
171171
}

app/design/frontend/Magento/blank/web/css/print.less

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,4 +132,8 @@
132132
.footer.content {
133133
padding: 0;
134134
}
135+
136+
.hidden-print {
137+
display: none !important;
138+
}
135139
}

dev/tests/integration/testsuite/Magento/Catalog/_files/dropdown_attribute.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
'is_filterable_in_search' => 0,
3333
'is_used_for_promo_rules' => 0,
3434
'is_html_allowed_on_front' => 1,
35-
'is_visible_on_front' => 0,
36-
'used_in_product_listing' => 0,
35+
'is_visible_on_front' => 1,
36+
'used_in_product_listing' => 1,
3737
'used_for_sort_by' => 0,
3838
'frontend_label' => ['Drop-Down Attribute'],
3939
'backend_type' => 'varchar',

dev/tests/integration/testsuite/Magento/Eav/Model/Entity/Attribute/Frontend/DefaultFrontendTest.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,21 @@ public function testGetSelectOptions()
7878
);
7979
}
8080

81+
/**
82+
* @magentoDataFixture Magento/Catalog/_files/dropdown_attribute.php
83+
* @return void
84+
*/
85+
public function testAttributeEntityValueNotSet()
86+
{
87+
$entity = $this->objectManager->create(\Magento\Catalog\Model\Product::class);
88+
$entity->setStoreId(0);
89+
$entity->load(1);
90+
$frontEnd = $this->attribute->loadByCode('catalog_product', 'dropdown_attribute');
91+
$value = $frontEnd->getFrontend()->getValue($entity);
92+
93+
$this->assertFalse($value);
94+
}
95+
8196
/**
8297
* Cache key generation
8398
* @return string

dev/tests/static/framework/Magento/TestFramework/Dependency/DiRule.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ private function getPattern()
4040
{
4141
if ($this->pattern === null) {
4242
$this->pattern = '~\b(?<class>(?<module>('
43-
. implode('_|', Files::init()->getNamespaces())
43+
. implode('[_\\\\]|', Files::init()->getNamespaces())
4444
. '[_\\\\])[a-zA-Z0-9]+)[a-zA-Z0-9_\\\\]*)\b~';
4545
}
4646

dev/tests/static/framework/Magento/TestFramework/Dependency/PhpRule.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public function getDependencyInfo($currentModule, $fileType, $file, &$contents)
8989
}
9090

9191
$pattern = '~\b(?<class>(?<module>(' . implode(
92-
'_|',
92+
'[_\\\\]|',
9393
Files::init()->getNamespaces()
9494
) . '[_\\\\])[a-zA-Z0-9]+)[a-zA-Z0-9_\\\\]*)\b~';
9595

0 commit comments

Comments
 (0)