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 CiviReport (Moderator: Dave Greenberg) »
  • Error when adding Group filter to CiviReport - Membership Detail
Pages: [1]

Author Topic: Error when adding Group filter to CiviReport - Membership Detail  (Read 1342 times)

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Error when adding Group filter to CiviReport - Membership Detail
January 05, 2011, 08:54:17 pm
I can't replicate this on the demo site, yet I don't have any custom code on my new 3.3.2 installation.  When I create a new report from "Membership Report (Detail)" template in CiviReport and select a group, I get a MySQL syntax error where the date is not escaped.  MySQL version is 5.0.84 - if that matters, which I don't think it does.  There is also an extra (

This was the error.  I'm submitting an issue now, there is a patch also.
http://issues.civicrm.org/jira/browse/CRM-7321

Code: [Select]
/home/unifem/public_html/sites/all/modules/civicrm/CRM/Core/Error.php, backtrace, 159
, handle,
/home/unifem/public_html/sites/all/modules/civicrm/packages/PEAR.php, call_user_func, 931
/home/unifem/public_html/sites/all/modules/civicrm/packages/DB.php, PEAR_Error, 968
/home/unifem/public_html/sites/all/modules/civicrm/packages/PEAR.php, DB_Error, 564
/home/unifem/public_html/sites/all/modules/civicrm/packages/DB/common.php, raiseError, 1903
/home/unifem/public_html/sites/all/modules/civicrm/packages/DB/mysql.php, raiseError, 898
/home/unifem/public_html/sites/all/modules/civicrm/packages/DB/mysql.php, mysqlRaiseError, 327
/home/unifem/public_html/sites/all/modules/civicrm/packages/DB/common.php, simpleQuery, 1216
/home/unifem/public_html/sites/all/modules/civicrm/packages/DB/DataObject.php, query, 2421
/home/unifem/public_html/sites/all/modules/civicrm/packages/DB/DataObject.php, _query, 1607
/home/unifem/public_html/sites/all/modules/civicrm/CRM/Core/DAO.php, query, 145
/home/unifem/public_html/sites/all/modules/civicrm/CRM/Core/DAO.php, query, 868
/home/unifem/public_html/sites/all/modules/civicrm/CRM/Contact/BAO/GroupContactCache.php, executeQuery, 83
/home/unifem/public_html/sites/all/modules/civicrm/CRM/Report/Form.php, check, 1863
/home/unifem/public_html/sites/all/modules/civicrm/CRM/Report/Form.php, whereGroupClause, 972
/home/unifem/public_html/sites/all/modules/civicrm/CRM/Report/Form/Member/Detail.php, whereClause, 261
/home/unifem/public_html/sites/all/modules/civicrm/CRM/Report/Form.php, where, 1564
/home/unifem/public_html/sites/all/modules/civicrm/CRM/Report/Form/Member/Detail.php, buildQuery, 293
/home/unifem/public_html/sites/all/modules/civicrm/CRM/Core/Form.php, postProcess, 250
/home/unifem/public_html/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Submit.php, mainProcess, 78
/home/unifem/public_html/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php, perform, 203
/home/unifem/public_html/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php, handle, 103
/home/unifem/public_html/sites/all/modules/civicrm/CRM/Core/Controller.php, handle, 284
/home/unifem/public_html/sites/all/modules/civicrm/CRM/Utils/Wrapper.php, run, 115
/home/unifem/public_html/sites/all/modules/civicrm/CRM/Report/Page/Report.php, run, 84
/home/unifem/public_html/sites/all/modules/civicrm/CRM/Core/Invoke.php, run, 219
/home/unifem/public_html/sites/all/modules/civicrm/drupal/civicrm.module, invoke, 356
, civicrm_invoke,
/home/unifem/public_html/includes/menu.inc, call_user_func_array, 348
/home/unifem/public_html/index.php, menu_execute_active_handler, 18

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

    [code] => -2
    [message] => DB Error: syntax error
    [mode] => 16
    [debug_info] =>
SELECT     g.id
FROM       civicrm_group g
WHERE      g.id IN ( 35 ) AND ( g.saved_search_id IS NOT NULL OR g.children IS NOT NULL ) AND
          (g.cache_date IS NULL OR (TIMESTAMPDIFF(MINUTE, g.cache_date, 2011-01-06 04:09:10)) >= 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 '04:09:10)) >= 0))' at line 4]
    [type] => DB_Error
    [user_info] =>
SELECT     g.id
FROM       civicrm_group g
WHERE      g.id IN ( 35 ) AND ( g.saved_search_id IS NOT NULL OR g.children IS NOT NULL ) AND
          (g.cache_date IS NULL OR (TIMESTAMPDIFF(MINUTE, g.cache_date, 2011-01-06 04:09:10)) >= 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 '04:09:10)) >= 0))' at line 4]
    [to_string] => [db_error: message="DB Error: syntax error" code=-2 mode=callback callback=CRM_Core_Error::handle prefix="" info="
SELECT     g.id
FROM       civicrm_group g
WHERE      g.id IN ( 35 ) AND ( g.saved_search_id IS NOT NULL OR g.children IS NOT NULL ) AND
          (g.cache_date IS NULL OR (TIMESTAMPDIFF(MINUTE, g.cache_date, 2011-01-06 04:09:10)) >= 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 '04:09:10)) >= 0))' at line 4]"]
)
[/code]
« Last Edit: January 06, 2011, 10:37:37 am by Stoob »
Try CiviTeacher: the online video tutorial CiviCRM learning library.

sushant

  • I post frequently
  • ***
  • Posts: 126
  • Karma: 8
  • CiviCRM version: v3.2.x,v3.3.x v4.0.x, v4.x,trunk
  • CMS version: Drupal 6/7 ,joomla 1.5,1.6
  • MySQL version: 5.1.51
  • PHP version: 5.3.3
Re: Error when adding Group filter to CiviReport - Membership Detail
January 06, 2011, 10:02:44 pm
Hi Stoob ,
Thanks for reporting & the patch .
It will be part of  CiviCRM next Stable Release v3.3.3.

Thanks,
Sushant.
CiviCRM Priority Support
http://support.civigardens.com/
http://osseed.com

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviReport (Moderator: Dave Greenberg) »
  • Error when adding Group filter to CiviReport - Membership Detail

This forum was archived on 2017-11-26.