typeList = $typeList; $this->swatchHelper = $swatchHelper; } /** * @param \Magento\Catalog\Model\ResourceModel\Eav\Attribute $subject * @param \Magento\Catalog\Model\ResourceModel\Eav\Attribute $result * @return \Magento\Catalog\Model\ResourceModel\Eav\Attribute */ public function afterSave( \Magento\Catalog\Model\ResourceModel\Eav\Attribute $subject, \Magento\Catalog\Model\ResourceModel\Eav\Attribute $result ) { if ($this->swatchHelper->isSwatchAttribute($subject)) { $this->typeList->invalidate(Block::TYPE_IDENTIFIER); $this->typeList->invalidate(Collection::TYPE_IDENTIFIER); } return $result; } }