File tree Expand file tree Collapse file tree 6 files changed +66
-12
lines changed
app/code/Magento/Customer
lib/internal/Magento/Framework/Mview/View Expand file tree Collapse file tree 6 files changed +66
-12
lines changed Original file line number Diff line number Diff line change 1
1
<?php
2
2
/**
3
- * Copyright © Magento, Inc. All rights reserved.
4
- * See COPYING.txt for license details .
3
+ * Copyright 2011 Adobe
4
+ * All Rights Reserved .
5
5
*/
6
6
namespace Magento \Customer \Model ;
7
7
@@ -371,7 +371,9 @@ public function reindex()
371
371
{
372
372
/** @var \Magento\Framework\Indexer\IndexerInterface $indexer */
373
373
$ indexer = $ this ->indexerRegistry ->get (Customer::CUSTOMER_GRID_INDEXER_ID );
374
- $ indexer ->reindexRow ($ this ->getCustomerId ());
374
+ if (!$ indexer ->isScheduled ()) {
375
+ $ indexer ->reindexRow ($ this ->getCustomerId ());
376
+ }
375
377
}
376
378
377
379
/**
Original file line number Diff line number Diff line change @@ -1127,7 +1127,9 @@ public function afterDeleteCommit()
1127
1127
*/
1128
1128
public function reindex ()
1129
1129
{
1130
- $ this ->getIndexer ()->reindexRow ($ this ->getId ());
1130
+ if (!$ this ->getIndexer ()->isScheduled ()) {
1131
+ $ this ->getIndexer ()->reindexRow ($ this ->getId ());
1132
+ }
1131
1133
}
1132
1134
1133
1135
/**
Original file line number Diff line number Diff line change 1
1
<?xml version =" 1.0" ?>
2
2
<!--
3
3
/**
4
- * Copyright © Magento, Inc. All rights reserved.
5
- * See COPYING.txt for license details .
4
+ * Copyright 2013 Adobe
5
+ * All Rights Reserved .
6
6
*/
7
7
-->
8
8
<config xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" xsi : noNamespaceSchemaLocation =" urn:magento:framework:ObjectManager/etc/config.xsd" >
593
593
type =" Magento\Customer\Plugin\AsyncRequestCustomerGroupAuthorization"
594
594
/>
595
595
</type >
596
+ <virtualType name =" Magento\Customer\Model\MviewAction" type =" \Magento\Framework\Mview\View\BaseAction" >
597
+ <arguments >
598
+ <argument name =" indexerId" xsi : type =" string" >customer_grid</argument >
599
+ </arguments >
600
+ </virtualType >
596
601
</config >
Original file line number Diff line number Diff line change 1
1
<?xml version =" 1.0" ?>
2
2
<!--
3
3
/**
4
- * Copyright © Magento, Inc. All rights reserved.
5
- * See COPYING.txt for license details .
4
+ * Copyright 2015 Adobe
5
+ * All Rights Reserved .
6
6
*/
7
7
-->
8
8
<config xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
9
9
xsi : noNamespaceSchemaLocation =" urn:magento:framework:Indexer/etc/indexer.xsd" >
10
- <indexer id =" customer_grid" view_id =" customer_dummy " class =" Magento\Framework\Indexer\Action\Entity" primary =" customer" >
10
+ <indexer id =" customer_grid" view_id =" customer_grid_flat " class =" Magento\Framework\Indexer\Action\Entity" primary =" customer" >
11
11
<title translate =" true" >Customer Grid</title >
12
12
<description translate =" true" >Rebuild Customer grid index</description >
13
13
Original file line number Diff line number Diff line change 1
1
<?xml version =" 1.0" encoding =" UTF-8" ?>
2
2
<!--
3
3
/**
4
- * Copyright © Magento, Inc. All rights reserved.
5
- * See COPYING.txt for license details .
4
+ * Copyright 2015 Adobe
5
+ * All Rights Reserved .
6
6
*/
7
7
-->
8
8
<config xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" xsi : noNamespaceSchemaLocation =" urn:magento:framework:Mview/etc/mview.xsd" >
9
- <view id =" customer_dummy" class =" Magento\Framework\Indexer\Action\Dummy" group =" indexer" />
9
+ <view id =" customer_grid_flat" class =" Magento\Customer\Model\MviewAction" group =" indexer" >
10
+ <subscriptions >
11
+ <table name =" customer_entity" entity_column =" entity_id" />
12
+ <table name =" customer_entity_datetime" entity_column =" entity_id" />
13
+ <table name =" customer_entity_decimal" entity_column =" entity_id" />
14
+ <table name =" customer_entity_int" entity_column =" entity_id" />
15
+ <table name =" customer_address_entity" entity_column =" parent_id" />
16
+ </subscriptions >
17
+ </view >
10
18
</config >
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Copyright 2025 Adobe
4
+ * All Rights Reserved.
5
+ */
6
+ namespace Magento \Framework \Mview \View ;
7
+
8
+ use Magento \Framework \Indexer \IndexerRegistry ;
9
+
10
+ /**
11
+ * Action the use indexer to reindex items
12
+ */
13
+ class BaseAction implements \Magento \Framework \Mview \ActionInterface
14
+ {
15
+ /**
16
+ * @param IndexerRegistry $indexerRegistry
17
+ * @param string $indexerId
18
+ */
19
+ public function __construct (
20
+ private IndexerRegistry $ indexerRegistry ,
21
+ private string $ indexerId
22
+ ) {
23
+ }
24
+
25
+ /**
26
+ * Execute materialization on ids entities
27
+ *
28
+ * @param int[] $ids
29
+ * @return void
30
+ */
31
+ public function execute ($ ids )
32
+ {
33
+ /** @var \Magento\Framework\Indexer\IndexerInterface $indexer */
34
+ $ indexer = $ this ->indexerRegistry ->get ($ this ->indexerId );
35
+ $ indexer ->reindexList ($ ids );
36
+ }
37
+ }
You can’t perform that action at this time.
0 commit comments