Editing Cron error when Updating Version
jutenga opened this issue · 3 comments
jutenga commented
Updating from 1.0.5 to 1.0.6
Preconditions
- First have a version of 1.0.5
- Having a crontab.xml defined like this
<?xml version="1.0"?>
<!--
/**
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
* @see https://devdocs.magento.com/guides/v2.1/config-guide/cron/custom-cron-ref.html
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd">
<group id="orders">
<job name="cron_export" instance="NAMESPACE\TO\CRON\JOB" method="execute">
<schedule>*/5 * * * *</schedule>
</job>
</group>
</config>
Steps to reproduce
- Update to 1.0.6
- Go to cronjob administration
- try to edit cronjob
Expected result
- Edit cronjob
Actual result
If the error is unreadable :
Notice: Undefined index: config_path in /srv/www/vendor/kiwicommerce/module-cron-scheduler/Ui/DataProvider/Form/CronJobDataProvider.php on line 91
Possible Solutions
First solution
Obviously, update the crontab.xml to add the missing node
Second solution
To prevent any problem from updating version,
some modification can be made in this files Ui/DataProvider/Form/CronJobDataProvider.php
Before
if ($configPath = $this->loadedData[$jobCode]['config_path']) {
$this->loadedData[$jobCode]['schedule'] = $this->scopeConfig->getValue($configPath);
}
After :
if (isset($this->loadedData[$jobCode]['config_path']) && $configPath = $this->loadedData[$jobCode]['config_path']) {
$this->loadedData[$jobCode]['schedule'] = $this->scopeConfig->getValue($configPath);
}
PromInc commented
I am observing this same issue.
Magento 2.3.4 on Ubunutu
Module Version: 1.0.6
kiwi-commerce commented