Events - archive issueshttps://lab.civicrm.org/dev/event/-/issues2022-04-22T16:22:37Zhttps://lab.civicrm.org/dev/event/-/issues/18Implement tests for Event Registration pages2022-04-22T16:22:37Zmattwiremjw@mjwconsult.co.ukImplement tests for Event Registration pages`CRM/Event/Form/Registration/Register.php` needs to be refactored like `CRM/Contribute/Form/Contribution.php` so that we can implement tests on submit.
`CRM_Event_Form_Registration_Register::postProcess()` needs splitting up to call a n...`CRM/Event/Form/Registration/Register.php` needs to be refactored like `CRM/Contribute/Form/Contribution.php` so that we can implement tests on submit.
`CRM_Event_Form_Registration_Register::postProcess()` needs splitting up to call a new function `CRM_Event_Form_Registration_Register::submit()`.
Then we need to add `CRM_Event_Form_Registration_Register::testSubmit()` and write some tests to call this function.https://lab.civicrm.org/dev/event/-/issues/20API different from Form when setting contrib status to failed for event reg2022-04-22T16:22:38ZJoeMurrayAPI different from Form when setting contrib status to failed for event regUsing the API to set a Contribution's status to "Failed" does not also update its related Participant to "Cancelled", unlike when you edit via the UI.
Move business logic from Form
https://github.com/civicrm/civicrm-core/blob/master/CR...Using the API to set a Contribution's status to "Failed" does not also update its related Participant to "Cancelled", unlike when you edit via the UI.
Move business logic from Form
https://github.com/civicrm/civicrm-core/blob/master/CRM/Contribute/BAO/Contribution.php#L1938
to BAO as per discussion at https://chat.civicrm.org/civicrm/pl/gms1or8wyfni3q3boj8cx1ktxamattwiremjw@mjwconsult.co.ukmattwiremjw@mjwconsult.co.ukhttps://lab.civicrm.org/dev/event/-/issues/56Should back-end users be able to add event registration selections for sold o...2022-04-22T16:23:01ZlarsssandergreenShould back-end users be able to add event registration selections for sold out price set items?Currently, if a price set selection is sold out, back-end users can add this selection on Events - Register Event Participant or from search, but if they edit a existing registration (e.g. from the Contact record, Events, View, Change Se...Currently, if a price set selection is sold out, back-end users can add this selection on Events - Register Event Participant or from search, but if they edit a existing registration (e.g. from the Contact record, Events, View, Change Selections) they cannot either add or subtract from sold out selections as these are disabled/frozen.
Obviously, back-end users should be able to remove registrants from sold out selections and both of these forms should work in the same way for adding registrations (i.e. either you should or shouldn't be able to add registrants to sold out items on both).
I think back-end users should also be able to add registrants to sold out price set selections. There could be many reasons for orgs to want to enabled their staff to add event registrants to selections (special treatment for VIPs, entering paper registrations, etc). I propose to unfreeze these fields on the Change Selections form, but keep the "Sold out" text so that back-end users can see these selections are sold out, at the same time adding "Sold out" text on the Events - Register Event Participant form.
With this change, staff will be able to see a selection is sold out, but make the choice to add a registrant nonetheless. The work around we use currently is to temporarily increase the price set selection limit and then decrease it again after adding the selection, but this is awkward and not obvious.
I think this could be accomplished by moving the [check here from the registration form](https://github.com/civicrm/civicrm-core/blob/5db0bc3c1f54eaca4307f103a73bda596ae914d6/CRM/Event/Form/Registration/Register.php#L764) to [here in the price field](https://github.com/civicrm/civicrm-core/blob/35093fbff08842016c1ef01042e225b9cb5ffec2/CRM/Price/BAO/PriceField.php#L353). I will submit a PR if supported.