Problem/Motivation

call_user_func_array calls callback function using named arguments if an array with keys is passed to $args and if the array passed has only values, arguments are passed positionally.

Steps to reproduce

1) Create a webform with any element.
2) Submit one response.
3) Run the drush command to export the webform submissions drush webform-export webform_id.

The error below is triggered:
[error] Error: Unknown named parameter $webform in call_user_func_array() (line 29 of /app/modules/contrib/webform/src/Commands/WebformCommands.php) #0 /app/modules/contrib/webform/src/Commands/WebformCommands.php(29): call_user_func_array(Array, Array)

See: https://www.php.net/manual/en/function.call-user-func-array.php#125953

Proposed resolution

Ensure that call_user_func_array works with PHP 8 as well.

CommentFileSizeAuthor
#2 3214974-2.patch1.9 KBpaulocs

Comments

paulocs created an issue. See original summary.

paulocs’s picture

Assigned: paulocs » Unassigned
Status: Active » Needs review
StatusFileSize
new1.9 KB
jrockowitz’s picture

Status: Needs review » Reviewed & tested by the community

I think this patch should be committed.

In the long term, I am hoping once Drupal 9.x is the only supported version for Webform 6.x, we only support Drush 10.x.

@see https://www.drush.org/latest/install/#drupal-compatibility

jrockowitz’s picture

Status: Reviewed & tested by the community » Fixed

  • paulocs authored 4441fb4 on 8.x-5.x
    Issue #3214974 by paulocs: [PHP8] - call_user_func_array problems
    

  • paulocs authored 4441fb4 on 6.x
    Issue #3214974 by paulocs: [PHP8] - call_user_func_array problems
    

Status: Fixed » Closed (fixed)

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