- Issue created by @dsim01
When I want to run the cronjob via URL, for example : https://mysite.com/scheduler/cron/123456789, I got an access denied from Drupal.
This is my log error : Path : /scheduler/cron/xxxx. Drupal\Core\Http\Exception\CacheableAccessDeniedHttpException: in Drupal\Core\Routing\AccessAwareRouter->checkAccess() (.../web/core/lib/Drupal/Core/Routing/AccessAwareRouter.php).
I also noticed that the value of the state in table "key_value" is always "null", so this code in the controller is not giving access.
public function access($cron_key) {
$valid_cron_key = $this->state()->get(SchedulerCronForm::CRON_ACCESS_KEY, '');
return AccessResult::allowedIf($valid_cron_key == $cron_key);
}
Can you help me?
Thanks.
Active
2.2
Code