diff --git a/core/modules/user/lib/Drupal/user/ProfileFormController.php b/core/modules/user/lib/Drupal/user/ProfileFormController.php index 94825ac..adee645 100644 --- a/core/modules/user/lib/Drupal/user/ProfileFormController.php +++ b/core/modules/user/lib/Drupal/user/ProfileFormController.php @@ -17,28 +17,6 @@ class ProfileFormController extends AccountFormController { /** - * The user accessing the form. - * - * @var UserInterface - */ - var $user; - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - $user = $container->get('request')->attributes->get('_account'); - return new static($user); - } - - /** - * Constructor. - */ - public function __construct(AccountInterface $user) { - $this->user = $user; - } - - /** * Overrides Drupal\Core\Entity\EntityFormController::actions(). */ protected function actions(array $form, array &$form_state) { @@ -48,7 +26,7 @@ protected function actions(array $form, array &$form_state) { $account = $this->entity; // The user doing the editing. - $user = $this->user; + $user = $this->getCurrentUser(); $element['delete']['#type'] = 'submit'; $element['delete']['#value'] = t('Cancel account');