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 »
  • Using CiviCRM »
  • Using CiviMember (Moderator: Deepak Srivastava) »
  • membership renewal bug?
Pages: [1]

Author Topic: membership renewal bug?  (Read 4301 times)

adixon

  • I post frequently
  • ***
  • Posts: 314
  • Karma: 19
    • Blackfly Solutions
membership renewal bug?
December 18, 2009, 01:59:33 pm
i've got a site that's just been upgraded from 2.9 to 3.0.3. When using the administrative feature of renewing a membership (with contribution), then I get a fatal error:

Error Details:
Code: [Select]
Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => handle
        )

    [code] => -2
    [message] => DB Error: syntax error
    [mode] => 16
    [debug_info] => SELECT *
 FROM civicrm_membership
 
 WHERE ( status_id !=  )  AND (  civicrm_membership.id = 3141 ) AND (  civicrm_membership.contact_id = 10976 ) AND (  civicrm_membership.membership_type_id = 1 ) AND (  civicrm_membership.is_test = 0 )
 
 
 ORDER BY start_date DESC  
 [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')  AND (  civicrm_membership.id = 3141 ) AND (  civicrm_membership.contact_id = ' at line 4]
    [type] => DB_Error
    [user_info] => SELECT *
 FROM civicrm_membership
 
 WHERE ( status_id !=  )  AND (  civicrm_membership.id = 3141 ) AND (  civicrm_membership.contact_id = 10976 ) AND (  civicrm_membership.membership_type_id = 1 ) AND (  civicrm_membership.is_test = 0 )
 
 
 ORDER BY start_date DESC  
 [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')  AND (  civicrm_membership.id = 3141 ) AND (  civicrm_membership.contact_id = ' at line 4]
    [to_string] => [db_error: message="DB Error: syntax error" code=-2 mode=callback callback=CRM_Core_Error::handle prefix="" info="SELECT *
 FROM civicrm_membership
 
 WHERE ( status_id !=  )  AND (  civicrm_membership.id = 3141 ) AND (  civicrm_membership.contact_id = 10976 ) AND (  civicrm_membership.membership_type_id = 1 ) AND (  civicrm_membership.is_test = 0 )
 
 
 ORDER BY start_date DESC  
 [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')  AND (  civicrm_membership.id = 3141 ) AND (  civicrm_membership.contact_id = ' at line 4]"]
)
Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => handle
        )

    [code] => -2
    [message] => DB Error: syntax error
    [mode] => 16
    [debug_info] => SELECT *
 FROM civicrm_membership
 
 WHERE ( status_id !=  )  AND (  civicrm_membership.id = 3141 ) AND (  civicrm_membership.contact_id = 10976 ) AND (  civicrm_membership.membership_type_id = 1 ) AND (  civicrm_membership.is_test = 0 )
 
 
 ORDER BY start_date DESC  
 [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')  AND (  civicrm_membership.id = 3141 ) AND (  civicrm_membership.contact_id = ' at line 4]
    [type] => DB_Error
    [user_info] => SELECT *
 FROM civicrm_membership
 
 WHERE ( status_id !=  )  AND (  civicrm_membership.id = 3141 ) AND (  civicrm_membership.contact_id = 10976 ) AND (  civicrm_membership.membership_type_id = 1 ) AND (  civicrm_membership.is_test = 0 )
 
 
 ORDER BY start_date DESC  
 [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')  AND (  civicrm_membership.id = 3141 ) AND (  civicrm_membership.contact_id = ' at line 4]
    [to_string] => [db_error: message="DB Error: syntax error" code=-2 mode=callback callback=CRM_Core_Error::handle prefix="" info="SELECT *
 FROM civicrm_membership
 
 WHERE ( status_id !=  )  AND (  civicrm_membership.id = 3141 ) AND (  civicrm_membership.contact_id = 10976 ) AND (  civicrm_membership.membership_type_id = 1 ) AND (  civicrm_membership.is_test = 0 )
 
 
 ORDER BY start_date DESC  
 [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')  AND (  civicrm_membership.id = 3141 ) AND (  civicrm_membership.contact_id = ' at line 4]"]
)

