Problem/Motivation
We "randomly" encounter the following error:
Error: Call to undefined method ...::getEntity() in gin_everywhere_form_alter() (line 77 of modules/contrib/gin_everywhere/gin_everywhere.module).
The class on which ::getEntity() is called varies, it seems like it's module that extend forms in a generic way.
Steps to reproduce
Last encountered we dealing with ai_chatbot.
I'm not entirely sure what the required steps are to reliably trigger the error.
Proposed resolution
More precise check if the form is actually an instance of \Drupal\Core\Entity\EntityForm which has the ::getEntity() method.
Remaining tasks
- ✓ Provide fix
- Review
User interface changes
none
API changes
none
Data model changes
none
Issue fork gin_everywhere-3482743
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
das-peter commentedCreated MR with extended condition before attempting to call
::getEntity()Comment #4
hydra commentedHey Peter! Really long time no see! Yeah you are right. The form decorator module decorates all forms this might cause that issue.
Comment #5
das-peter commentedAbsolutely correct! Adjusted.
Hey Pascal! Indeed, looong time - nice to see ya! :) Didn't have proper drupal projects for a while - but right now getting back in the game.
Comment #7
hydra commentedWell, welcome back on board :)
Comment #8
das-peter commentedThanks! And thank you for being so responsive :)
Comment #9
hydra commentedNp, I will checkout the other issue soon and make a release with the fixes.
Comment #10
kopeboyI'm getting a warning by phpcs: Undefined method 'getEntity' (with and without the patch).