Problem/Motivation

Trying to access /examples/file_example throws the following exception.

ArgumentCountError: Too few arguments to function Drupal\file_example\FileExampleSubmitHandlerHelper::__construct(), 7 passed in /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 259 and exactly 8 expected in Drupal\file_example\FileExampleSubmitHandlerHelper->__construct() (line 45 of modules/contrib/examples/modules/file_example/src/FileExampleSubmitHandlerHelper.php).

Steps to reproduce

  • Install the File Example module
  • On the toolbar, click on Examples, then on File Example

Proposed resolution

Add @module_handler to the list of the arguments passed to the file_example.submit_handler_helper service (as last argument).
In this way, the number of arguments passed to FileExampleSubmitHandlerHelper::__construct() matches the number of parameters that constructor defines.

Issue fork examples-3545345

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

avpaderno created an issue. See original summary.

avpaderno’s picture

Issue summary: View changes
avpaderno’s picture

Title: Too few arguments passed to function Drupal\file_example\FileExampleSubmitHandlerHelper::__construct(): 7 passed and exactly 8 expected » Too few arguments passed to Drupal\file_example\FileExampleSubmitHandlerHelper::__construct(): 7 passed and exactly 8 expected

avpaderno’s picture

Status: Active » Needs review
avpaderno’s picture

Component: File Example » Code

bmunslow made their first commit to this issue’s fork.

  • avpaderno committed 09e986d4 on 4.0.x
    Issue #3545345: Too few arguments passed to...
avpaderno’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.