Separate out Search participant register form from backoffice form
The form you reach when selecting 'Register participant' from contact search is the same as participant edit or create for a single participant. This creates a few problems
- AdditionalPayment form is extending the Task class purely to support this form
- This form is calling CRM_Contact_Form_Task::preProcessCommon($this); - which is one of 2 places the static-ness of that function is locked in. By using a static method the expectations around the forms become much harder to track
- Lots of hard-to-read if-else
Part of the reason for how it is I think is the focus on 'preProcess' as the action. Since that is often blocked using a different action seems to make sense allowing us to switch to $form->preProcessTask as the preferred method & extract out parts of that function (knowing they are accessible since $form is potentially 'any' form & is not restricted to an interface ). We could go down the interface path but that requires us to understand all the classes & methods & properties involved so it feels like an end goal rather than a step - how we re-wind the wool once unknotted)