Skip to content

Commit 34b3d48

Browse files
author
Roman Ganin
committed
MAGETWO-45195: System message about invalid indexers is misleading
1 parent 180ca97 commit 34b3d48

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

app/code/Magento/Indexer/Model/Message/Invalid.php

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,21 @@ class Invalid implements \Magento\Framework\Notification\MessageInterface
1313
*/
1414
protected $collection;
1515

16+
/**
17+
* @var \Magento\Framework\UrlInterface
18+
*/
19+
protected $urlBuilder;
20+
1621
/**
1722
* @param \Magento\Indexer\Model\Indexer\Collection $collection
23+
* @param \Magento\Framework\UrlInterface $urlBuilder
1824
*/
1925
public function __construct(
20-
\Magento\Indexer\Model\Indexer\Collection $collection
26+
\Magento\Indexer\Model\Indexer\Collection $collection,
27+
\Magento\Framework\UrlInterface $urlBuilder
2128
) {
2229
$this->collection = $collection;
30+
$this->urlBuilder = $urlBuilder;
2331
}
2432

2533
/**
@@ -57,9 +65,14 @@ public function getIdentity()
5765
*/
5866
public function getText()
5967
{
60-
// @codingStandardsIgnoreStart
61-
return __('One or more of the indexers are not valid. Please add Magento cron file to crontab or launch cron.php manually.');
62-
// @codingStandardsIgnoreEnd
68+
$url = $this->urlBuilder->getUrl('indexer/indexer/list');
69+
//@codingStandardsIgnoreStart
70+
return __(
71+
'One or more <a href="%1">indexers are invalid</a>. Make sure your <a href="%2" target="_blank">Magento cron job</a> is running.',
72+
$url,
73+
'http://devdocs.magento.com/guides/v2.0/config-guide/cli/config-cli-subcommands-cron.html#config-cli-cron-bkg'
74+
);
75+
//@codingStandardsIgnoreEnd
6376
}
6477

6578
/**

lib/internal/Magento/Framework/App/Console/Request.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class Request implements \Magento\Framework\App\RequestInterface
2020
public function __construct(array $parameters = [])
2121
{
2222
$data = getopt(null, $parameters);
23-
// It can happen that request comes from http, but it runs the console (e.g. pub/cron.php)
23+
// It can happen that request comes from http, but it runs the console (e.g. bin/magento cron:run)
2424
if ($data) {
2525
$this->setParams($data);
2626
} else {

0 commit comments

Comments
 (0)