Skip to content
Snippets Groups Projects
Commit e4efc8b8 authored by Yash Rode's avatar Yash Rode Committed by Ted Bowman
Browse files

Issue #3304617 by yash.rode, tedbow: Display readiness checks failure at...

Issue #3304617 by yash.rode, tedbow: Display readiness checks failure at admin/reports/updates/automatic-update
parent 71497518
No related branches found
No related tags found
No related merge requests found
......@@ -164,6 +164,15 @@ final class UpdaterForm extends FormBase {
return $form;
}
if ($form_state->getUserInput()) {
$results = [];
}
else {
$event = new ReadinessCheckEvent($this->updater);
$this->eventDispatcher->dispatch($event);
$results = $event->getResults();
}
$this->displayResults($results, $this->messenger(), $this->renderer);
$project = $project_info->getProjectInfo();
if ($installed_minor_release === NULL && $next_minor_release === NULL) {
if ($project['status'] === UpdateManagerInterface::CURRENT) {
......@@ -216,15 +225,6 @@ final class UpdaterForm extends FormBase {
$release_status = $this->t('Available update');
$type = 'update-recommended';
}
if ($form_state->getUserInput()) {
$results = [];
}
else {
$event = new ReadinessCheckEvent($this->updater);
$this->eventDispatcher->dispatch($event);
$results = $event->getResults();
}
$this->displayResults($results, $this->messenger(), $this->renderer);
$create_update_buttons = !$stage_exists && $this->getOverallSeverity($results) !== SystemManager::REQUIREMENT_ERROR;
if ($installed_minor_release) {
$installed_version = ExtensionVersion::createFromVersionString($project_info->getInstalledVersion());
......
......@@ -187,6 +187,21 @@ class UpdaterFormTest extends AutomaticUpdatesFunctionalTestBase {
$this->assertUpdateStagedTimes(0);
}
/**
* Tests readiness checks are displayed when there is no update available.
*/
public function testReadinessCheckFailureWhenNoUpdate() {
$assert_session = $this->assertSession();
$this->setCoreVersion('9.8.1');
$message = "You've not experienced Shakespeare until you have read him in the original Klingon.";
$result = ValidationResult::createError([$message]);
TestSubscriber1::setTestResult([$result], ReadinessCheckEvent::class);
$this->checkForUpdates();
$this->drupalGet('/admin/reports/updates/automatic-update');
$assert_session->pageTextContains('No update available');
$assert_session->pageTextContains($message);
}
/**
* Checks the table for a release on the form.
*
......
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