Problem/Motivation

This module provides a resolve_form_state_argument_type boolean config value.
When set to TRUE we enable our ModelValueResolver to also resolve FormStateInterface typehinted parameters in controller methods.

It allows developers to use $formState instead of $form_state.
As long as they typehinted correctly, we'll resolve it.

BUT it appears we reference wmmodel.settings instead of entity_model.settings.
So the config isn't being found.

Our tests pass because we also reference wmmodel in our tests.

Steps to reproduce

Set the resolve_form_state_argument_type config value to TRUE and visit a form.

my_module.config.mails:
  path: '/admin/config/mails'
  defaults:
    _form: '\Drupal\my_module\Form\Admin\Mail\MailSettingsForm'
    _title: 'Mail settings'
  requirements:
    _permission: 'access content overview'
class MailSettingsForm extends ConfigFormBase
{
    public function getFormId(): string
    {
        return 'my_module.config.mails';
    }

    public function buildForm(array $form, FormStateInterface $formState)
    {
        // We never get to this point
    }

When visiting /admin/config/mails you get the following error:

RuntimeException: Controller "Drupal\my_module\Form\Admin\Mail\MailSettingsForm::buildForm" requires that you provide a value for the "$formState" argument.).

Drupal\Core\Controller\FormController->getContentResult(Object, Object)

Proposed resolution

Rename all occurrences of wmmodel.settings to entity_model.settings

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

Robin.Houtevelts created an issue. See original summary.

robin.houtevelts’s picture

Assigned: robin.houtevelts » Unassigned
Status: Active » Needs review
dieterholvoet’s picture

Status: Needs review » Reviewed & tested by the community

Looks good!

robin.houtevelts’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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