Problem/Motivation

In MailchimpSignupFormFormatter class, we are calling the MailchimpSignupPageForm and create an instance of it.

Recently MailchimpSignupPageForm has added additional parameter called API service.
So without this parameter, it is breaking.

Steps to reproduce

- Render any field which uses MailchimpSignupFormFormatter field formatter.
- You can notice the following error.

TypeError: Drupal\mailchimp_signup\Form\MailchimpSignupPageForm::__construct(): Argument #1 ($api_service) must be of type Drupal\mailchimp\ApiService, Drupal\Core\Messenger\Messenger given, called in /data/app/modules/contrib/mailchimp/modules/mailchimp_signup/src/Plugin/Field/FieldFormatter/MailchimpSignupFormFormatter.php on line 71 in Drupal\mailchimp_signup\Form\MailchimpSignupPageForm->__construct() (line 52 of modules/contrib/mailchimp/modules/mailchimp_signup/src/Form/MailchimpSignupPageForm.php).

Proposed resolution

Inject the required services.
I've added necessary changes in the MR.

Remaining tasks

Needs review

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Issue fork mailchimp-3551743

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

mohit_aghera created an issue. See original summary.

mohit_aghera’s picture

Status: Active » Needs review

xenophyle’s picture

Status: Needs review » Fixed

Thank you!

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.