When the global webform submission entity list is rendered (e.g. /admin/structure/webform/submissions/manage), WebformSubmissionWorkflowListBuilder is instantiated by core's EntityListController without a webform context, so $this->webform is NULL.
WebformSubmissionWorkflowListBuilder::getQuery() passes $this->webform as the third argument to ResultsFilterHooks::applyWorkflowQueryFilters(), which is typed non-nullable WebformInterface, producing a fatal TypeError.
Stack trace excerpt:
TypeError: Drupal\webform_workflows_element\Hook\ResultsFilterHooks::applyWorkflowQueryFilters(): Argument #3 ($webform) must be of type Drupal\webform\WebformInterface, null given, called in /var/www/html/web/modules/contrib/webform_workflows_element/src/WebformSubmissionWorkflowListBuilder.php on line 31 in Drupal\webform_workflows_element\Hook\ResultsFilterHooks::applyWorkflowQueryFilters() (line 113 of /var/www/html/web/modules/contrib/webform_workflows_element/src/Hook/ResultsFilterHooks.php). #0 .../WebformSubmissionWorkflowListBuilder.php(31): ResultsFilterHooks::applyWorkflowQueryFilters(Array, Array, NULL) #1 .../WebformSubmissionListBuilder.php(1395): ...->getQuery(NULL, NULL, NULL) #2 .../WebformSubmissionListBuilder.php(374): ...->getTotal(NULL, NULL, NULL) #3 .../WebformSubmissionListBuilder.php(301): ...->initialize() #4 .../EntityTypeManager.php: createInstance(...) #5 .../EntityListController.php(23): EntityListController->listing('webform_submission')
Fix: make the parameter nullable. The method's only use of $webform is the call to WebformSubmissionStorageInterface::addQueryConditions(), whose signature already accepts ?WebformInterface $webform = NULL (see WebformSubmissionStorageInterface::239), so NULL propagates safely through the existing code.
- public static function applyWorkflowQueryFilters(array &$data, array $query_strings, WebformInterface $webform): void { + public static function applyWorkflowQueryFilters(array &$data, array $query_strings, ?WebformInterface $webform): void {
MR with this single-character signature change plus the docblock update incoming.
Issue fork webform_workflows_element-3589970
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
mably commentedComment #5
mably commented