File tree Expand file tree Collapse file tree 2 files changed +9
-18
lines changed Expand file tree Collapse file tree 2 files changed +9
-18
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,9 @@ public function execute(\Magento\Framework\Event\Observer $observer)
50
50
foreach ($ object ->getIdentities () as $ tag ) {
51
51
$ tags [] = sprintf ($ pattern , $ tag );
52
52
}
53
- $ this ->purgeCache ->sendPurgeRequest (implode ('| ' , array_unique ($ tags )));
53
+ if (!empty ($ tags )) {
54
+ $ this ->purgeCache ->sendPurgeRequest (implode ('| ' , array_unique ($ tags )));
55
+ }
54
56
}
55
57
}
56
58
}
Original file line number Diff line number Diff line change @@ -2268,7 +2268,7 @@ public function getIdentities()
2268
2268
$ identities [] = self ::CACHE_PRODUCT_CATEGORY_TAG . '_ ' . $ categoryId ;
2269
2269
}
2270
2270
}
2271
- if ($ this ->getAppState ()->getAreaCode () === ' frontend ' ) {
2271
+ if ($ this ->getAppState ()->getAreaCode () === \ Magento \ Framework \ App \Area:: AREA_FRONTEND ) {
2272
2272
$ identities [] = self ::CACHE_TAG ;
2273
2273
}
2274
2274
return array_unique ($ identities );
@@ -2560,27 +2560,16 @@ public function setId($value)
2560
2560
/**
2561
2561
* Get application state
2562
2562
*
2563
+ * @deprecated
2563
2564
* @return \Magento\Framework\App\State
2564
2565
*/
2565
2566
private function getAppState ()
2566
2567
{
2567
2568
if (!$ this ->appState instanceof \Magento \Framework \App \State) {
2568
- return \Magento \Framework \App \ObjectManager::getInstance ()->get (' Magento\Framework\App\State ' );
2569
- } else {
2570
- return $ this -> appState ;
2569
+ $ this -> appState = \Magento \Framework \App \ObjectManager::getInstance ()->get (
2570
+ \ Magento \ Framework \ App \State::class
2571
+ ) ;
2571
2572
}
2572
- }
2573
-
2574
- /**
2575
- * Set application state
2576
- *
2577
- * @deprecated
2578
- * @param \Magento\Framework\App\State $appState
2579
- * @return $this
2580
- */
2581
- public function setAppState (\Magento \Framework \App \State $ appState )
2582
- {
2583
- $ this ->appState = $ appState ;
2584
- return $ this ;
2573
+ return $ this ->appState ;
2585
2574
}
2586
2575
}
You can’t perform that action at this time.
0 commit comments