Skip to content

Commit 6afcc2e

Browse files
committed
AC-14494: No callbacks found for cron job catalog_product_alert
1 parent e5271c3 commit 6afcc2e

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

app/code/Magento/ProductAlert/Model/Mailing/AlertProcessor.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2021 Adobe
4+
* All rights reserved.
55
*/
66
declare(strict_types=1);
77

@@ -128,7 +128,7 @@ public function process(string $alertType, array $customerIds, int $websiteId):
128128
if (!empty($errors)) {
129129
/** @var Website $website */
130130
$website = $this->storeManager->getWebsite($websiteId);
131-
$defaultStoreId = $website->getDefaultStore()->getId();
131+
$defaultStoreId = (int)$website->getDefaultStore()->getId();
132132
$this->errorEmailSender->execute($errors, $defaultStoreId);
133133
}
134134
}

app/code/Magento/ProductAlert/etc/crontab.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?xml version="1.0"?>
22
<!--
33
/**
4-
* Copyright © Magento, Inc. All rights reserved.
5-
* See COPYING.txt for license details.
4+
* Copyright 2021 Adobe
5+
* All rights reserved.
66
*/
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd">
99
<group id="default">
10-
<job name="product_alert" instance="Magento\ProductAlert\Model\Observer" method="process">
10+
<job name="catalog_product_alert" instance="Magento\ProductAlert\Model\Observer" method="process">
1111
<config_path>crontab/default/jobs/catalog_product_alert/schedule/cron_expr</config_path>
1212
</job>
1313
</group>

dev/tests/integration/testsuite/Magento/Cron/Observer/ProcessCronQueueObserverTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2015 Adobe
4+
* All rights reserved.
55
*/
66
namespace Magento\Cron\Observer;
77

@@ -36,7 +36,7 @@ public function testDispatchScheduled()
3636
\Magento\Cron\Model\ResourceModel\Schedule\Collection::class
3737
);
3838
$collection->addFieldToFilter('status', \Magento\Cron\Model\Schedule::STATUS_PENDING);
39-
$collection->addFieldToFilter('job_code', 'product_alert');
39+
$collection->addFieldToFilter('job_code', 'catalog_product_alert');
4040
$this->assertGreaterThan(0, $collection->count(), 'Cron has failed to schedule tasks for itself for future.');
4141
}
4242

0 commit comments

Comments
 (0)