Skip to content

Commit

Permalink
Invalidate block_html cache when backend CSS saved.
Browse files Browse the repository at this point in the history
  • Loading branch information
tangar76 committed Feb 3, 2020
1 parent b6b1022 commit 39c6ee2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Observer/Backend/ThemeEditorConfigSave.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ class ThemeEditorConfigSave implements \Magento\Framework\Event\ObserverInterfac
public function __construct(
\Swissup\ThemeEditor\Model\CssFactory $cssModelFactory,
\Magento\Store\Model\ResourceModel\Store\CollectionFactory $storesFactory,
\Magento\Framework\App\ResourceConnection $coreResource
\Magento\Framework\App\ResourceConnection $coreResource,
\Magento\Framework\App\Cache\TypeListInterface $cacheTypeList
) {
$this->cssModelFactory = $cssModelFactory;
$this->storesFactory = $storesFactory;
$this->coreResource = $coreResource;
$this->cacheTypeList = $cacheTypeList;
}

public function execute(\Magento\Framework\Event\Observer $observer)
Expand Down Expand Up @@ -62,6 +64,9 @@ public function execute(\Magento\Framework\Event\Observer $observer)
}
}
}

// Invalidate block_html cache to get new version of backend styles.
$this->cacheTypeList->invalidate(\Magento\Framework\App\Cache\Type\Block::TYPE_IDENTIFIER);
}

/**
Expand Down

0 comments on commit 39c6ee2

Please sign in to comment.