Skip to content
Snippets Groups Projects

Issue #3264849: Show next minor or current minor updates in Update form

Merged Issue #3264849: Show next minor or current minor updates in Update form
1 unresolved thread
1 unresolved thread
Compare and Show latest version
2 files
+ 8
8
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 8
7
@@ -231,14 +231,15 @@ final class UpdaterForm extends FormBase {
$results = $event->getResults();
}
$this->displayResults($results, $this->messenger(), $this->renderer);
$enable_updates = !$stage_exists && $this->getOverallSeverity($results) !== SystemManager::REQUIREMENT_ERROR;
$create_update_buttons = !$stage_exists && $this->getOverallSeverity($results) !== SystemManager::REQUIREMENT_ERROR;
if ($installed_minor_release) {
$form['drupal-installed-minor'] = $this->getReleaseTable(
$installed_minor_release,
$release_status,
$next_minor_release ? $this->t('Current minor update') : NULL,
$type,
$enable_updates,
$create_update_buttons,
// Any update in the current minor should be the primary update.
TRUE,
);
}
@@ -253,7 +254,7 @@ final class UpdaterForm extends FormBase {
$installed_minor_release ? $this->t('Minor update') : $release_status,
$installed_minor_release ? $this->t('Next minor update') : NULL,
$installed_minor_release ? 'update-optional' : $type,
$enable_updates,
$create_update_buttons,
$is_primary
);
}
@@ -339,15 +340,15 @@ final class UpdaterForm extends FormBase {
* The table caption, if any.
* @param string $update_type
* The update type.
* @param bool $enable_updates
* Whether updates are enabled.
* @param bool $create_update_button
* Whether the update button should be created.
* @param bool $is_primary
* Whether update button should be a primary button.
*
* @return array
* The table render array.
*/
private function getReleaseTable(ProjectRelease $release, string $release_description, ?TranslatableMarkup $caption, string $update_type, bool $enable_updates, bool $is_primary): array {
private function getReleaseTable(ProjectRelease $release, string $release_description, ?TranslatableMarkup $caption, string $update_type, bool $create_update_button, bool $is_primary): array {
$project_data = (new ProjectInfo('drupal'))->getProjectInfo();
$release_section = ['#type' => 'container'];
$release_section['table'] = [
@@ -394,7 +395,7 @@ final class UpdaterForm extends FormBase {
],
'#attributes' => ['class' => ['update-' . $update_type]],
];
if ($enable_updates) {
if ($create_update_button) {
$release_section['submit'] = [
'#type' => 'submit',
'#value' => $this->t('Update to @version', ['@version' => $release->getVersion()]),
Loading