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

bojanz created an issue. See original summary.

  • bojanz committed 1ace344 on 8.x-2.x
    Issue #2679383 by bojanz: Variation title form element hiding only works...
bojanz’s picture

Status: Active » Fixed

Committed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.