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
Comments
Comment #3
mohit_aghera commentedComment #5
xenophyle commentedThank you!