Skip to content

Commit 692d860

Browse files
committed
Add support for 2.3.x
1 parent a1725bf commit 692d860

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

Controller/Adminhtml/Indexer/ReindexOnTheFly.php

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,26 @@
66
*/
77
namespace MagePal\Reindex\Controller\Adminhtml\Indexer;
88

9+
use Exception;
910
use Magento\Backend\App\Action\Context;
11+
use Magento\Framework\Indexer\IndexerInterface;
12+
use Magento\Indexer\Model\IndexerFactory;
13+
use MagePal\Reindex\Controller\Adminhtml\Indexer;
1014

11-
class ReindexOnTheFly extends \MagePal\Reindex\Controller\Adminhtml\Indexer
15+
class ReindexOnTheFly extends Indexer
1216
{
1317

14-
/** @var \Magento\Framework\Indexer\IndexerInterface */
18+
/** @var IndexerInterface */
1519
protected $indexerFactory;
1620

1721
/**
1822
* Index constructor.
1923
* @param Context $context
20-
* @param \Magento\Indexer\Model\IndexerFactory $indexerFactory
24+
* @param IndexerFactory $indexerFactory
2125
*/
2226
public function __construct(
2327
Context $context,
24-
\Magento\Indexer\Model\IndexerFactory $indexerFactory
28+
IndexerFactory $indexerFactory
2529
) {
2630
$this->indexerFactory = $indexerFactory;
2731
parent::__construct($context);
@@ -34,21 +38,19 @@ public function execute()
3438
{
3539
$indexerIds = $this->getRequest()->getParam('indexer_ids');
3640
if (!is_array($indexerIds)) {
37-
$this->messageManager->addError(__('Please select indexers.'));
41+
$this->messageManager->addErrorMessage(__('Please select indexers.'));
3842
} else {
3943
try {
4044
foreach ($indexerIds as $indexerId) {
4145
$indexer = $this->indexerFactory->create();
4246
$indexer->load($indexerId)->reindexAll();
4347
}
4448

45-
$this->messageManager->addSuccess(
49+
$this->messageManager->addSuccessMessage(
4650
__('Reindex %1 indexer(s).', count($indexerIds))
4751
);
48-
} catch (\Magento\Framework\Exception\LocalizedException $e) {
49-
$this->messageManager->addError($e->getMessage());
50-
} catch (\Exception $e) {
51-
$this->messageManager->addException(
52+
} catch (Exception $e) {
53+
$this->messageManager->addExceptionMessage(
5254
$e,
5355
__("We couldn't reindex because of an error.")
5456
);

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
],
1111
"require": {
1212
"php": "~5.6.0|7.0.2|7.0.4|~7.0.6|~7.1.0|~7.1.3|~7.2.0",
13-
"magento/module-backend": "100.0.*|100.1.*|100.2.*|101.0.0",
13+
"magento/module-backend": "100.0.*|100.1.*|100.2.*|101.0.*",
1414
"magento/framework": "100.0.*|100.1.*|101.0.*|102.0.*"
1515
},
1616
"type": "magento2-module",

etc/adminhtml/system.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<group id="about" showInDefault="1" showInStore="1" showInWebsite="1" sortOrder="0" translate="label">
1919
<attribute type="expanded">1</attribute>
2020
<label>About MagePal Reindex</label>
21-
<comment><![CDATA[ <strong>Copyright © 2018 <a href="http://bit.ly/MPEXRI" target="_blank">www.magepal.com</a> / <a href="mailto:support@magepal.com">support@magepal.com</a></strong><br />
21+
<comment><![CDATA[ <strong>Copyright © 2019 <a href="http://bit.ly/MPEXRI" target="_blank">www.magepal.com</a> / <a href="mailto:support@magepal.com">support@magepal.com</a></strong><br />
2222
Discover other must have extensions at <a href="http://bit.ly/MPEXRI" target="_blank">www.magepal.com</a>. Thanks for choosing MagePal Extensions.<br/><br/>
2323
<hr style="border-top: 1px solid #e3e3e3" /> ]]></comment>
2424
<field id="module_version" translate="label" type="label" sortOrder="0" showInDefault="1" showInWebsite="0" showInStore="0">

0 commit comments

Comments
 (0)