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.

Command icon 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

mably created an issue. See original summary.

mably’s picture

Status: Active » Needs review

  • mably committed a57e6860 on 2.x
    fix: #3589970 TypeError on global webform_submission entity list: $...
mably’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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