Hi everyone,
When creating and placing a Mailchimp SignUp form block in my site, the Entity Browser widget used to Edit images breaks.
Error message:
Error: Call to undefined method Drupal\mailchimp_signup\Form\MailchimpSignupPageForm::getEntity() in entity_browser_form_alter() (line 78 of /var/www/html/web/modules/contrib/entity_browser/entity_browser.module).
Preconditions
Media Bundle with Image field.
Image field uses the "Entity Browser" widget (in Manage form display).
Widget is configured with "Display Edit Button".
Steps:
1) Go to "admin/config/services/mailchimp/signup"
2) Create a Mailchimp Signup form with display mode "Block".
3) Go to Blocks Layout (admin/structure/block) and place the SignUp block.
4) Go to Content -> Media (/admin/content/media)
5) Create a new media with an image field (make sure to add an image).
6) Save media content.
7) Edit media content.
8) In the image field, click on "Edit"
Result:
In the browser console, I get:
Error: Call to undefined method Drupal\mailchimp_signup\Form\MailchimpSignupPageForm::getEntity() in entity_browser_form_alter() (line 78 of /var/www/html/web/modules/contrib/entity_browser/entity_browser.module).
Looking at the code MailchimpSignupPageForm class (mailchimp/modules/mailchimp_signup/src/Form/MailchimpSignupPageForm.php
)
I see that MailchimpSignupPageForm is missing the getEntity function.
This should return the entity in $this->signup
Patch Attached
Thanks.