addCacheableDependencies error when used with conditional_fields module

Created on 7 May 2024, 8 months ago

Problem/Motivation

Get an error on RegisterForm.php when try to apply any condition with the Conditional Fields module.

Steps to reproduce

  1. Install and enable Registration module.
  2. Install and enable Conditional Fields module.
  3. Create an Registration event.
  4. Create some fields ( at least two ).
  5. Go to Conditional Fields, and add an condition on the event, using the fields ( ex. make one visible if the other is checked )
  6. You get a blank page with error message.

Drupal backtrace:

Error: Call to a member function addCacheableDependencies() on null em Drupal\registration\Form\RegisterForm->addCacheableDependencies() (linha 637 de /opt/drupal/web/modules/contrib/registration/src/Form/RegisterForm.php).

#0 /opt/drupal/web/modules/contrib/registration/src/Form/RegisterForm.php(97): Drupal\registration\Form\RegisterForm->addCacheableDependencies()
#1 /opt/drupal/web/core/lib/Drupal/Core/Entity/EntityForm.php(107): Drupal\registration\Form\RegisterForm->form()
#2 [internal function]: Drupal\Core\Entity\EntityForm->buildForm()
#3 /opt/drupal/web/core/lib/Drupal/Core/Form/FormBuilder.php(536): call_user_func_array()
#4 /opt/drupal/web/core/lib/Drupal/Core/Form/FormBuilder.php(283): Drupal\Core\Form\FormBuilder->retrieveForm()
#5 /opt/drupal/web/modules/contrib/conditional_fields/src/Form/ConditionalFieldEditForm.php(600): Drupal\Core\Form\FormBuilder->buildForm()
#6 /opt/drupal/web/modules/contrib/conditional_fields/src/Form/ConditionalFieldEditForm.php(171): Drupal\conditional_fields\Form\ConditionalFieldEditForm->getDummyField()
#7 [internal function]: Drupal\conditional_fields\Form\ConditionalFieldEditForm->buildForm()
#8 /opt/drupal/web/core/lib/Drupal/Core/Form/FormBuilder.php(536): call_user_func_array()
#9 /opt/drupal/web/core/lib/Drupal/Core/Form/FormBuilder.php(283): Drupal\Core\Form\FormBuilder->retrieveForm()
#10 /opt/drupal/web/core/lib/Drupal/Core/Controller/FormController.php(73): Drupal\Core\Form\FormBuilder->buildForm()
#11 [internal function]: Drupal\Core\Controller\FormController->getContentResult()
#12 /opt/drupal/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array()
#13 /opt/drupal/web/core/lib/Drupal/Core/Render/Renderer.php(627): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#14 /opt/drupal/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(121): Drupal\Core\Render\Renderer->executeInRenderContext()
#15 /opt/drupal/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext()
#16 /opt/drupal/vendor/symfony/http-kernel/HttpKernel.php(181): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#17 /opt/drupal/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#18 /opt/drupal/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle()
#19 /opt/drupal/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
#20 /opt/drupal/web/core/modules/big_pipe/src/StackMiddleware/ContentLength.php(32): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#21 /opt/drupal/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\big_pipe\StackMiddleware\ContentLength->handle()
#22 /opt/drupal/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass()
#23 /opt/drupal/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle()
#24 /opt/drupal/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#25 /opt/drupal/web/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#26 /opt/drupal/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle()
#27 /opt/drupal/web/core/lib/Drupal/Core/DrupalKernel.php(704): Drupal\Core\StackMiddleware\StackedHttpKernel->handle()
#28 /opt/drupal/web/index.php(19): Drupal\Core\DrupalKernel->handle()
#29 {main}

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

3.1

Component

Registration Core

Created by

πŸ‡΅πŸ‡ΉPortugal adaragao

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024