-
-
Notifications
You must be signed in to change notification settings - Fork 814
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
Code cleanup on Membership form when freezing fields in a recurring exists situation #12642
Conversation
(Standard links)
|
if ($this->_action & CRM_Core_Action::UPDATE | ||
&& CRM_Core_DAO::getFieldValue('CRM_Member_DAO_Membership', $this->_id, | ||
'contribution_recur_id') | ||
&& !CRM_Member_BAO_Membership::isSubscriptionCancelled($this->_id)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this function coming out of some existing code? I think it makes sense but I need to be sure it's not a change in behaviour? - ie. this is assuming that a cancelled membership cannot be renewed and that may not previously have been the case (even if it's the right thing to do)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mattwire check old lines 666 - 671
@eileenmcnaughton Could do with a bit of context here - is this a step towards merging Membership and MembershipRenewal forms? Is the freezing elements new for the Membership form, but existing on the MembershipRenewal forms? |
@mattwire yeah - a very preliminary step IMHO. When I looked at Membership form the 2 steps I thought should be first were
When I went to do 1 I added the entityFieldsTrait & defined the 3 fields in the setEntityFields & changed the tpl - I got it close to working but realised the setEntityFields needed to be able to specify whether end_date if freezable. |
Good to merge @eileenmcnaughton @seamuslee001 |
Merging as per @mattwire's review |
thanks @mattwire |
Overview
Minor code extraction & tidy up
Before
an array of $elements is built as fields are added. It takes work to figure out why
After
Elements to be frozen are frozen as they are added.
Technical Details
I actually was trying to extract out the handling of the date fields to the addEntityFieldsToTemplate() function & convert them to datepicker but I wound up feeling I had to unravel this first
Comments