Skip to content
Snippets Groups Projects
Commit c2c23103 authored by Kunal Sachdev's avatar Kunal Sachdev Committed by Ted Bowman
Browse files

Issue #3245655 by kunal.sachdev, tedbow: Do not support updating FROM a -dev version

parent 179e29e7
No related branches found
No related tags found
1 merge request!90Issue #3245655: Do not support updating FROM a -dev version
......@@ -67,6 +67,14 @@ class UpdateVersionValidator implements EventSubscriberInterface {
$error = ValidationResult::createError($messages);
$event->addValidationResult($error);
}
elseif ($from_version->getVersionExtra() === 'dev') {
$messages[] = $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.', [
'@to_version' => $to_version_string,
'@from_version' => $from_version_string,
]);
$error = ValidationResult::createError($messages);
$event->addValidationResult($error);
}
elseif ($from_version->getMajorVersion() !== $to_version->getMajorVersion()) {
$messages[] = $this->t('Drupal cannot be automatically updated from its current version, @from_version, to the recommended version, @to_version, because automatic updates from one major version to another are not supported.', [
'@to_version' => $to_version_string,
......
......@@ -59,4 +59,13 @@ class UpdateVersionValidatorTest extends AutomaticUpdatesKernelTestBase {
$this->assertCheckerResultsFromManager([$result], TRUE);
}
/**
* Tests a current version that is a dev version.
*/
public function testUpdatesFromDevVersion(): void {
$this->setCoreVersion('9.8.0-dev');
$result = ValidationResult::createError(['Drupal cannot be automatically updated from its current version, 9.8.0-dev, to the recommended version, 9.8.1, because automatic updates from a dev version to any other version are not supported.']);
$this->assertCheckerResultsFromManager([$result], TRUE);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment