Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Model/Config/CatalogCron.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
use Magento\Framework\App\Config\Value;
use Magento\Framework\App\Config\ValueFactory;
use Magento\Framework\Data\Collection\AbstractDb;
use Magento\Framework\Exception\LocalizedException;
use Magento\Framework\Model\Context;
use Magento\Framework\Model\ResourceModel\AbstractResource;
use Magento\Framework\Registry;
use Exception;

class CatalogCron extends Value
{
Expand All @@ -38,7 +38,7 @@ public function __construct(
?AbstractResource $resource = null,
?AbstractDb $resourceCollection = null,
string $modelPath = '',
protected string $expression = 'groups/catalog/fields/product_translation_cron/value',
protected string $expression = 'groups/automatic_translation/groups/catalog/fields/product_translation_cron/value',
protected string $cronStringPath = 'crontab/translate_products/jobs/mageos_translate_products/schedule/cron_expr',
array $data = []
) {
Expand All @@ -47,7 +47,7 @@ public function __construct(

/**
* @return CatalogCron
* @throws Exception
* @throws LocalizedException
*/
public function afterSave(): static
{
Expand All @@ -63,7 +63,7 @@ public function afterSave(): static
$this->cronStringPath
)->save();
} catch (Exception $e) {
throw new Exception(__('Unable to save the cron expression.'), 0, $e);
throw new LocalizedException(__('Unable to save the cron expression.'), $e);
}

return parent::afterSave();
Expand Down
2 changes: 1 addition & 1 deletion etc/di.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<!-- CRON VIRTUAL TYPE -->
<virtualType name="MageOS\AutomaticTranslation\Model\Config\SelectAttributeCron" type="MageOS\AutomaticTranslation\Model\Config\CatalogCron">
<arguments>
<argument name="expression" xsi:type="string">groups/catalog/fields/select_attribute_translation_cron/value</argument>
<argument name="expression" xsi:type="string">groups/automatic_translation/groups/catalog/fields/select_attribute_translation_cron/value</argument>
<argument name="cronStringPath" xsi:type="string">crontab/translate_select_attributes/jobs/mageos_translate_select_attributes/schedule/cron_expr</argument>
</arguments>
</virtualType>
Expand Down