Skip to content

Commit 2c70ad8

Browse files
MC-37121: Deleted category still shown as available Category during product creation - restore deleted method.
1 parent f4c52ab commit 2c70ad8

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

lib/internal/Magento/Framework/App/Cache/FlushCacheByTags.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,24 @@ public function __construct(
5555
$this->tagResolver = $tagResolver;
5656
}
5757

58+
/**
59+
* Clean cache on save object
60+
*
61+
* @param AbstractResource $subject
62+
* @param \Closure $proceed
63+
* @param AbstractModel $object
64+
* @return AbstractResource
65+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
66+
*/
67+
public function aroundSave(AbstractResource $subject, \Closure $proceed, AbstractModel $object): AbstractResource
68+
{
69+
$result = $proceed($object);
70+
$tags = $this->tagResolver->getTags($object);
71+
$this->cleanCacheByTags($tags);
72+
73+
return $result;
74+
}
75+
5876
/**
5977
* Clean cache on delete object
6078
*

0 commit comments

Comments
 (0)