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) »
  • When my client visits the pledge dashboard they get this error
Pages: [1]

Author Topic: When my client visits the pledge dashboard they get this error  (Read 1082 times)

alfred_nutile

  • Ask me questions
  • ****
  • Posts: 464
  • Karma: 14
    • River Valley Tech Collective
When my client visits the pledge dashboard they get this error
August 30, 2011, 05:58:18 am

It is a site that has been updated since CiviCRM 2 and is not 3.4 so it has seen a number of updates.
It seems to be this part of the query "WHERE  status_id =  AND is_test=0"


Code: [Select]
Database Error Code: 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 is_test=0' at line 3, 1064
Additional Details:
Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => handle
        )

    [code] => -2
    [message] => DB Error: syntax error
    [mode] => 16
    [debug_info] =>
SELECT sum( amount ) as pledge_amount, count( id ) as pledge_count
FROM   civicrm_pledge
WHERE  status_id =  AND is_test=0
 [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 is_test=0' at line 3]
    [type] => DB_Error
    [user_info] =>
SELECT sum( amount ) as pledge_amount, count( id ) as pledge_count
FROM   civicrm_pledge
WHERE  status_id =  AND is_test=0
 [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 is_test=0' at line 3]
    [to_string] => [db_error: message="DB Error: syntax error" code=-2 mode=callback callback=CRM_Core_Error::handle prefix="" info="
SELECT sum( amount ) as pledge_amount, count( id ) as pledge_count
FROM   civicrm_pledge
WHERE  status_id =  AND is_test=0
 [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 is_test=0' at line 3]"]
)


Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: When my client visits the pledge dashboard they get this error
August 31, 2011, 06:49:21 am
Yes, status_id =  should be status_id =  3 or some such. Seems a status may have been removed somewhere along the way... A pledge status that is.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

alfred_nutile

  • Ask me questions
  • ****
  • Posts: 464
  • Karma: 14
    • River Valley Tech Collective
Re: When my client visits the pledge dashboard they get this error
August 31, 2011, 07:14:25 am
Since reports, new pledges etc all work I wonder if I should patch that query to default to 3?

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: When my client visits the pledge dashboard they get this error
August 31, 2011, 07:37:48 am
I made up 3 as an example--I didn't mean to indicate that is a magic number. :)

I don't know off hand what the correct number should be, although I am also not certain if hard coding it is the best solution...
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

alfred_nutile

  • Ask me questions
  • ****
  • Posts: 464
  • Karma: 14
    • River Valley Tech Collective
Re: When my client visits the pledge dashboard they get this error
August 31, 2011, 10:17:23 am
Thanks for the warning about 3  :)

Right I would not want to hard code it just not sure how it can be gone.  Reports work, new pledges work etc.

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: When my client visits the pledge dashboard they get this error
August 31, 2011, 10:19:14 am
not sure. maybe it's a default somewhere. Look in civicrm_option_group and civicrm_option_value tables to find the pledge status values. Maybe it will clue you in.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

alfred_nutile

  • Ask me questions
  • ****
  • Posts: 464
  • Karma: 14
    • River Valley Tech Collective
Re: When my client visits the pledge dashboard they get this error
August 31, 2011, 11:29:30 am
nice call!

<code>INSERT INTO `civicrm_option_value` (`id`, `option_group_id`, `label`, `value`, `name`, `grouping`, `filter`, `is_default`, `weight`, `description`, `is_optgroup`, `is_reserved`, `is_active`, `component_id`, `domain_id`, `visibility_id`)
VALUES
   (233, 11, 'Overdue', '6', 'Overdue', NULL, 0, NULL, 6, NULL, 0, 0, 1, NULL, NULL, NULL);

</code>

The row was missing 'name' and 'filter'


Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: When my client visits the pledge dashboard they get this error
August 31, 2011, 11:39:07 am
Glad you got it. :)
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • When my client visits the pledge dashboard they get this error

This forum was archived on 2017-11-26.