When you land on the 'Automatic label' tab on a given entity type, you're immediately presented with a big form. However, none of the settings make sense if the initial set of radios is set to 'Disabled' (which is the default case). To avoid confusion, we should use #states to hide the other settings unless auto_entitylabel is enabled for this entity type.

Before (current behavior)

Auto entity label settings form before patch

After

Initial state, AEL is disabled

Auto entity label settings form after patch, AEL disabled

AEL is enabled

(The same behavior works for all the other radios).
Auto entity label settings form after patch, AEL enabled

Comments

dww created an issue. See original summary.

dww’s picture

Working patch. Added screenshots to the summary.

The only slightly ugly thing is that you can't use #states directly on non-form elements, so I wrapped the 'token_help' part of the render array in a #type => 'container'. Other than that, the patch probably speaks for itself.

renatog’s picture

Status: Needs review » Reviewed & tested by the community

I applied the patch #2. It's basic-way and functional. Works good for me.

  • RenatoG committed 9ea9ef2 on 8.x-2.x authored by dww
    Issue #2958565 by dww, RenatoG: Use #states to hide settings if...
renatog’s picture

Status: Reviewed & tested by the community » Fixed

Committed to the dev branch. Thanks. Best,

Status: Fixed » Closed (fixed)

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