File tree Expand file tree Collapse file tree 3 files changed +12
-4
lines changed
CatalogSearch/Model/Indexer/Fulltext/Model/Plugin Expand file tree Collapse file tree 3 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -1159,7 +1159,9 @@ public function reindex()
1159
1159
*/
1160
1160
public function afterDeleteCommit ()
1161
1161
{
1162
- $ this ->reindex ();
1162
+ if ($ this ->getIsActive ()) {
1163
+ $ this ->reindex ();
1164
+ }
1163
1165
return parent ::afterDeleteCommit ();
1164
1166
}
1165
1167
Original file line number Diff line number Diff line change @@ -232,7 +232,9 @@ protected function _beforeDelete(\Magento\Framework\DataObject $object)
232
232
*/
233
233
protected function _afterDelete (DataObject $ object )
234
234
{
235
- $ this ->indexerProcessor ->markIndexerAsInvalid ();
235
+ if ($ object ->getIsActive ()) {
236
+ $ this ->indexerProcessor ->markIndexerAsInvalid ();
237
+ }
236
238
return parent ::_afterDelete ($ object );
237
239
}
238
240
Original file line number Diff line number Diff line change 9
9
10
10
use Magento \Catalog \Model \ResourceModel \Category as Resource ;
11
11
use Magento \CatalogSearch \Model \Indexer \Fulltext \Processor ;
12
+ use Magento \Framework \DataObject ;
12
13
13
14
/**
14
15
* Perform indexer invalidation after a category delete.
@@ -33,12 +34,15 @@ public function __construct(Processor $fulltextIndexerProcessor)
33
34
*
34
35
* @param Resource $subjectCategory
35
36
* @param Resource $resultCategory
37
+ * @param DataObject $object
36
38
* @return Resource
37
39
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
38
40
*/
39
- public function afterDelete (Resource $ subjectCategory , Resource $ resultCategory ) : Resource
41
+ public function afterDelete (Resource $ subjectCategory , Resource $ resultCategory, DataObject $ object ) : Resource
40
42
{
41
- $ this ->fulltextIndexerProcessor ->markIndexerAsInvalid ();
43
+ if ($ object ->getIsActive ()) {
44
+ $ this ->fulltextIndexerProcessor ->markIndexerAsInvalid ();
45
+ }
42
46
43
47
return $ resultCategory ;
44
48
}
You can’t perform that action at this time.
0 commit comments