Any clues? The specific sql error is the
Code: [Select]
(status_id != ) part of the where.[/code][/code]

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: membership renewal bug?
December 18, 2009, 04:32:57 pm

i suspect the deceased status is missing from your civicrm_membership_status table. i think there was an upgrade issue which caused this

here is the value in my default trunk install

Code: [Select]
select * from civicrm_membership_status where id = 7 \G;
*************************** 1. row ***************************
                         id: 7
                       name: Deceased
                start_event: NULL
    start_event_adjust_unit: NULL
start_event_adjust_interval: NULL
                  end_event: NULL
      end_event_adjust_unit: NULL
  end_event_adjust_interval: NULL
          is_current_member: 0
                   is_admin: 1
                     weight: 7
                 is_default: 0
                  is_active: 1
                is_reserved: 1
1 row in set (0.61 sec)

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

majovdh

  • I post occasionally
  • **
  • Posts: 58
  • Karma: 2
    • Chautaara VZW
  • CiviCRM version: 4.2.6
  • CMS version: drupal 7.17
  • MySQL version: 5.1.56
  • PHP version: 5.2.17
Re: membership renewal bug?
December 19, 2009, 09:01:17 pm
Hello,

I have the same thing happening, how to solve this?
Code: [Select]
Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => handle
        )

    [code] => -2
    [message] => DB Error: syntax error
    [mode] => 16
    [debug_info] => SELECT *
 FROM civicrm_membership
 
 WHERE ( status_id !=  )  AND (  civicrm_membership.id = 2 ) AND (  civicrm_membership.contact_id = 3 ) AND (  civicrm_membership.membership_type_id = 3 ) AND (  civicrm_membership.is_test = 0 )
 
 
 ORDER BY start_date DESC  
 [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')  AND (  civicrm_membership.id = 2 ) AND (  civicrm_membership.contact_id = 3 )' at line 4]
    [type] => DB_Error
    [user_info] => SELECT *
 FROM civicrm_membership
 
 WHERE ( status_id !=  )  AND (  civicrm_membership.id = 2 ) AND (  civicrm_membership.contact_id = 3 ) AND (  civicrm_membership.membership_type_id = 3 ) AND (  civicrm_membership.is_test = 0 )
 
 
 ORDER BY start_date DESC  
 [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')  AND (  civicrm_membership.id = 2 ) AND (  civicrm_membership.contact_id = 3 )' at line 4]
    [to_string] => [db_error: message="DB Error: syntax error" code=-2 mode=callback callback=CRM_Core_Error::handle prefix="" info="SELECT *
 FROM civicrm_membership
 
 WHERE ( status_id !=  )  AND (  civicrm_membership.id = 2 ) AND (  civicrm_membership.contact_id = 3 ) AND (  civicrm_membership.membership_type_id = 3 ) AND (  civicrm_membership.is_test = 0 )
 
 
 ORDER BY start_date DESC  
 [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')  AND (  civicrm_membership.id = 2 ) AND (  civicrm_membership.contact_id = 3 )' at line 4]"]
)
[/code]

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: membership renewal bug?
December 20, 2009, 01:19:50 am
Try this solution: http://forum.civicrm.org/index.php/topic,10092.msg46464.html#msg46464

Kurund
Found this reply helpful? Support CiviCRM

majovdh

  • I post occasionally
  • **
  • Posts: 58
  • Karma: 2
    • Chautaara VZW
  • CiviCRM version: 4.2.6
  • CMS version: drupal 7.17
  • MySQL version: 5.1.56
  • PHP version: 5.2.17
Re: membership renewal bug?
December 20, 2009, 07:31:03 am
Don't think that is the problem,

I have, in dutch that status role (see screenshot) and even if i add the role in english i have the same message.

Majo
« Last Edit: December 20, 2009, 08:37:19 am by majovdh »

majovdh

  • I post occasionally
  • **
  • Posts: 58
  • Karma: 2
    • Chautaara VZW
  • CiviCRM version: 4.2.6
  • CMS version: drupal 7.17
  • MySQL version: 5.1.56
  • PHP version: 5.2.17
