CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • After 3.3.6 upgrade manual renew gets No valid membership status for given dates
Pages: [1]

Author Topic: After 3.3.6 upgrade manual renew gets No valid membership status for given dates  (Read 1734 times)

chriscant

  • I post occasionally
  • **
  • Posts: 66
  • Karma: 4
    • PHDCC
  • CiviCRM version: 4.2.19
After 3.3.6 upgrade manual renew gets No valid membership status for given dates
April 12, 2011, 07:01:12 am
Hello - We did an upgrade from 3.0.2 to 3.3.6 yesterday which seemed to go OK apart from one temporary hiccup - I might report on this later.

Users are able to renew their rolling yearly memberships online.

Today, we've found that doing manual renewals doesn't work:
The membership cannot be saved.
No valid membership status for given dates.


In a contact record if we select a membership (whether Current, Grace or Expired) and select Renew then tick Record Renewal Payment and paid by Cheque then we get the above error.

The membership I am looking at now has Member since 1 March 2004, Start Date 5 May 2010 and End date  4 May 2011.

I've tried patch http://issues.civicrm.org/jira/browse/CRM-7870 but that doesn't seem to help.  I guess it's in that area.  Has anyone any ideas?

Thanks in advance.  Chris

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: After 3.3.6 upgrade manual renew gets No valid membership status for given dates
April 12, 2011, 09:23:25 am
Quote
Today, we've found that doing manual renewals doesn't work:
The membership cannot be saved.
No valid membership status for given dates.

System gives this message when it is not able to calculate membership status. Can you make sure you have setup membership types correctly?

Kurund
Found this reply helpful? Support CiviCRM

chriscant

  • I post occasionally
  • **
  • Posts: 66
  • Karma: 4
    • PHDCC
  • CiviCRM version: 4.2.19
Re: After 3.3.6 upgrade manual renew gets No valid membership status for given dates
April 12, 2011, 09:49:16 am
Hi - They seem to be OK.  We were able to do this before.  Is there anything I should be looking for?  Thanks Chris
Is that code the right place to look?

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: After 3.3.6 upgrade manual renew gets No valid membership status for given dates
April 12, 2011, 05:31:59 pm
Chris - I tried renewing a membership w/ same Join Date, Start Date and End Date on my local 3.3.6 install using the sample General membership type (1 year duration, type = rolling) and the default Membership Status Rules. The membership renewal processed as expected - new end date May 4, 2012.

A few thoughts on how to proceed:
1. Replicate your configuration on public demo (membership type config, and any modifications you may have made to membership status rules), and see if error occurs.

2. You can debug in the code. The error is being thrown because the call to populate $calcStatus variable is returning an empty array. So start w/ line 225 in CRM/Member/BAO/Membership.php - which calls the CRM_Member_BAO_MembershipStatus::getMembershipStatusByDate( ) function.

Protect your investment in CiviCRM by  becoming a Member!

chriscant

  • I post occasionally
  • **
  • Posts: 66
  • Karma: 4
    • PHDCC
  • CiviCRM version: 4.2.19
Re: After 3.3.6 upgrade manual renew gets No valid membership status for given dates
April 13, 2011, 03:06:40 am
Thanks Dave

I did some debugging and found that it was date formats that were causing the problem.  And I know a workaround for us.

We're set to UK date format dd/mm/yy

However the Date Renewal Entered field is displaying in US format - see attachment and generated source below.

At line 1252 in CRM/Member/BAO/Membership.php is this:
  if ( $form->get( 'renewDate' ) ) {
    $changeToday = $form->get( 'renewDate' );

Yesterday 04/12/11 was shown and decoded as 4th December 2011.
Today 04/13/11 was shown and decoded as 1970 (as it was an erroneous date).
So I got a different error yesterday and today.

Our workaround is to click on the calendar and choose a date, even today's date.  This reversed the mm and dd.

It'll be code elsewhere that generates this output.  I'm not sure where that is.  Can someone help me find that?  Looks like a fix to the main Civi code is needed. I'm not sure if it applies to all date fields or just this instance.

Thanks
Chris

input formattype="activityDate" startoffset="20" endoffset="10" format="dd/mm/yy" readonly="1" name="renewal_date" type="text" value="04/13/2011" id="renewal_date" class="dateplugin" /><input type="text" name="renewal_date_hidden" id="renewal_date_hidden" class="hiddenElement"/
« Last Edit: April 13, 2011, 03:08:34 am by chriscant »

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: After 3.3.6 upgrade manual renew gets No valid membership status for given dates
April 13, 2011, 07:41:27 am
Yep - the setDefaults is not using the configured date input format to populate "Date Renewal Entered" on the renewal form. I think this is the only problem. I've filed an issue an committed a fix - but would be great if you could patch your file as follows and test:

CRM/Member/Form/MembershipRenwal.php

Replace this code lines 156-7
Code: [Select]
        $defaults['renewal_date'] = CRM_Utils_Date::getToday( CRM_Utils_Array::value( 'renewal_date', $defaults ),
                                                              'm/d/Y' );

.. with this:
Code: [Select]
        list( $now ) = CRM_Utils_Date::setDateDefaults( );
        $defaults['renewal_date']    = $now;
Protect your investment in CiviCRM by  becoming a Member!

chriscant

  • I post occasionally
  • **
  • Posts: 66
  • Karma: 4
    • PHDCC
  • CiviCRM version: 4.2.19
Re: After 3.3.6 upgrade manual renew gets No valid membership status for given dates
April 13, 2011, 09:11:38 am
That works thanks

I was initially confused as my test site runs 3.3.3 and the amended 3.3.6 code didn't work.  However the 3.3.3 and 3.3.6 versions are different.  The amended 3.3.3 version runs fine on my test site.

I'll do the 3.3.6 upgrade tomorrow morning first thing when it's quieter.  I assume it will be OK.  I'll report in anyway.

Thanks again, Chris

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: After 3.3.6 upgrade manual renew gets No valid membership status for given dates
April 13, 2011, 10:09:22 am
Chris - Just to be sure we're on the same page - you'll need to apply that change to your 3.3.6 code after you upgrade. The fix is going in to 3.4 / 4.0.
Protect your investment in CiviCRM by  becoming a Member!

chriscant

  • I post occasionally
  • **
  • Posts: 66
  • Karma: 4
    • PHDCC
  • CiviCRM version: 4.2.19
Re: After 3.3.6 upgrade manual renew gets No valid membership status for given dates
April 13, 2011, 10:29:02 am
Understood.  Thanks Chris

chriscant

  • I post occasionally
  • **
  • Posts: 66
  • Karma: 4
    • PHDCC
  • CiviCRM version: 4.2.19
Re: After 3.3.6 upgrade manual renew gets No valid membership status for given dates
April 14, 2011, 12:04:39 am
That's worked OK.  Chris

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • After 3.3.6 upgrade manual renew gets No valid membership status for given dates

This forum was archived on 2017-11-26.