Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-8379

civicrm phonebank report fails on missing sql value

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Fixed/Completed
    • Affects Version/s: 3.4.1
    • Fix Version/s: 3.4.6
    • Labels:
      None

      Description

      When accessing the phone bank report, we get the following backtrace:

      /var/aegir/platforms/rossi-ourpowerbase-6.20-3.4.1/sites/all/modules/civicrm/CRM/Core/Error.php,
      backtrace, 159
      , handle,
      /var/aegir/platforms/rossi-ourpowerbase-6.20-3.4.1/sites/all/modules/civicrm/packages/PEAR.php,
      call_user_func, 931
      /var/aegir/platforms/rossi-ourpowerbase-6.20-3.4.1/sites/all/modules/civicrm/packages/DB.php,
      PEAR_Error, 968
      /var/aegir/platforms/rossi-ourpowerbase-6.20-3.4.1/sites/all/modules/civicrm/packages/PEAR.php,
      DB_Error, 564
      /var/aegir/platforms/rossi-ourpowerbase-6.20-3.4.1/sites/all/modules/civicrm/packages/DB/common.php,
      raiseError, 1903
      /var/aegir/platforms/rossi-ourpowerbase-6.20-3.4.1/sites/all/modules/civicrm/packages/DB/mysql.php,
      raiseError, 898
      /var/aegir/platforms/rossi-ourpowerbase-6.20-3.4.1/sites/all/modules/civicrm/packages/DB/mysql.php,
      mysqlRaiseError, 327
      /var/aegir/platforms/rossi-ourpowerbase-6.20-3.4.1/sites/all/modules/civicrm/packages/DB/common.php,
      simpleQuery, 1216
      /var/aegir/platforms/rossi-ourpowerbase-6.20-3.4.1/sites/all/modules/civicrm/packages/DB/DataObject.php,
      query, 2420
      /var/aegir/platforms/rossi-ourpowerbase-6.20-3.4.1/sites/all/modules/civicrm/packages/DB/DataObject.php,
      _query, 1606
      /var/aegir/platforms/rossi-ourpowerbase-6.20-3.4.1/sites/all/modules/civicrm/CRM/Core/DAO.php,
      query, 145
      /var/aegir/platforms/rossi-ourpowerbase-6.20-3.4.1/sites/all/modules/civicrm/CRM/Core/DAO.php,
      query, 873
      /var/aegir/platforms/rossi-ourpowerbase-6.20-3.4.1/sites/all/modules/civicrm_engage/Engage/Report/Form/List.php,
      executeQuery, 184
      /var/aegir/platforms/rossi-ourpowerbase-6.20-3.4.1/sites/all/modules/civicrm_engage/Engage/Report/Form/CallList.php,
      __construct, 46
      /var/aegir/platforms/rossi-ourpowerbase-6.20-3.4.1/sites/all/modules/civicrm/CRM/Core/Controller.php,
      __construct, 395
      /var/aegir/platforms/rossi-ourpowerbase-6.20-3.4.1/sites/all/modules/civicrm/CRM/Core/Controller/Simple.php,
      addPages, 81
      /var/aegir/platforms/rossi-ourpowerbase-6.20-3.4.1/sites/all/modules/civicrm/CRM/Utils/Wrapper.php,
      __construct, 90
      /var/aegir/platforms/rossi-ourpowerbase-6.20-3.4.1/sites/all/modules/civicrm/CRM/Report/Page/Report.php,
      run, 84
      /var/aegir/platforms/rossi-ourpowerbase-6.20-3.4.1/sites/all/modules/civicrm/CRM/Core/Invoke.php,
      run, 223
      /var/aegir/platforms/rossi-ourpowerbase-6.20-3.4.1/sites/all/modules/civicrm/drupal/civicrm.module,
      invoke, 363
      , civicrm_invoke,
      /var/aegir/platforms/rossi-ourpowerbase-6.20-3.4.1/includes/menu.inc,
      call_user_func_array, 348
      /var/aegir/platforms/rossi-ourpowerbase-6.20-3.4.1/index.php,
      menu_execute_active_handler, 18

      And this error:

      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 '' at line 1, 1064 Additional Details:

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

      [code] => -2
      [message] => DB Error: syntax error
      [mode] => 16
      [debug_info] => SELECT label, value FROM civicrm_option_value_en_US WHERE option_group_id= [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 1]
      [type] => DB_Error
      [user_info] => SELECT label, value FROM civicrm_option_value_en_US WHERE option_group_id= [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 1]
      [to_string] => [db_error: message="DB Error: syntax error" code=-2 mode=callback callback=CRM_Core_Error::handle prefix="" info="SELECT label, value FROM civicrm_option_value_en_US WHERE option_group_id= [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 1]"]

      The problem seems to be a case-sensitivity issue. The following patch is tested in 3.4.1:

      Index: List.php
      ===================================================================
      — List.php (revision 35031)
      +++ List.php (working copy)
      @@ -179,7 +179,7 @@
      $dao = CRM_Core_DAO::executeQuery( $query );
      $dao->fetch( );
      $this->_partyCol = $dao->column_name;

      • $partyOptGrp = $dao->option_group_ID;
        + $partyOptGrp = $dao->option_group_id;
        $query = "SELECT label, value"
        . " FROM civicrm_option_value"
        . " WHERE option_group_id={$partyOptGrp}";

        Attachments

          Activity

            People

            • Assignee:
              dgg David Greenberg
              Reporter:
              jamie Jamie McClelland
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: