WSOD when trying to add certain entity types as parameters

Created on 4 February 2023, about 2 years ago
Updated 6 February 2023, about 2 years ago

Problem/Motivation

I am currently working on the tours integration for eca_parameters #3330845: Add a tour for the ECA parameters page . so far i've only created the tour for the main page in the permissions tab (/admin/config/workflow/eca/parameters). but i then noticed that each of the parameter type options has its own dedicated form. i have to admit i haven't taken a closer look at the permissions module yet. i started to go through the different parameter type options to see for which of them it would make sense to create dedicated tours as well. while going through the options i ran into a WSOD for the following three options:

event item

The website encountered an unexpected error. Please try again later.

InvalidArgumentException: The entity cannot be translated since it is language neutral (und). in Drupal\Core\Entity\ContentEntityBase->addTranslation() (line 959 of core/lib/Drupal/Core/Entity/ContentEntityBase.php).
Drupal\parameters\Plugin\Parameter\Content->buildConfigurationForm(Array, Object) (Line: 182)
Drupal\parameters_ui\Form\ParameterForm->buildForm(Array, Object, Object, Object)
call_user_func_array(Array, Array) (Line: 534)
Drupal\Core\Form\FormBuilder->retrieveForm('parameters_parameter', Object) (Line: 281)
Drupal\Core\Form\FormBuilder->buildForm('Drupal\parameters_ui\Form\ParameterForm', Object) (Line: 222)
Drupal\Core\Form\FormBuilder->getForm('Drupal\parameters_ui\Form\ParameterForm', Object, Object) (Line: 239)
Drupal\parameters_ui\Controller\ParametersUiController->parameterAddForm('content:danse_event.danse_event', '', Object, NULL, NULL, NULL)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 163)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 74)
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: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->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: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 680)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

notification item (for the error it looks like danse is in the mix. as far as i know it is undergoing some rewrite so the crash might be due to that?)

The website encountered an unexpected error. Please try again later.

InvalidArgumentException: The entity cannot be translated since it is language neutral (und). in Drupal\Core\Entity\ContentEntityBase->addTranslation() (line 959 of core/lib/Drupal/Core/Entity/ContentEntityBase.php).
Drupal\parameters\Plugin\Parameter\Content->buildConfigurationForm(Array, Object) (Line: 182)
Drupal\parameters_ui\Form\ParameterForm->buildForm(Array, Object, Object, Object)
call_user_func_array(Array, Array) (Line: 534)
Drupal\Core\Form\FormBuilder->retrieveForm('parameters_parameter', Object) (Line: 281)
Drupal\Core\Form\FormBuilder->buildForm('Drupal\parameters_ui\Form\ParameterForm', Object) (Line: 222)
Drupal\Core\Form\FormBuilder->getForm('Drupal\parameters_ui\Form\ParameterForm', Object, Object) (Line: 239)
Drupal\parameters_ui\Controller\ParametersUiController->parameterAddForm('content:danse_notification.danse_notification', '', Object, NULL, NULL, NULL)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 163)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 74)
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: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->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: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 680)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

URL alias item

The website encountered an unexpected error. Please try again later.

InvalidArgumentException: The entity cannot be translated since it is language neutral (und). in Drupal\Core\Entity\ContentEntityBase->addTranslation() (line 959 of core/lib/Drupal/Core/Entity/ContentEntityBase.php).
Drupal\parameters\Plugin\Parameter\Content->buildConfigurationForm(Array, Object) (Line: 182)
Drupal\parameters_ui\Form\ParameterForm->buildForm(Array, Object, Object, Object)
call_user_func_array(Array, Array) (Line: 534)
Drupal\Core\Form\FormBuilder->retrieveForm('parameters_parameter', Object) (Line: 281)
Drupal\Core\Form\FormBuilder->buildForm('Drupal\parameters_ui\Form\ParameterForm', Object) (Line: 222)
Drupal\Core\Form\FormBuilder->getForm('Drupal\parameters_ui\Form\ParameterForm', Object, Object) (Line: 239)
Drupal\parameters_ui\Controller\ParametersUiController->parameterAddForm('content:path_alias.path_alias', '', Object, NULL, NULL, NULL)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 163)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 74)
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: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->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: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 680)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

i am running an install of drupal 10.1.x-dev in ddev locally with php8.2. aside that i am running eca 1.1.x-dev, bpmn 1.1.x-dev, eca parameters 1.0.0, eca parameters ui 1.0.0, parameters 1.0.0 and parameters ui 1.0.0 and danse 2.2.x-dev@dev

Steps to reproduce

  • I've just installed eca core, eca ui, eca bpmn, bpmn for eca, parameters, parameters ui, eca parameters, eca parameters ui
  • went to /admin/config/workflow/eca/parameters
  • tried to add event type, notification type, or url alias item as parameter types
  • same result if i apply the same steps for /admin/config/parameters/global

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

1.0

Component

Miscellaneous

Created by

🇩🇪Germany rkoller Nürnberg, Germany

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

