I keep getting the following error on Form tabs.

Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException: The "_____" entity type did not specify a "_________" form class. in Drupal\Core\Entity\EntityTypeManager->getFormObject() (line 223 of /app/web/core/lib/Drupal/Core/Entity/EntityTypeManager.php).

example YAML
---
langcode: en
status: true
id: activity.objectives
label: Test
path: Test
tab_title: Test
page_title: '[entity_ui_tab:target_entity:title] Test'
target_entity_type: test
target_bundles:
test: test
content_plugin: entity_form
content_config:
form_mode: test_form
weight: 10

Comments

keesee created an issue. See original summary.

joachim’s picture

Does your entity type specify a form for that mode in its annotation?

keesee’s picture

no. the form mode and associated form are exported configs.
I was able to recreate this on a test content entity (node)

any thoughts?

FORM MODE
core.entity_form_mode.node.test.yml

langcode: en
status: true
dependencies:
module:
- node
id: node.test
label: test
targetEntityType: node
cache: true

FORM DISPLAY
core.entity_form_display.node.test.test.yml

langcode: en
status: true
dependencies:
config:
- core.entity_form_mode.node.test
- field.field.node.test.body
- node.type.test
module:
- field_layout
- layout_discovery
- path
- text
third_party_settings:
field_layout:
id: layout_onecol
settings: { }
id: node.test.test
targetEntityType: node
bundle: test
mode: test
content:
body:
type: text_textarea_with_summary
weight: 121
settings:
rows: 9
summary_rows: 3
placeholder: ''
third_party_settings: { }
region: content
created:
type: datetime_timestamp
weight: 10
region: content
settings: { }
third_party_settings: { }
path:
type: path
weight: 30
region: content
settings: { }
third_party_settings: { }
promote:
type: boolean_checkbox
settings:
display_label: true
weight: 15
region: content
third_party_settings: { }
status:
type: boolean_checkbox
settings:
display_label: true
weight: 120
region: content
third_party_settings: { }
sticky:
type: boolean_checkbox
settings:
display_label: true
weight: 16
region: content
third_party_settings: { }
title:
type: string_textfield
weight: -5
region: content
settings:
size: 60
placeholder: ''
third_party_settings: { }
uid:
type: entity_reference_autocomplete
weight: 5
settings:
match_operator: CONTAINS
size: 60
placeholder: ''
region: content
third_party_settings: { }
hidden: { }

ENTITY TAB
entity_ui.entity_tab.node.test.yml

langcode: en
status: true
dependencies:
module:
- node
id: node.test
label: test
path: test
tab_title: test
page_title: test
target_entity_type: node
target_bundles:
test: test
content_plugin: entity_form
content_config:
form_mode: test
weight: 10

joachim’s picture

Status: Active » Closed (works as designed)

That's a known core issue. If you define a custom form view mode, to use it on an entity you need a form class in the annotation.

attisan’s picture

can this be resolved without custom code?