Problem/Motivation

I get the following error, when I install the AJAX Example module.

The website encountered an unexpected error. Try again later.

InvalidArgumentException: Class "\Drupal\ajax_example\Form\AutoTextFields" does not exist. in Drupal\Core\DependencyInjection\ClassResolver->getInstanceFromDefinition() (line 37 of core/lib/Drupal/Core/DependencyInjection/ClassResolver.php).

Steps to reproduce

  • Install the AJAX Example module
  • Visit /examples/ajax-example/auto-text-fields

Proposed resolution

  • Rename the modules/ajax_example/src/Form/AutoTextfields.php file modules/ajax_example/src/Form/AutoTextFields.php
  • Change the class name from AutoTextfields to AutoTextFields

Issue fork examples-3545314

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

foxy-vikvik created an issue. See original summary.

avpaderno’s picture

Issue summary: View changes
avpaderno’s picture

Title: Incorrect name on AutoTextFields class on ajax_example module 4.0.4 version » Incorrect name for the AutoTextFields class
Version: 4.0.4 » 4.0.x-dev

avpaderno’s picture

Status: Active » Needs review
foxy-vikvik’s picture

Status: Needs review » Needs work

Thanks for your work. I forgot to say that textfields_container is incorrect key. We need to update it too


  public function textfieldsCallback($form, FormStateInterface $form_state) {
    return $form[’textfields_container'];
}
avpaderno’s picture

Status: Needs work » Needs review

That is a different bug from what reported here. I will create a new bug report for that.

avpaderno’s picture

Component: AJAX Example » Code
avpaderno’s picture

  • avpaderno committed 433aa723 on 4.0.x
    Issue #3545314: Incorrect name for the AutoTextFields class
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.