CQ: Migrate simple Preferences & Settings forms to using a Generic class.
Per https://github.com/civicrm/civicrm-core/pull/13023 @mattwire & myself have recently worked on consolidating some of the setting form metadata handling. This is mostly done however our end goal is worth spelling out.
Basically the class 'CRM_Admin_Form_Preferences_Event' and all classes that don't need special sauce would be removed & the xml would be altered to
<item> <path>civicrm/admin/setting/preferences/event</path> <title>CiviEvent Component Settings</title> <page_callback>CRM_Admin_Form_Generic</page_callback> </item>
This page would load settings based on filtering setting metadata - so any fields with a key in their metadata like this
settings_pages => [ 'event' => ['weight' => 10] ]
would show up at the url above (note the last value on the url is the filter).
Extensions could use the existing alterSettingMetadata hook to add & remove fields from any pages that use the Generic form to choose their settings and extensions could add settings pages by just adding an xml entry & their metadata
We would convert simple forms & for more complex forms we would attempt to break the inheritance on the 2 existing forms (CRM_Admin_Form_Preferences & CRM_Admin_Form_Setting) in favour of using just the CRM_Admin_Form_SettingTrait in an attempt to grandfather them out.