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

REF Convert forms to standard customData template #13412

Merged
merged 9 commits into from
Jan 11, 2019

Conversation

mattwire
Copy link
Contributor

@mattwire mattwire commented Jan 7, 2019

Overview

This converts ALL forms that are adding customData in a similar way to use the CRM/common/customDataBlock.tpl file which was added as part of the entityForm work last year.

Before

Each form adds custom data to the form in a similar way but using a copy of the code.

After

Each form adds custom data in exactly the same way.

Technical Details

The eventual goal is to convert all of these forms to use the entityFormTrait but that requires a significant amount of work on each form and is likely to introduce bugs requiring significant testing.
The change here standardizes the addition of customData across those forms, adding standard "getters" where necessary which will help with the eventual conversion to entityform.

In all cases, we are removing a few lines of code from each form which will make future maintenance easier and we can be sure that certain variables are assigned to each of the templates.

Comments

@eileenmcnaughton @seamuslee001 @lcdservices @alifrumin I realise this is quite a big PR and I could split out some of the commits into separate PRs - but I didn't want to flood the PR queue... As each of the form changes are self-contained perhaps you could test a couple each, and if there are any that cause issues, I'll pull them out as separate PRs for further work?

@civibot
Copy link

civibot bot commented Jan 7, 2019

(Standard links)

@civibot civibot bot added the master label Jan 7, 2019
@colemanw colemanw changed the title REF (WAITING FOR #13411) Convert forms to standard customData template REF Convert forms to standard customData template Jan 7, 2019
@mattwire mattwire force-pushed the extract_customData branch from 96469f7 to 62e185a Compare January 7, 2019 22:12
@seamuslee001
Copy link
Contributor

Jenkins re test this please

@colemanw
Copy link
Member

colemanw commented Jan 10, 2019

Code review looks good. User testing:

  • Activities
  • Cases
  • Campaigns
  • Petitions
  • Surveys
  • Case activities
  • Contributions
  • Recurring contributions
  • Events
  • Grants
  • Memberships

@colemanw
Copy link
Member

colemanw commented Jan 10, 2019

@mattwire - found this problem while testing Surveys and Petitions:

To reproduce:

  • Create a survey

Result:

Fatal error: Call to undefined method CRM_Campaign_Form_Survey_Main::getEntitySubTypeId() in /home/jenkins/bknix-dfl/build/core-13412-4bl1l/sites/all/modules/civicrm/CRM/Custom/Form/CustomData.php on line 58

  • Create a petition

Result:

Call to undefined method CRM_Campaign_Form_Petition::getEntitySubTypeId() in /home/jenkins/bknix-dfl/build/core-13412-4bl1l/sites/all/modules/civicrm/CRM/Custom/Form/CustomData.php on line 58

@mattwire
Copy link
Contributor Author

Thanks @colemanw I've just pushed 2c024dc which fixes the issue with surveys/petitions along with a code comment explaining why.

@colemanw
Copy link
Member

@seamuslee001
Copy link
Contributor

Merging as per @colemanw 's review and tag

@seamuslee001 seamuslee001 merged commit bbb3711 into civicrm:master Jan 11, 2019
@eileenmcnaughton
Copy link
Contributor

@agileware I'm pretty sure you hit a bug on custom data - maybe on event info & this is a follow up to a short term revert on that? Maybe you could do some testing of master in your scenario/s

@mattwire mattwire deleted the extract_customData branch January 13, 2019 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants