I would like to show 2 instances of the User Profile edit form on the same page. One form mode only shows the username/password widget with the submit button. The other form mode only shows the contact information with the submit button.
When I try the following, I get Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException: The "user" entity type did not specify a "user.change_password" form class
. Note that I've changed the form class to change_password
as well.
$user = User::loadMultiple([$this->account->id()]);
$form = $this->entityFormBuilder->getForm($user[$this->account->id(), 'change_password']
I asked a similar question regarding custom entities but using that solution would require modifying core files.
Is it possible to do this?