Skip to content

Commit a45d23c

Browse files
MC-25269: Upgrade from 2.3.x CE with SD to 2.3.x EE fails
- move trigger updates from recurring data to recurring schema
1 parent 3e23510 commit a45d23c

File tree

2 files changed

+16
-57
lines changed

2 files changed

+16
-57
lines changed

app/code/Magento/Indexer/Setup/Recurring.php

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@
66

77
namespace Magento\Indexer\Setup;
88

9+
use Magento\Framework\App\ObjectManager;
910
use Magento\Framework\Encryption\Encryptor;
1011
use Magento\Framework\Encryption\EncryptorInterface;
1112
use Magento\Framework\Indexer\StateInterface;
1213
use Magento\Framework\Json\EncoderInterface;
1314
use Magento\Framework\Setup\InstallSchemaInterface;
1415
use Magento\Framework\Setup\ModuleContextInterface;
1516
use Magento\Framework\Setup\SchemaSetupInterface;
17+
use Magento\Framework\Indexer\IndexerInterfaceFactory;
1618
use Magento\Framework\Indexer\ConfigInterface;
1719
use Magento\Indexer\Model\Indexer\State;
1820
use Magento\Indexer\Model\Indexer\StateFactory;
@@ -51,6 +53,11 @@ class Recurring implements InstallSchemaInterface
5153
*/
5254
private $stateFactory;
5355

56+
/**
57+
* @var IndexerInterfaceFactory
58+
*/
59+
private $indexerFactory;
60+
5461
/**
5562
* Init
5663
*
@@ -59,19 +66,22 @@ class Recurring implements InstallSchemaInterface
5966
* @param ConfigInterface $config
6067
* @param EncryptorInterface $encryptor
6168
* @param EncoderInterface $encoder
69+
* @param IndexerInterfaceFactory|null $indexerFactory
6270
*/
6371
public function __construct(
6472
CollectionFactory $statesFactory,
6573
StateFactory $stateFactory,
6674
ConfigInterface $config,
6775
EncryptorInterface $encryptor,
68-
EncoderInterface $encoder
76+
EncoderInterface $encoder,
77+
IndexerInterfaceFactory $indexerFactory = null
6978
) {
7079
$this->statesFactory = $statesFactory;
7180
$this->stateFactory = $stateFactory;
7281
$this->config = $config;
7382
$this->encryptor = $encryptor;
7483
$this->encoder = $encoder;
84+
$this->indexerFactory = $indexerFactory ?: ObjectManager::getInstance()->get(IndexerInterfaceFactory::class);
7585
}
7686

7787
/**
@@ -107,6 +117,11 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con
107117
$state->setStatus(StateInterface::STATUS_INVALID);
108118
$state->save();
109119
}
120+
121+
$indexer = $this->indexerFactory->create()->load($indexerId);
122+
if ($indexer->isScheduled()) {
123+
$indexer->getView()->unsubscribe()->subscribe();
124+
}
110125
}
111126
}
112127
}

app/code/Magento/Indexer/Setup/RecurringData.php

Lines changed: 0 additions & 56 deletions
This file was deleted.

0 commit comments

Comments
 (0)