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 Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • DB error on "Record Activity for Contacts" for group members
Pages: [1]

Author Topic: DB error on "Record Activity for Contacts" for group members  (Read 1158 times)

SteveM

  • I post occasionally
  • **
  • Posts: 47
  • Karma: 3
    • OpenConcept Consulting, Inc.
DB error on "Record Activity for Contacts" for group members
April 06, 2009, 04:45:16 pm
We are seeing a DB error when viewing the members of a group and then selecting "Record Activity for Contacts". The same error does not arise when selecting "Record Activity for Contacts" for a list of contacts returned from a regular search. This includes a regular search where the only criterion is membership in that same group.

Using CiviCRM 2.1.6.

Error message and backtrace follow:

Array
(
    [callback] => Array
        (
           
  • => CRM_Core_Error
  • [1] => handle
            )

       
Code: [Select]
=> -2
    [message] => DB Error: syntax error
    [mode] => 16
    [debug_info] => SELECT civicrm_option_value.label, civicrm_option_value.description
   FROM civicrm_option_value
        LEFT JOIN civicrm_option_group ON ( civicrm_option_value.option_group_id = civicrm_option_group.id )
   WHERE civicrm_option_group.name = 'activity_type'
         AND civicrm_option_value.value =    [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 '' at line 5]
    [type] => DB_Error
    [user_info] => SELECT civicrm_option_value.label, civicrm_option_value.description
   FROM civicrm_option_value
        LEFT JOIN civicrm_option_group ON ( civicrm_option_value.option_group_id = civicrm_option_group.id )
   WHERE civicrm_option_group.name = 'activity_type'
         AND civicrm_option_value.value =    [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 '' at line 5]
    [to_string] => [db_error: message="DB Error: syntax error" code=-2 mode=callback callback=CRM_Core_Error::handle prefix="" info="SELECT civicrm_option_value.label, civicrm_option_value.description
   FROM civicrm_option_value
        LEFT JOIN civicrm_option_group ON ( civicrm_option_value.option_group_id = civicrm_option_group.id )
   WHERE civicrm_option_group.name = 'activity_type'
         AND civicrm_option_value.value =    [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 '' at line 5]"]
)


backTrace

/home/dm6/sites/all/modules/civicrm/CRM/Core/Error.php, backtrace, 148
, handle,
/home/dm6/sites/all/modules/civicrm/packages/PEAR.php, call_user_func, 912
/home/dm6/sites/all/modules/civicrm/packages/DB.php, PEAR_Error, 966
/home/dm6/sites/all/modules/civicrm/packages/PEAR.php, DB_Error, 574
/home/dm6/sites/all/modules/civicrm/packages/DB/common.php, raiseError, 1903
/home/dm6/sites/all/modules/civicrm/packages/DB/mysql.php, raiseError, 898
/home/dm6/sites/all/modules/civicrm/packages/DB/mysql.php, mysqlRaiseError, 327
/home/dm6/sites/all/modules/civicrm/packages/DB/common.php, simpleQuery, 1216
/home/dm6/sites/all/modules/civicrm/packages/DB/DataObject.php, query, 2394
/home/dm6/sites/all/modules/civicrm/packages/DB/DataObject.php, _query, 1587
/home/dm6/sites/all/modules/civicrm/CRM/Core/DAO.php, query, 144
/home/dm6/sites/all/modules/civicrm/CRM/Core/DAO.php, query, 862
/home/dm6/sites/all/modules/civicrm/CRM/Core/BAO/OptionValue.php, executeQuery, 158
/home/dm6/sites/all/modules/civicrm/CRM/Activity/Form/Activity.php, getActivityTypeDetails, 201
/home/dm6/sites/all/modules/civicrm/CRM/Core/Form.php, preProcess, 312
/home/dm6/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Display.php, buildForm, 98
/home/dm6/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php, perform, 203
/home/dm6/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php, handle, 103
/home/dm6/sites/all/modules/civicrm/CRM/Core/Controller.php, handle, 232
/home/dm6/sites/all/modules/civicrm/CRM/Core/Invoke.php, run, 197
/home/dm6/sites/all/modules/civicrm/drupal/civicrm.module, invoke, 315
, civicrm_invoke,
/home/dm6/includes/menu.inc, call_user_func_array, 348
/home/dm6/index.php, menu_execute_active_handler, 18

Kiran Jagtap

  • Ask me questions
  • ****
  • Posts: 533
  • Karma: 51
Re: DB error on "Record Activity for Contacts" for group members
April 07, 2009, 01:00:14 am
hi,

Its a bug, to fix for v2.1
go to CRM/Activity/Form/Activity.php line around 198
Code: [Select]
if ( ( isset( $this->_context) && ! in_array( $this->_context, array('standalone', 'case', 'search' ) ) )  || $this->_activityTypeId ) {change to
Code: [Select]
if ( $this->_activityTypeId ) {
and apply patch from CRM-4350

It would be great if you look for upgrade CiviCRM to latest stable release ( v2.2.2 )  :)

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

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • DB error on "Record Activity for Contacts" for group members

This forum was archived on 2017-11-26.