- Issue created by @mlncn
- πΊπΈUnited States mlncn Minneapolis, MN, USA
β¦ fixed after a cache reload!
- π§πͺBelgium tim-diels Belgium π§πͺ
Yes the cache clearing process needs to be looked at as I have similar issues.
- π¬π§United Kingdom niklp Nottingham
I get the same error but with my custom entity the cache clear does not rectify the problem.
Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException: The "resource" entity type did not specify a "fmm_edit_simple" form class. in Drupal\Core\Entity\EntityTypeManager->getFormObject() (line 212 of core/lib/Drupal/Core/Entity/EntityTypeManager.php).
- π¬π§United Kingdom joachim
The problem in #4 is that the entity type in question doesn't have an edit form class specified:
* "form" = { * "default" = "Drupal\ascend_resource\Form\ResourceForm", * "delete" = "Drupal\Core\Entity\ContentEntityDeleteForm", * "revision-delete" = \Drupal\Core\Entity\Form\RevisionDeleteForm::class, * "revision-revert" = \Drupal\Core\Entity\Form\RevisionRevertForm::class, * },
so this code doesn't kick in:
if ($edit_form = $entity_definition->getFormClass($route_mapper_plugin->getEditFormClass())) {
I'm not sure what the fix should be here --
a. should the route /resource/1/edit/simple request the form mode fmm_edit_*default* rather than fmm_edit_simple?
b. should the fmm_edit_simple form class get defined anyway?
Hard to know the intention when the code has to few comments!
- π§πͺBelgium tim-diels Belgium π§πͺ
Thanks for the issue report and the extra effort by providing good insights on what could be wrong. I'm not sure what the default situation could be. I'm not sure the edit for should be specified. As you suggest the module could try to look for the edit form if specified, otherwise fall back to the default? Is that maybe how Drupal core does it also?
- π¬π§United Kingdom niklp Nottingham
My honourable colleague forgot to mention the "hotfix" which is to define the edit form in the entity, thus (augmenting the above example):
* "form" = { * "default" = "Drupal\ascend_resource\Form\ResourceForm", * "edit" = "Drupal\ascend_resource\Form\ResourceForm", // add this * "delete" = "Drupal\Core\Entity\ContentEntityDeleteForm", * "revision-delete" = \Drupal\Core\Entity\Form\RevisionDeleteForm::class, * "revision-revert" = \Drupal\Core\Entity\Form\RevisionRevertForm::class, * },