8
8
namespace Magento \ImportExport \Plugin ;
9
9
10
10
use Magento \Framework \App \Cache \TypeListInterface ;
11
+ use Magento \Framework \App \RequestInterface ;
11
12
use Magento \Framework \Indexer \DeferredCacheCleanerInterface ;
12
13
use Magento \ImportExport \Model \Import ;
13
14
@@ -29,16 +30,24 @@ class DeferCacheCleaningUntilImportIsComplete
29
30
*/
30
31
private $ cacheTypeList ;
31
32
33
+ /**
34
+ * @var RequestInterface
35
+ */
36
+ private $ request ;
37
+
32
38
/**
33
39
* @param DeferredCacheCleanerInterface $cacheCleaner
34
40
* @param TypeListInterface $cacheTypeList
41
+ * @param RequestInterface $request
35
42
*/
36
43
public function __construct (
37
44
DeferredCacheCleanerInterface $ cacheCleaner ,
38
- TypeListInterface $ cacheTypeList
45
+ TypeListInterface $ cacheTypeList ,
46
+ RequestInterface $ request
39
47
) {
40
48
$ this ->cacheCleaner = $ cacheCleaner ;
41
49
$ this ->cacheTypeList = $ cacheTypeList ;
50
+ $ this ->request = $ request ;
42
51
}
43
52
44
53
/**
@@ -63,8 +72,8 @@ public function beforeImportSource(Import $subject): void
63
72
*/
64
73
public function afterImportSource (Import $ subject , bool $ result ): bool
65
74
{
66
- $ behavior = $ this ->request ->getParam ('behavior ' );
67
- $ entity = $ this ->request ->getParam ('entity ' );
75
+ $ behavior = $ this ->request ->getPost ('behavior ' );
76
+ $ entity = $ this ->request ->getPost ('entity ' );
68
77
$ files = $ this ->request ->getFiles ();
69
78
70
79
if ($ behavior === self ::BEHAVIOR_ADD_UPDATE &&
0 commit comments