Call to a member function getTypePlugin() on null

Created on 17 October 2022, about 2 years ago
Updated 1 May 2024, 7 months ago

Problem/Motivation

The default configuration for the workflow ID is not always the same and it should be configurable.
The workflow drupal module provides the option to create multiples workflows and could be "editorial" or not, but in config/nstall is set "editorial" so we get the following errors:

  • When visits /admin/config/content/moderated-content-bulk-publish
    The website encountered an unexpected error. Please try again later.
    Error: Call to a member function getTypePlugin() on null in Drupal\moderated_content_bulk_publish\Form\SettingsForm->buildForm() (line 105 of modules/contrib/moderated_content_bulk_publish/src/Form/SettingsForm.php).
    Drupal\moderated_content_bulk_publish\Form\SettingsForm->buildForm()
    call_user_func_array() (Line: 531)
    Drupal\Core\Form\FormBuilder->retrieveForm() (Line: 278)
    Drupal\Core\Form\FormBuilder->buildForm() (Line: 73)
    Drupal\Core\Controller\FormController->getContentResult()
    call_user_func_array() (Line: 123)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 564)
    Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 124)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 31)
    Drupal\jsonapi_earlyrendering_workaround\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 159)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 81)
    Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 67)
    Drupal\simple_oauth\HttpMiddleware\BasicAuthSwap->handle() (Line: 58)
    Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
    Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 49)
    Asm89\Stack\Cors->handle() (Line: 48)
    Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
    Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 52)
    Drupal\http_headers_cleaner\Middleware\HttpHeadersCleanerMiddleware->handle() (Line: 23)
    Stack\StackedHttpKernel->handle() (Line: 709)
    Drupal\Core\DrupalKernel->handle() (Line: 19)
    
  • When visits /admin/config/workflow/workflows
    Warning: Undefined array key "editorial" in Drupal\moderated_content_bulk_publish\Form\SettingsForm->buildForm() (line 105 of modules/contrib/moderated_content_bulk_publish/src/Form/SettingsForm.php).
    Drupal\moderated_content_bulk_publish\Form\SettingsForm->buildForm(Array, Object)
    call_user_func_array(Array, Array) (Line: 531)
    Drupal\Core\Form\FormBuilder->retrieveForm('moderated_content_bulk_publish_settings_form', Object) (Line: 278)
    Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
    Drupal\Core\Controller\FormController->getContentResult(Object, Object)
    call_user_func_array(Array, Array) (Line: 123)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 564)
    Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 31)
    Drupal\jsonapi_earlyrendering_workaround\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 159)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
    Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 67)
    Drupal\simple_oauth\HttpMiddleware\BasicAuthSwap->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: 49)
    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: 52)
    Drupal\http_headers_cleaner\Middleware\HttpHeadersCleanerMiddleware->handle(Object, 1, 1) (Line: 23)
    Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 709)
    Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
    

Proposed resolution

Do not set the workflow id, and leave it configurable or calculated.

πŸ› Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

πŸ‡ͺπŸ‡ΈSpain eduardo morales alberti Spain, πŸ‡ͺπŸ‡Ί

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024