Created a Content form mode 'example', clicked its subtab menu item and got an error

Created on 12 March 2025, 6 months ago

Problem/Motivation

InvalidPluginDefinition Exception "node" entity type did not specify a fmm_edit_example

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States mlncn Minneapolis, MN, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • 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!

Production build 0.71.5 2024