Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev/financial#157 [REF] Extract functions #19072

Merged
merged 1 commit into from
Dec 4, 2020

Conversation

eileenmcnaughton
Copy link
Contributor

Overview

This is just preliminary cleanup - extract a couple of functions in the payment processor form for readability

Before

long block

After

Extracted

Technical Details

Pretty basic

Comments

@mattwire I took a look at the form in conjunction with https://lab.civicrm.org/dev/financial/-/issues/157 & had 2 thoughts about how to make the change / improve the form

  1. I don't think the form needs to / should inherit from CRM_Admin_Form - that seems just a bit legacy & worth breaking
  2. we need to know the payment processor type before setEntityFields is called to move the handling to that function. I feel like we can do that if we support an extra function on the trait ie
diff --git a/CRM/Core/Form/EntityFormTrait.php b/CRM/Core/Form/EntityFormTrait.php
index 5ebf4441e8..de96db70a4 100644
--- a/CRM/Core/Form/EntityFormTrait.php
+++ b/CRM/Core/Form/EntityFormTrait.php
@@ -247,6 +247,7 @@ trait CRM_Core_Form_EntityFormTrait {
    * translation or other non-input specific handling.
    */
   protected function setTranslatedFields() {
+    $this->prepareForm();
     $this->setEntityFields();

This is just preliminary cleanup
@civibot
Copy link

civibot bot commented Nov 30, 2020

(Standard links)

@civibot civibot bot added the master label Nov 30, 2020
@eileenmcnaughton
Copy link
Contributor Author

@seamuslee001 can you merge this - it's pretty trivial

@seamuslee001
Copy link
Contributor

Yeh this seems fine to me

@seamuslee001 seamuslee001 merged commit 53bc1b8 into civicrm:master Dec 4, 2020
@seamuslee001 seamuslee001 deleted the url branch December 4, 2020 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants