[CRM-19091] Membership Status Pending Not Updating to Current (Scheduled Job) Created: 14/Jul/16  Updated: 25/Jul/16

Status: Open
Project: CiviCRM
Component/s: CiviMember
Affects Version/s: 4.7.9
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Lee Gooding Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Documentation Required?: None
Funding Source: Needs Funding


We have several memberships for people that have a Member SInce date and a start date set at a later date. Initially this will set the status to PENDING(Because we have the NEW status disabled). Once the date start date has passed the membership should update to CURRENT(once the scheduled job runs). However, when I run the schedule to update membership status it does not change all the PENDING to CURRENT.

If I go into manually edit the membership for a contact then save it right away it will update the status to CURRENT. This means that my rules are correct.

For example the following membership data has the status set to PENDING and will not update when the scheduled job runs:
Member Since: 6/16/2016
Start Date: 7/1/2016
End Date: 1/1/2017
After further examination of the statuses I have found the behavior related to PENDING to be confusing. Given the following order for status rules:
Current - start/end
Grace - end/end
Expired - end
New - member since/member since
Pending - member since/member since

If I attempt to add a membership at a later date (than today) with NEW status enabled it will create the membership properly. If I disable NEW (so that PENDING will now be the status) and attempt to create the membership it will fail with the following errors:

There is no valid Membership Status available for selected membership dates.
Membership Status Error
Oops, it looks like there is no valid membership status available for the given membership dates. You can Configure Membership Status Rules. OR You can sign up by setting Status Override? to true.

This leads me to believe that there is something wrong with the built-in PENDING status.

*On a side note, the default order for status has NEW as the first rule. When this is the case I believe it never updates to any of the other statuses.

Comment by KarinG [ 15/Jul/16 ]

Have bumped this up to (potentially - if verified) major based on what you describe here - membership status - esp in combination w/ CMS sync is important. How exactly does the first Membership entry get created?

Comment by Lee Gooding [ 15/Jul/16 ]

I just did another test creating a membership directly from the contact. I had to modify the start date in the DB after it was pending so that I could set the start date today (make sense?). I then double checked in the membership area for the contact and it showed pending with the start date for today. That way the schedule would see it as starting today and should update the status to current. I ran it and it does not update it.

Comment by KarinG [ 15/Jul/16 ]

Can you reproduce this on http://dmaster.demo.civicrm.org/ - where you can't make DB updates?

Comment by Lee Gooding [ 17/Jul/16 ]

I have created a membership on the demo site. I just have to wait until tomorrow now to see if it gets updated when I run the job.

I think there is something important to note. I have disabled the NEW status on my CiviCRM setup. By default NEW is the status that will be set when the start date is later than the entry date. PENDING never gets set. By disabling the NEW status, PENDING becomes the status in this case.

I have disabled NEW on the demo site and we will see what happens.

Comment by Lee Gooding [ 18/Jul/16 ]

I just went to check and see if the membership status was updated on the demo site. Unfortunately I have found that there is NO way that I can test this on the demo site. It looks like the DB is reset on a schedule and all the data is cleared to a default (which makes sense in case someone breaks it). At least this is the case with memberships, because it doesn't show for the contact I added it to yesterday.

Comment by KarinG [ 19/Jul/16 ]

It does get wiped (fairly) regularly and unfortunately for you that happened at an inopportune time. Do you want to give it another go? Remember to take lots of screenshots of all your screens; If your edits get wiped again - then I'll try reproduce this for you on a local dmaster.

Comment by Lee Gooding [ 20/Jul/16 ]

It reset everything again.

Here is a link to a doc with screenshots of what I did to set it up for testing: https://docs.google.com/document/d/1QUt6h2mJ0rjINx7WdGzJIErjSa8tu0X24_GUZpb7yH4/edit?usp=sharing

Please note the update to my issue regarding the ordering of the status rules. I noticed this after I had done the initial setup in the document. I'm pretty sure that PENDING and NEW should be below CURRENT, EXPIRED, GRACE (unless I am misunderstanding something).

Comment by KarinG [ 20/Jul/16 ]

Hi Lee - I'll try reproduce your workflow/issue and if I can find a partner to assign to the issue. I believe you are a CiviCRM Member right?

Comment by Lee Gooding [ 20/Jul/16 ]

Yes, I am a member.

Comment by Lee Gooding [ 25/Jul/16 ]

Looks like this may have been an issue for a while: http://civicrm.stackexchange.com/questions/3987/membership-statuses-not-being-updated

Generated at Thu Jul 28 22:11:13 UTC 2016 using JIRA 6.2#6252-sha1:aa343257d4ce030d9cb8c531be520be9fac1c996.