Major
Nice to have
Bugfix
Major
Detail
#23601
Delete nonsensical overrides of LayoutComponent.isDefaultFor(...)
Background
The EditPersonComponent overrides the LayoutComponent.isDefaultFor(String, BoundCommandGroup) method to register itself as a default component for the Person type. However, this method can only be used to register each use of this component as a default component. If there is more than one usage, it is random which one is opened. The behavior potentially changes with each application launch.
In the demo, this results in clicking on a person sometimes opening the correct page in the administration but sometimes opening a dialog in the "Technical Demo > Tests > PersonAjaxForm" view.
There is no other usage on TL Trunk except this.
Solution
This method should be deleted. The default component is registered via its layout XML file, not via its code.
Code migration
- Look at all uses of a derivative of EditPersonComponent and set the defaultFor entry in the layout XML file accordingly:
- EditPersonComponent (and its derivatives) were the default for Person.
- EditCurrentPersonComponent had overridden that to make it (and its derivatives) the default for nothing.
- Delete all overrides of LayoutComponent.isDefaultFor(...) and move them to the appropriate layout XML file.
Test
TestGotoDefaultForPerson.script.xml