We use bundleFieldDefinitions() to set the default form widget to "hidden" when title generation is enabled.
This only works until the form display is saved, cause EntityDisplayBase takes the field definitions only as a default.
We need to move the widget switching logic to a hook.
mglaman had the idea of using hook_entity_form_display_alter(), but it turns out that the EntityFormDisplay doesn't give us access to the field definition, so we'd need to load the variation type entity to determine if title generation is on.
If we use hook_field_widget_form_alter() we can access the field definition, which is better for performance, though a bit more magical.
Comments
Comment #3
bojanz commentedCommitted.