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
Issue fork entity_model-3426036
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
robin.houtevelts commentedComment #4
dieterholvoet commentedLooks good!
Comment #6
robin.houtevelts commented