diff --git a/core/modules/user/lib/Drupal/user/Form/UserCancelConfirm.php b/core/modules/user/lib/Drupal/user/Form/UserCancelConfirm.php index 0650a41..e96a56f 100644 --- a/core/modules/user/lib/Drupal/user/Form/UserCancelConfirm.php +++ b/core/modules/user/lib/Drupal/user/Form/UserCancelConfirm.php @@ -80,7 +80,7 @@ protected function getConfirmText() { /** * {@inheritdoc} - * @param Drupal\user\Plugin\Core\Entity\User $account + * @param \Drupal\user\Plugin\Core\Entity\User $account * The user account to be canceled. */ public function buildForm(array $form, array &$form_state, User $account = NULL) { diff --git a/core/modules/user/lib/Drupal/user/Form/UserMultipleCancelConfirm.php b/core/modules/user/lib/Drupal/user/Form/UserMultipleCancelConfirm.php index 1f0d44d..fd09950 100644 --- a/core/modules/user/lib/Drupal/user/Form/UserMultipleCancelConfirm.php +++ b/core/modules/user/lib/Drupal/user/Form/UserMultipleCancelConfirm.php @@ -131,9 +131,12 @@ public function submitForm(array &$form, array &$form_state) { unset($admin_form_state['values']['user_cancel_confirm']); // The $user global is not a complete user entity, so load the full // entity. - $admin_form_state['values']['_account'] = user_load($user->uid); + $account = user_load($uid); + $admin_form_state['values']['_account'] = $account; $admin_form = new UserCancelConfirm(); $admin_form_mock = array(); + // Calling this directly required to init form object with $account. + $admin_form->buildForm($admin_form_mock, $admin_form_state, $account); $admin_form->submitForm($admin_form_mock, $admin_form_state); } else {