The website encountered an unexpected error. Please try again later. TypeError: Drupal\moderation_state_columns\Plugin\views\style\ModerationStateColumns::getWorkflowStatesOptions(): Argument #1 ($workflow) must be of type Drupal\workflows\Entity\Workflow

Created on 28 March 2023, about 2 years ago
Updated 22 September 2023, over 1 year ago

Problem/Motivation

I installed Drupal 9.5 and enabled Content Moderation with default settings. Cloned Moderated Content view display and changed views formatter to Moderate State Columns. It returns error now:

The website encountered an unexpected error. Please try again later.
TypeError: Drupal\moderation_state_columns\Plugin\views\style\ModerationStateColumns::getWorkflowStatesOptions(): Argument #1 ($workflow) must be of type Drupal\workflows\Entity\Workflow, null given, called in /home/laptop/projects/829-drupal-template/web/modules/contrib/moderation_state_columns/moderation_state_columns.module on line 39 in Drupal\moderation_state_columns\Plugin\views\style\ModerationStateColumns::getWorkflowStatesOptions() (line 51 of modules/contrib/moderation_state_columns/src/Plugin/views/style/ModerationStateColumns.php).

Drupal\moderation_state_columns\Plugin\views\style\ModerationStateColumns::getWorkflowStatesOptions() (Line: 39)
template_preprocess_views_view_moderation_state_columns()
call_user_func_array() (Line: 287)
Drupal\Core\Theme\ThemeManager->render() (Line: 433)
Drupal\Core\Render\Renderer->doRender() (Line: 446)
Drupal\Core\Render\Renderer->doRender() (Line: 204)
Drupal\Core\Render\Renderer->render() (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter() (Line: 110)
__TwigTemplate_b4110569a2f939c67700b45f64ecf951->doDisplay() (Line: 405)
Twig\Template->displayWithErrorHandling() (Line: 378)
Twig\Template->display() (Line: 390)
Twig\Template->render() (Line: 55)
twig_render_template() (Line: 384)
Drupal\Core\Theme\ThemeManager->render() (Line: 433)
Drupal\Core\Render\Renderer->doRender() (Line: 446)
Drupal\Core\Render\Renderer->doRender() (Line: 204)
Drupal\Core\Render\Renderer->render() (Line: 242)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 243)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare() (Line: 132)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse() (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray()
call_user_func() (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch() (Line: 174)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 58)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 270)
Drupal\shield\ShieldMiddleware->bypass() (Line: 137)
Drupal\shield\ShieldMiddleware->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 23)
Stack\StackedHttpKernel->handle() (Line: 718)
Drupal\Core\DrupalKernel->handle() (Line: 19)

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Needs review

Version

1.2

Component

Code

Created by

🇷🇸Serbia levmyshkin Novi Sad, Serbia

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

Comments & Activities

Production build 0.71.5 2024