Skip to content

Commit 2689af4

Browse files
author
Yaroslav Onischenko
committed
MAGETWO-51072: Changing Swatch attribute's property doesn't affect storefront
1 parent a5d33d6 commit 2689af4

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

app/code/Magento/Swatches/Plugin/Catalog/CacheInvalidate.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
*/
66
namespace Magento\Swatches\Plugin\Catalog;
77

8+
use \Magento\Framework\App\Cache\Type\Block;
9+
use \Magento\Framework\App\Cache\Type\Collection;
10+
811
class CacheInvalidate
912
{
1013
/**
@@ -39,9 +42,8 @@ public function afterSave(
3942
\Magento\Catalog\Model\ResourceModel\Eav\Attribute $result
4043
) {
4144
if ($this->swatchHelper->isSwatchAttribute($subject)) {
42-
$this->typeList->invalidate('block_html');
43-
$this->typeList->invalidate('collections');
44-
$this->typeList->invalidate('full_page');
45+
$this->typeList->invalidate(Block::TYPE_IDENTIFIER);
46+
$this->typeList->invalidate(Collection::TYPE_IDENTIFIER);
4547
}
4648
return $result;
4749
}

app/code/Magento/Swatches/Test/Unit/Plugin/Catalog/CacheInvalidateTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ public function testAfterSaveSwatch()
6767
->willReturn(true);
6868
$this->typeList->expects($this->at(0))->method('invalidate')->with('block_html');
6969
$this->typeList->expects($this->at(1))->method('invalidate')->with('collections');
70-
$this->typeList->expects($this->at(2))->method('invalidate')->with('full_page');
7170
$this->assertSame($this->attribute, $this->cacheInvalidate->afterSave($this->attribute, $this->attribute));
7271
}
7372

0 commit comments

Comments
 (0)