Hello,
I've got an exception when trying to add a new user via /admin/people/create. I immediately get the following error:
Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException: The "user" entity type did not specify a "register" form class. in Drupal\Core\Entity\EntityTypeManager->getFormObject() (line 184 of core/lib/Drupal/Core/Entity/EntityTypeManager.php).
Drupal\Core\Entity\EntityManager->getFormObject('user', 'register') (Line: 69)
Drupal\Core\Entity\HtmlEntityFormController->getFormObject(Object, 'user.register.default') (Line: 59)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 582)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 151)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 67)
Drupal\simple_oauth\HttpMiddleware\BasicAuthSwap->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 666)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
So I stepped into the code with Xdebug and figured out, that when the
hasHandlerClass() method in the EntityType class gets called, the $handlers variable looks like this:
$handlers = [
'...',
'form' => [
'default' => 'Drupal\user\ProfileForm',
'cancel' => 'Drupal\user\Form\UserCancelForm',
'register' => null,
'content_translation_deletion' => '\Drupal\content_translation\Form\ContentTranslationDeleteForm',
],
'...',
];
I don't know why the register form handler ist null. Any suggestions how this can happen?
I am using Drupal 8.5.6 with PHP 7.2.
Thanks in advance!