$messages[MessengerInterface::TYPE_ERROR][]=$this->t('There was an error loading the pending update. Press the <em>Cancel update</em> button to start over.');
}
// Don't set any messages if the form has been submitted, because we don't
// want them to be set during form submit.
if(!$form_state->getUserInput()){
foreach($messagesas$type=>$messages_of_type){
foreach($messages_of_typeas$message){
$this->messenger()->addMessage($message,$type);
}
}
}
$form['actions']=[
'cancel'=>[
'#type'=>'submit',
'#value'=>$this->t('Cancel update'),
'#submit'=>['::cancel'],
],
'#type'=>'actions',
];
$form['stage_id']=[
'#type'=>'value',
'#value'=>$stage_id,
];
if(empty($staged_core_packages)){
return$form;
}
$form['update_version']=[
'#type'=>'html_tag',
'#tag'=>'p',
'#value'=>$this->t('Drupal core will be updated to %version',[
'#markup'=>$this->t('Back up your database and site before you continue. <a href=":backup_url">Learn how</a>.',[':backup_url'=>'https://www.drupal.org/node/22281']),
'#suffix'=>'</strong>',
];
$form['maintenance_mode']=[
'#title'=>$this->t('Perform updates with site in maintenance mode (strongly recommended)'),