// Validate that both the from and to versions are stable releases.
if($from_version->getVersionExtra()){
returnValidationResult::createError([
$this->t('Drupal cannot be automatically updated during cron from its current version, @from_version, because Automatic Updates only supports updating from stable versions during cron.',$variables),
]);
}
if($to_version->getVersionExtra()){
// Because we do not support updating to a new minor version during
// cron it is probably impossible to update from a stable version to
// a unstable/pre-release version, but we should check this condition
// just in case.
returnValidationResult::createError([
$this->t('Drupal cannot be automatically updated during cron to the recommended version, @to_version, because Automatic Updates only supports updating to stable versions during cron.',$variables),
$this->t('Drupal cannot be automatically updated from its current version, @from_version, to the recommended version, @to_version, because automatic updates from one minor version to another are not supported during cron.',$variables),
]);
}
// Only updating to the next patch release is supported during cron.
$this->t('Drupal cannot be automatically updated during cron from its current version, @from_version, to the recommended version, @to_version, because Automatic Updates only supports 1 patch version update during cron.',$variables),
]);
}
// We cannot use dependency injection to get the cron updater because that
// to ensure the update release is always secure and supported in
// https://www.drupal.org/i/3271468.
if(!isset($releases[$to_version_string])){
returnValidationResult::createError([
$this->t('Drupal cannot be automatically updated during cron from its current version, @from_version, to the recommended version, @to_version, because @to_version is not a valid release.',$variables),
$this->t('Drupal cannot be automatically updated during cron from its current version, @from_version, to the recommended version, @to_version, because @to_version is not a security release.',$variables),