Currently, the Service Provider for the Form\LegacyConsumer is instantiating classes for callbacks whose hooks never fire.
We are supporting 19 deprecated hooks which are paired with 19 new hooks, each of which are run multiple times in multiple contexts. This creates a problem when each feature spins up a bunch of classes and hooks that aren't necessary.
As an example, the new hooks are used to update the Donation Receipt, which is only need when the donation receipt is being show. Currently, we are setting up each of those hooks when the Donation Receipt isn't even being show. The same goes for the Legacy Template donation confirmation, the email tags, the donation details, the field validation, etc. This adds up very quickly.
Acceptance Criteria
[x] SetupFieldConfirmation only processes in the context of the Legacy template donation confirmation.
[x] SetupFieldEmailTag only processes in the context for the email editor and sending email.
[x] SetupFieldPersistance only processes in the context of creating a new donation.
[x] SetupFieldReciept only processes in the context of the Sequoia template Receipt.
[x] SetupFieldValidation only processes in the context of rendering fields and validating new donations.
[x] SetupPaymentDetailsDisplay only processes in the context of the donation details screen.
Currently, the Service Provider for the
Form\LegacyConsumer
is instantiating classes for callbacks whose hooks never fire.We are supporting 19 deprecated hooks which are paired with 19 new hooks, each of which are run multiple times in multiple contexts. This creates a problem when each feature spins up a bunch of classes and hooks that aren't necessary.
As an example, the new hooks are used to update the Donation Receipt, which is only need when the donation receipt is being show. Currently, we are setting up each of those hooks when the Donation Receipt isn't even being show. The same goes for the Legacy Template donation confirmation, the email tags, the donation details, the field validation, etc. This adds up very quickly.
Acceptance Criteria
SetupFieldConfirmation
only processes in the context of the Legacy template donation confirmation.SetupFieldEmailTag
only processes in the context for the email editor and sending email.SetupFieldPersistance
only processes in the context of creating a new donation.SetupFieldReciept
only processes in the context of the Sequoia template Receipt.SetupFieldValidation
only processes in the context of rendering fields and validating new donations.SetupPaymentDetailsDisplay
only processes in the context of the donation details screen.