0

Created a webform in language en-gb. Now as per project requirement, en-gb language not a requirement anymore. After deleting en-gb language, admin/structure/webform/manage/contact start giving below error.

Is there is way to fix this issue? Is there a way to change the default language of this route programmatically?. Currently, the default site language is 'FR'.

On debug, found that webform is trying to load original language and then try to call getName(). As the original language value is empty, getName() throw error.

The website encountered an unexpected error. Please try again later.
Error: Call to a member function getName() on null in webform_form_alter() (line 48 of modules/contrib/webform/includes/webform.form_alter.inc).
webform_form_alter() (Line: 539)
Drupal\Core\Extension\ModuleHandler->alter() (Line: 838)
Drupal\Core\Form\FormBuilder->prepareForm() (Line: 279)
Drupal\Core\Form\FormBuilder->buildForm() (Line: 91)
Drupal\Core\Controller\FormController->getContentResult()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 573)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 151)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 57)
Drupal\Core\StackMiddleware\Session->handle() (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 91)
Drupal\shield\ShieldMiddleware->handle() (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 49)
Drupal\remove_http_headers\StackMiddleware\RemoveHttpHeadersMiddleware->handle() (Line: 23)
Stack\StackedHttpKernel->handle() (Line: 708)
Drupal\Core\DrupalKernel->handle() (Line: 19)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.