Comments & Activities

  • Issue created by @rkoller
  • 🇩🇪Germany mxh Offenburg
    • mxh committed d041869c on 1.0.x
      Issue #3339078 by rkoller, mxh: WSOD when trying to add certain entity...
  • Status changed to Needs review about 2 years ago
  • 🇩🇪Germany mxh Offenburg

    I've pushed a possible fix to the latest 1.0.x branch. If you'd have time for a quick review, I'd appreciate it. Thanks!

  • 🇩🇪Germany rkoller Nürnberg, Germany

    that's odd. well at the moment due to the other issues fatal error i am unable to retest in the project i've initially ran into the WSOD. but i've created a new project now and added and created more or less the identical setup. problem is the first two parameter types i dont see in the parameter option list anymore. URL alias item is the only type i still see. but there i can confirm that the WSOD is gone.

  • Status changed to Needs work about 2 years ago
  • 🇩🇪Germany rkoller Nürnberg, Germany

    ok now i am able to access my initial project again. there the event item still has an error:

    The website encountered an unexpected error. Please try again later.
    
    InvalidArgumentException: Field is unknown. in Drupal\Core\Entity\ContentEntityBase->getTranslatedField() (line 587 of core/lib/Drupal/Core/Entity/ContentEntityBase.php).
    Drupal\Core\Entity\ContentEntityBase->get('') (Line: 628)
    Drupal\Core\Entity\ContentEntityBase->set('', 'en') (Line: 415)
    Drupal\parameters\Plugin\Parameter\Content->buildConfigurationForm(Array, Object) (Line: 182)
    Drupal\parameters_ui\Form\ParameterForm->buildForm(Array, Object, Object, Object)
    call_user_func_array(Array, Array) (Line: 534)
    Drupal\Core\Form\FormBuilder->retrieveForm('parameters_parameter', Object) (Line: 281)
    Drupal\Core\Form\FormBuilder->buildForm('Drupal\parameters_ui\Form\ParameterForm', Object) (Line: 222)
    Drupal\Core\Form\FormBuilder->getForm('Drupal\parameters_ui\Form\ParameterForm', Object, Object) (Line: 239)
    Drupal\parameters_ui\Controller\ParametersUiController->parameterAddForm('content:danse_event.danse_event', '', Object, NULL, NULL, NULL)
    call_user_func_array(Array, Array) (Line: 123)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 581)
    Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 163)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 74)
    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: 106)
    Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
    Drupal\page_cache\StackMiddleware\PageCache->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: 51)
    Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 680)
    Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

    same for the notification item:

    <code>The website encountered an unexpected error. Please try again later.
    
    InvalidArgumentException: Field is unknown. in Drupal\Core\Entity\ContentEntityBase->getTranslatedField() (line 587 of core/lib/Drupal/Core/Entity/ContentEntityBase.php).
    Drupal\Core\Entity\ContentEntityBase->get('') (Line: 628)
    Drupal\Core\Entity\ContentEntityBase->set('', 'en') (Line: 415)
    Drupal\parameters\Plugin\Parameter\Content->buildConfigurationForm(Array, Object) (Line: 182)
    Drupal\parameters_ui\Form\ParameterForm->buildForm(Array, Object, Object, Object)
    call_user_func_array(Array, Array) (Line: 534)
    Drupal\Core\Form\FormBuilder->retrieveForm('parameters_parameter', Object) (Line: 281)
    Drupal\Core\Form\FormBuilder->buildForm('Drupal\parameters_ui\Form\ParameterForm', Object) (Line: 222)
    Drupal\Core\Form\FormBuilder->getForm('Drupal\parameters_ui\Form\ParameterForm', Object, Object) (Line: 239)
    Drupal\parameters_ui\Controller\ParametersUiController->parameterAddForm('content:danse_notification.danse_notification', '', Object, NULL, NULL, NULL)
    call_user_func_array(Array, Array) (Line: 123)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 581)
    Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 163)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 74)
    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: 106)
    Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
    Drupal\page_cache\StackMiddleware\PageCache->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: 51)
    Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 680)
    Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

    the url alias parameter remains fixed

  • 🇩🇪Germany rkoller Nürnberg, Germany

    is it possible that the wsod is caused in danse now? so that the initial wsod got fixed and since the two errors from the difference parameters are identical it is an indication that the remaining problem is caused by a problem in danse?

    • mxh committed c985d9c5 on 1.0.x
      Issue #3339078 by rkoller, mxh: WSOD when trying to add certain entity...
  • Status changed to Needs review about 2 years ago
  • 🇩🇪Germany mxh Offenburg

    is it possible that the wsod is caused in danse now?

    There may be a possibility, however the Parameters module should ideally also be able to deal with that situation. I've pushed another possible fix for the mentioned problem in #6. Maybe it's also now working when using items of danse?

  • Status changed to RTBC about 2 years ago
  • 🇩🇪Germany rkoller Nürnberg, Germany

    yep it looks like your last change fixed things. i've went through the whole select list and retested all the available options. the two errors linked in #6 are gone now and no new errors turned up. nice!

  • Status changed to Fixed about 2 years ago
  • 🇩🇪Germany mxh Offenburg

    That's great news, many thanks for re-testing this!

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024