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 CiviContribute (Moderator: Donald Lobo) »
  • Fatal Error when trying to Record Contribution
Pages: [1]

Author Topic: Fatal Error when trying to Record Contribution  (Read 1096 times)

emilyf

  • Ask me questions
  • ****
  • Posts: 696
  • Karma: 54
  • CiviCRM version: 2.x - 4.x
  • CMS version: Drupal 5, 6, 7
Fatal Error when trying to Record Contribution
April 08, 2010, 09:32:52 am
Civi 3.1.

If I'm looking at a contact and go to the contributions tab, then choose 'Record Contribution (Check, Cash, EFT ...) ' I immediately get this fatal error:

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

    [code] => -2
    [message] => DB Error: syntax error
    [mode] => 16
    [debug_info] =>
SELECT civicrm_pledge.id id
FROM civicrm_pledge
WHERE civicrm_pledge.status_id   IN (2,,6)       
  AND civicrm_pledge.contact_id = 6016
 [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 '6)       
  AND civicrm_pledge.contact_id = 6016' at line 3]
    [type] => DB_Error
    [user_info] =>
SELECT civicrm_pledge.id id
FROM civicrm_pledge
WHERE civicrm_pledge.status_id   IN (2,,6)       
  AND civicrm_pledge.contact_id = 6016
 [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 '6)       
  AND civicrm_pledge.contact_id = 6016' at line 3]
    [to_string] => [db_error: message="DB Error: syntax error" code=-2 mode=callback callback=CRM_Core_Error::handle prefix="" info="
SELECT civicrm_pledge.id id
FROM civicrm_pledge
WHERE civicrm_pledge.status_id   IN (2,,6)       
  AND civicrm_pledge.contact_id = 6016
 [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 '6)       
  AND civicrm_pledge.contact_id = 6016' at line 3]"]
)

Looks like the issue is here: WHERE civicrm_pledge.status_id   IN (2,,6)

What should be getting input there? I cannot recreate this on the demo but I don't know why it's happening. It wasn't happen on my 3.0 install.[/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: Fatal Error when trying to Record Contribution
April 08, 2010, 09:45:53 pm

can you check if your 3.1 install has the same contribution status as a clean install

http://drupal.demo.civicrm.org/civicrm/admin/options/activity_type?group=contribution_status&reset=1

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

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Fatal Error when trying to Record Contribution
April 09, 2010, 02:37:57 am
I hit this where someone had renamed 'pending' status - ie - I guess that's what you might see when you follow Lobo's advice
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

emilyf

  • Ask me questions
  • ****
  • Posts: 696
  • Karma: 54
  • CiviCRM version: 2.x - 4.x
  • CMS version: Drupal 5, 6, 7
Re: Fatal Error when trying to Record Contribution
April 09, 2010, 05:20:54 am
OK, so I took a look there and I was missing 'in progress'. I also noticed none of mine were set to 'reserved' where the civi demo they are.

adding in 'in progress' manually at least let me get to the next screen (civicrm/contact/view/contribution?reset=1&action=add&cid=6016&context=contribution), but if I try to save I get

'Could not find valid value for cid'

if you think this is still related to the contribution status table, can you tell me where in the db i need to manually set the 'reserved' status. My 'in progress' and 'failed' statuses also don't have matching values to the demo (not sure why), so let me know if i need to reset those as well.

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Fatal Error when trying to Record Contribution
April 09, 2010, 01:29:04 pm
This error
Quote
Code: [Select]
'Could not find valid value for cid'

often goes away after flushing/ resetting / restarting browsers / sessions etc - is it definitely persistant?
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

emilyf

  • Ask me questions
  • ****
  • Posts: 696
  • Karma: 54
  • CiviCRM version: 2.x - 4.x
  • CMS version: Drupal 5, 6, 7
Re: Fatal Error when trying to Record Contribution
April 12, 2010, 06:40:02 am
thanks eileen, worked.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Fatal Error when trying to Record Contribution

This forum was archived on 2017-11-26.