$this->t('Update version @to_version is lower than @from_version, downgrading is not supported.',$variables),
]);
}
elseif($from_version->getVersionExtra()==='dev'){
elseif($from_version_extra==='dev'){
$event->addError([
$this->t('Drupal cannot be automatically updated from its current version, @from_version, to the recommended version, @to_version, because automatic updates from a dev version to any other version are not supported.',$variables),
]);
@@ -122,6 +124,30 @@ class UpdateVersionValidator implements EventSubscriberInterface {
]);
}
}
elseif($stageinstanceofCronUpdater){
if($from_version_extra||$to_version_extra){
if($from_version_extra){
$messages[]=$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);
$event->addError($messages);
}
if($to_version_extra){
// 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.
$messages[]=$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);
$messages[]=$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);
$event->addError($messages);
}
}
}
}
/**
@@ -134,4 +160,26 @@ class UpdateVersionValidator implements EventSubscriberInterface {
];
}
/**
* Gets the patch number for a version string.
*
* @todo Move this method to \Drupal\Core\Extension\ExtensionVersion in