Problem/Motivation
If
OpenId Connect →
is enabled it is breaking the Lupus Decoupled User Form api on <api-prefix>/user/login
, because it tries to render the form and lupus decoupled form controller is missing the render context.
The website encountered an unexpected error. Try again later.<br><br><em class="placeholder">LogicException</em>: Render context is empty, because render() was called outside of a renderRoot() or renderPlain() call. Use renderPlain()/renderRoot() or #lazy_builder/#pre_render instead. in <em class="placeholder">Drupal\Core\Render\Renderer->doRender()</em> (line <em class="placeholder">295</em> of <em class="placeholder">core/lib/Drupal/Core/Render/Renderer.php</em>). <pre class="backtrace">Drupal\Core\Render\Renderer->render(Array) (Line: 192)
openid_connect_form_user_login_form_alter(Array, Object, 'user_login_form') (Line: 545)
Drupal\Core\Extension\ModuleHandler->alter('form', Array, Object, 'user_login_form') (Line: 841)
Drupal\Core\Form\FormBuilder->prepareForm('user_login_form', Array, Object) (Line: 244)
Drupal\autosave_form\Form\AutosaveFormBuilder->prepareForm('user_login_form', Array, Object) (Line: 284)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 97)
Drupal\autosave_form\Form\AutosaveFormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object) (Line: 22)
Drupal\lupus_decoupled_form\Controller\CustomElementsFormController->getContentResult(Object, Object) (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 100)
Drupal\ldp_cp_api\LdpCpApiLanguageRequestMiddleware->handle(Object, 1, 1) (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 104)
Drupal\lupus_decoupled_ce_api\BackendApiRequest->handle(Object, 1, 1) (Line: 191)
Drupal\page_cache\StackMiddleware\PageCache->fetch(Object, 1, 1) (Line: 128)
Drupal\page_cache\StackMiddleware\PageCache->lookup(Object, 1, 1) (Line: 82)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 85)
Drupal\ldp_cdn\FixedBaseUrlMiddleware->handle(Object, 1, 1) (Line: 53)
Asm89\Stack\Cors->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
</pre>
Steps to reproduce
Have OpenId Connect enabled and configured, then visit the api login url.