File tree Expand file tree Collapse file tree 4 files changed +7
-5
lines changed
CatalogSearch/Model/Indexer/Fulltext/Model/Plugin
dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Category Expand file tree Collapse file tree 4 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -1159,9 +1159,10 @@ public function reindex()
1159
1159
*/
1160
1160
public function afterDeleteCommit ()
1161
1161
{
1162
- if ($ this ->getIsActive ()) {
1162
+ if ($ this ->getIsActive () || $ this -> getDeletedChildrenIds () ) {
1163
1163
$ this ->reindex ();
1164
1164
}
1165
+
1165
1166
return parent ::afterDeleteCommit ();
1166
1167
}
1167
1168
Original file line number Diff line number Diff line change @@ -232,9 +232,10 @@ protected function _beforeDelete(\Magento\Framework\DataObject $object)
232
232
*/
233
233
protected function _afterDelete (DataObject $ object )
234
234
{
235
- if ($ object ->getIsActive ()) {
235
+ if ($ object ->getIsActive () || $ object -> getDeletedChildrenIds () ) {
236
236
$ this ->indexerProcessor ->markIndexerAsInvalid ();
237
237
}
238
+
238
239
return parent ::_afterDelete ($ object );
239
240
}
240
241
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ public function __construct(Processor $fulltextIndexerProcessor)
40
40
*/
41
41
public function afterDelete (Resource $ subjectCategory , Resource $ resultCategory , DataObject $ object ) : Resource
42
42
{
43
- if ($ object ->getIsActive ()) {
43
+ if ($ object ->getIsActive () || $ object -> getDeletedChildrenIds () ) {
44
44
$ this ->fulltextIndexerProcessor ->markIndexerAsInvalid ();
45
45
}
46
46
Original file line number Diff line number Diff line change @@ -196,15 +196,15 @@ public function testCategoryDelete()
196
196
public function testDeleteInactiveCategory (): void
197
197
{
198
198
$ this ->indexer ->reindexAll ();
199
- $ indexerShouldBeValid = $ this ->indexer ->isInvalid ();
199
+ $ isInvalidIndexer = $ this ->indexer ->isInvalid ();
200
200
201
201
$ this ->categoryRepository ->deleteByIdentifier (4 );
202
202
203
203
$ state = $ this ->indexer ->getState ();
204
204
$ state ->loadByIndexer ($ this ->indexer ->getId ());
205
205
$ status = $ state ->getStatus ();
206
206
207
- $ this ->assertFalse ($ indexerShouldBeValid );
207
+ $ this ->assertFalse ($ isInvalidIndexer );
208
208
$ this ->assertEquals (StateInterface::STATUS_VALID , $ status );
209
209
}
210
210
You can’t perform that action at this time.
0 commit comments