-
-
Notifications
You must be signed in to change notification settings - Fork 825
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
Fix for ongoing issues with static upsetting the apple cart #18245
Conversation
(Standard links)
|
@eileenmcnaughton Checkstyle and conflict |
Ah yes - this conflicted with the other |
5beebab
to
ea59032
Compare
@agh1 or @MegaphoneJon or @agileware-pengyi is this something one of you would be able to review? |
I can have someone start reviewing today or the day following. |
Thanks @MegaphoneJon |
Hmm - I'd better check those test fails! |
OK - test fails required me to remove old hacks.... |
@eileenmcnaughton I can confirm that this fixes the problem described in #18218. However there is now a different fault. When the status of the primary Membership is changed to Expired from e.g. Current or Grace, this does not propagate to the related Membership(s). Other changes I have tried do propagate. I have seen this when changing the end date manually - I have not tried when running the Process Memberships scheduled job. |
@lalgwebdev thanks for checking - I think that is the issue the remaining failing test might be picked up too. You are testing through back office membership edit form? |
Failing job api_v3_JobTest.testProcessMembershipUpdateStatus |
I've fixed the test - I think this will fix the front end issue too... |
@eileenmcnaughton Yes - this is now working when I test it (through the administrator's edit membership form). |
@eileenmcnaughton Test fails relate. @lalgwebdev It looks like you're taking on review/testing, is that correct? |
This is an alternate to civicrm#18218 I managed to replicate the bug in https://issues.civicrm.org/jira/browse/CRM-4213 that the static was added to cover. This takes an alternate approach of loading the memberships & checking them rather than a static. I think it might mean more queries but they shouldn't be expensive queries & the code is just too hard-going to skip straight from hacked but still intermittantly buggy to also having no additional queries
test this please |
@lalgwebdev I made another change for the test fail - can you double check again? |
@eileenmcnaughton Yes, this works OK. |
Ah, OK, I get it now. I thought there was some unnecessary recursion, and I didn't realize that |
Overview
This is an alternate to #18218
Before
Under various edge cases - including the one in the test & in #18218 inherited memberships are not created
After
Memberships created more reliably
Technical Details
This removes a static variable which was intended to prevent a loop in https://issues.civicrm.org/jira/browse/CRM-4213
The static has caused various ongoing bugs - including https://issues.civicrm.org/jira/browse/CRM-19735 which got past it by flushing the static. Fundamentally the static is not reliable enough so I've switched to looking up & checking existing memberships.
I think it might mean more queries but they shouldn't be expensive queries & the
code is just too hard-going to skip straight from hacked but still intermittently buggy to 'good' (I won't pretend perfect was the enemy of good here- good was the enemy of 'not truly awful')
Comments
CRM-17723 was also a bug this static was interacting with