Re: membership renewal bug?
December 20, 2009, 11:56:59 am
Nobody haven an idea of this problem? 1 of januari i have to renew a lot of memberships and with this problem its not possible.

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: membership renewal bug?
December 20, 2009, 12:04:19 pm
May be you should contact someone from professional list to help you on this. (http://civicrm.org/professional)

Kurund
Found this reply helpful? Support CiviCRM

majovdh

  • I post occasionally
  • **
  • Posts: 58
  • Karma: 2
    • Chautaara VZW
  • CiviCRM version: 4.2.6
  • CMS version: drupal 7.17
  • MySQL version: 5.1.56
  • PHP version: 5.2.17
Re: membership renewal bug?
December 20, 2009, 12:38:32 pm
Sorry we have no money to pay proffesional. Anyway this was a clean installation first 3.0.1 then upgrade to 3.1beta2. What can be the problem.

I also tried the solution uyou suggested in the previous post.

Updatemembershiprecord.php (this was still .txt is this possible)

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: membership renewal bug?
December 21, 2009, 12:48:10 am
Check http://sandbox.civicrm.org/civicrm/admin/member/membershipStatus&reset=1, this looks bit different from you screenshot. Do you have any local modifications ?

Kurund
Found this reply helpful? Support CiviCRM

majovdh

  • I post occasionally
  • **
  • Posts: 58
  • Karma: 2
    • Chautaara VZW
  • CiviCRM version: 4.2.6
  • CMS version: drupal 7.17
  • MySQL version: 5.1.56
  • PHP version: 5.2.17
Re: membership renewal bug?
December 21, 2009, 01:31:32 am
Hello Kurund

My screen looks exactly the same, the only thing is that its translated in dutch.

What is the meening of the line in the the fatal error mentioning

Code: [Select]
WHERE ( status_id !=  )
Is it possible the ! is the problem? In the rest of the line this is not mentioned

Code: [Select]
FROM civicrm_membership
 
 WHERE ( status_id !=  )  AND (  civicrm_membership.id = 2 ) AND (  civicrm_membership.contact_id = 3 ) AND (  civicrm_membership.membership_type_id = 3 ) AND (  civicrm_membership.is_test = 0 )
 
 


Majo

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: membership renewal bug?
December 21, 2009, 01:42:11 am
can you jump on #civicrm irc, it will be easier to debug. http://webchat.freenode.net/?channels=#civicrm

Kurund
Found this reply helpful? Support CiviCRM

majovdh

  • I post occasionally
  • **
  • Posts: 58
  • Karma: 2
    • Chautaara VZW
  • CiviCRM version: 4.2.6
  • CMS version: drupal 7.17
  • MySQL version: 5.1.56
  • PHP version: 5.2.17
Re: membership renewal bug?
December 21, 2009, 05:48:56 am
backTrace
/home/mhostorg/public_html/chautaara.org/sites/all/modules/civicrm/CRM/Core/Error.php, backtrace, 146
, handle,
/home/mhostorg/public_html/chautaara.org/sites/all/modules/civicrm/packages/PEAR.php, call_user_func, 931
/home/mhostorg/public_html/chautaara.org/sites/all/modules/civicrm/packages/DB.php, PEAR_Error, 966
/home/mhostorg/public_html/chautaara.org/sites/all/modules/civicrm/packages/PEAR.php, DB_Error, 564
/home/mhostorg/public_html/chautaara.org/sites/all/modules/civicrm/packages/DB/common.php, raiseError, 1903
/home/mhostorg/public_html/chautaara.org/sites/all/modules/civicrm/packages/DB/mysql.php, raiseError, 898
/home/mhostorg/public_html/chautaara.org/sites/all/modules/civicrm/packages/DB/mysql.php, mysqlRaiseError, 327
/home/mhostorg/public_html/chautaara.org/sites/all/modules/civicrm/packages/DB/common.php, simpleQuery, 1216
/home/mhostorg/public_html/chautaara.org/sites/all/modules/civicrm/packages/DB/DataObject.php, query, 2405
/home/mhostorg/public_html/chautaara.org/sites/all/modules/civicrm/packages/DB/DataObject.php, _query, 442
/home/mhostorg/public_html/chautaara.org/sites/all/modules/civicrm/CRM/Member/BAO/Membership.php, find, 704
/home/mhostorg/public_html/chautaara.org/sites/all/modules/civicrm/CRM/Member/BAO/Membership.php, getContactMembership, 1120
/home/mhostorg/public_html/chautaara.org/sites/all/modules/civicrm/CRM/Member/Form/MembershipRenewal.php, renewMembership, 446
/home/mhostorg/public_html/chautaara.org/sites/all/modules/civicrm/CRM/Core/Form.php, postProcess, 249
/home/mhostorg/public_html/chautaara.org/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Upload.php, mainProcess, 152
/home/mhostorg/public_html/chautaara.org/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Upload.php, realPerform, 129
/home/mhostorg/public_html/chautaara.org/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php, perform, 203
/home/mhostorg/public_html/chautaara.org/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php, handle, 103
/home/mhostorg/public_html/chautaara.org/sites/all/modules/civicrm/CRM/Core/Controller.php, handle, 249
/home/mhostorg/public_html/chautaara.org/sites/all/modules/civicrm/CRM/Member/Page/Tab.php, run, 177
/home/mhostorg/public_html/chautaara.org/sites/all/modules/civicrm/CRM/Member/Page/Tab.php, edit, 230
/home/mhostorg/public_html/chautaara.org/sites/all/modules/civicrm/CRM/Core/Invoke.php, run, 209
/home/mhostorg/public_html/chautaara.org/sites/all/modules/civicrm/drupal/civicrm.module, invoke, 335
, civicrm_invoke,
/home/mhostorg/public_html/chautaara.org/includes/menu.inc, call_user_func_array, 348
/home/mhostorg/public_html/chautaara.org/index.php, menu_execute_active_handler, 18

Kiran Jagtap

  • Ask me questions
  • ****
  • Posts: 533
  • Karma: 51
Re: membership renewal bug?
December 21, 2009, 06:11:20 am
I suspect "Pending" membership status is absent from civicrm_membership_status table;

here is the value in my default 3.1 install

Code: [Select]
select * from civicrm_membership_status where name = "Pending" \G;
*************************** 1. row ***************************
                         id: 5
                start_event: join_date
    start_event_adjust_unit: NULL
start_event_adjust_interval: NULL
                  end_event: join_date
      end_event_adjust_unit: NULL
  end_event_adjust_interval: NULL
          is_current_member: 0
                   is_admin: 0
                     weight: 5
                 is_default: 0
                  is_active: 1
                is_reserved: 1
                       name: Pending

hope this help.

kiran
You Are Designed To Choose... Defined By Choice.

adixon

  • I post frequently
  • ***
  • Posts: 314
  • Karma: 19
    • Blackfly Solutions
Re: membership renewal bug?
December 21, 2009, 09:49:02 am
thanks for all this, see below:

1. yes, my Deceased status was missing, so i guess that means the update script is missing something.

2. i added a record, as per your record you have in your new install, directly via sql.

3. I continued to get the same error.

4. Then i noticed that my 'Pending' status had been disabled, so i enabled it, and it now works.


Thank you!


 - Alan
« Last Edit: December 21, 2009, 09:58:32 am by adixon »

polestar

  • I post frequently
  • ***
  • Posts: 162
  • Karma: 11
    • Target Integration
Re: membership renewal bug?
May 24, 2010, 04:38:13 am
I support Alan's thought the only difference being, the pending status was uneditable from the user interface so I just went into the database to change the "is_active" field in the table "civicrm_membership_status" to 1 and it worked.
CiviCRM - Installation & Support | Virtual Private Servers (VPS) with Joomla/Drupal and CiviCRM | SugarCRM & vTiger CRM Installation and Support
Target Integration | www.targetintegration.com
Subscribe to Knowledgement - Your guide to effective business | http://www.knowledgement.ie

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMember (Moderator: Deepak Srivastava) »
  • membership renewal bug?

This forum was archived on 2017-11-26.