Generated with the help of an LLM.
Problem/Motivation
On a display with content overrides on, emptying the profile on Manage display unsets the override settings, then writes them back.
EntityViewDisplayFormHook::submitForm() clears override_field and override_profile for an empty profile, but the override_status block runs next: the checkbox is still checked, only hidden by #states.
The display keeps override_field and override_profile with no profile, and the override field stays locked.
Steps to reproduce
- On a content type's Manage display, select a profile, check Enable content overrides and save.
- Select no profile and save.
- Export the display:
third_party_settings.display_builder still holds override_field and override_profile. The override field storage is still locked.
Proposed resolution
Skip the override_status block when the profile is empty.
Remaining tasks
- Functional test submitting the form with an empty profile.
- Fix.
Comments
Comment #2
pdureau commentedMaybe we just need to adapt the existing
EntityViewDisplayFormTest::assertEnableAndDisable(), which may be hiding the bug by "unchecking"override_statuswhen it disables Display Builder:Comment #4
pdureau commentedComment #5
pdureau commentedOK for me:
Results:
override_fieldandoverride_profileanymore: ✅Open for review.
Comment #7
mogtofu33 commentedThanks works great!