64文字の制限を超えた列名の修正

カスタムフィールドを使用してレポートを生成しようとしています。

nativecode = 1166 **不適切な列名

This happens when the report is trying to generate temp tables
using an alias as the column name in my case
civicrm_value_conference_membership_details_version_2_62_custom_469

この文字列は 67
文字なので、テーブルを作成できません。この問題の解決策はありますか?私はすでにコンテンツが生成されているので、元のテーブルの名前を変更するのは簡単ではありません。

考えられる提案:

  • カスタムフィールドテーブルの名前を簡単に変更する方法は?
  • 64ビット文字に制限されたカスタムエイリアスを作成するためのより良い方法です。特に、テンポラリテーブルを作成するときに使用します。

完全なエラー:

Mar 13 15:49:41  [info] $Fatal Error Details = Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => handle
        )

    [code] => -1
    [message] => DB Error: unknown error
    [mode] => 16
    [debug_info] => CREATE TEMPORARY TABLE civireport_activity_temp_target  DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci AS
SELECT civicrm_contact_target.sort_name as civicrm_contact_contact_target, civicrm_contact_target.id as civicrm_contact_contact_target_id, activity_civireport.id as civicrm_activity_id, activity_civireport.source_record_id as civicrm_activity_source_record_id, activity_civireport.activity_type_id as civicrm_activity_activity_type_id, activity_civireport.subject as civicrm_activity_activity_subject, activity_civireport.activity_date_time as civicrm_activity_activity_date_time, value_conference_membership_details_22_civireport.total_member_180 as civicrm_value_conference_membership_details_22_custom_180, value_conference_membership_details_22_civireport.total_full_181 as civicrm_value_conference_membership_details_22_custom_181, value_conference_membership_details_22_civireport.male_full_182 as civicrm_value_conference_membership_details_22_custom_182, value_conference_membership_details_22_civireport.female_full_183 as civicrm_value_conference_membership_details_22_custom_183, value_conference_membership_details_22_civireport.catholic_full_184 as civicrm_value_conference_membership_details_22_custom_184, value_conference_membership_details_22_civireport.total_aux_188 as civicrm_value_conference_membership_details_22_custom_188, value_conference_membership_details_22_civireport.male_aux_189 as civicrm_value_conference_membership_details_22_custom_189, value_conference_membership_details_22_civireport.female_aux_190 as civicrm_value_conference_membership_details_22_custom_190, value_conference_membership_details_22_civireport.catholic_aux_191 as civicrm_value_conference_membership_details_22_custom_191, value_conference_membership_details_22_civireport.total_others_honorary_young_reti_209 as civicrm_value_conference_membership_details_22_custom_209, value_conference_membership_details_version_2_62_civireport.membership_year_469 as civicrm_value_conference_membership_details_version_2_62_custom_469, address_civireport.street_name as civicrm_address_street_name, address_civireport.street_number as civicrm_address_street_number, address_civireport.street_address as civicrm_address_street_address, address_civireport.city as civicrm_address_city, address_civireport.postal_code as civicrm_address_postal_code
        FROM civicrm_activity activity_civireport
             INNER JOIN civicrm_activity_contact  activity_contact_civireport
                    ON activity_civireport.id = activity_contact_civireport.activity_id AND
                       activity_contact_civireport.record_type_id = 3
             INNER JOIN civicrm_contact civicrm_contact_target
                    ON activity_contact_civireport.contact_id = civicrm_contact_target.id

                 LEFT JOIN civicrm_address address_civireport
                           ON (civicrm_contact_target.id =
                               address_civireport.contact_id) AND
                               address_civireport.is_primary = 1

LEFT JOIN civicrm_value_conference_membership_details_22 value_conference_membership_details_22_civireport ON value_conference_membership_details_22_civireport.entity_id = activity_civireport.id
LEFT JOIN civicrm_value_conference_membership_details_version_2_62 value_conference_membership_details_version_2_62_civireport ON value_conference_membership_details_version_2_62_civireport.entity_id = activity_civireport.id  WHERE activity_civireport.is_test = 0 AND
                                activity_civireport.is_deleted = 0 AND
                                activity_civireport.is_current_revision = 1 AND ( activity_civireport.subject LIKE '%2014%' ) AND ( activity_civireport.activity_type_id IN (60) )  [nativecode=1166 ** Incorrect column name 'civicrm_value_conference_membership_details_version_2_62_custom_469']
    [type] => DB_Error
    [user_info] => CREATE TEMPORARY TABLE civireport_activity_temp_target  DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci AS
SELECT civicrm_contact_target.sort_name as civicrm_contact_contact_target, civicrm_contact_target.id as civicrm_contact_contact_target_id, activity_civireport.id as civicrm_activity_id, activity_civireport.source_record_id as civicrm_activity_source_record_id, activity_civireport.activity_type_id as civicrm_activity_activity_type_id, activity_civireport.subject as civicrm_activity_activity_subject, activity_civireport.activity_date_time as civicrm_activity_activity_date_time, value_conference_membership_details_22_civireport.total_member_180 as civicrm_value_conference_membership_details_22_custom_180, value_conference_membership_details_22_civireport.total_full_181 as civicrm_value_conference_membership_details_22_custom_181, value_conference_membership_details_22_civireport.male_full_182 as civicrm_value_conference_membership_details_22_custom_182, value_conference_membership_details_22_civireport.female_full_183 as civicrm_value_conference_membership_details_22_custom_183, value_conference_membership_details_22_civireport.catholic_full_184 as civicrm_value_conference_membership_details_22_custom_184, value_conference_membership_details_22_civireport.total_aux_188 as civicrm_value_conference_membership_details_22_custom_188, value_conference_membership_details_22_civireport.male_aux_189 as civicrm_value_conference_membership_details_22_custom_189, value_conference_membership_details_22_civireport.female_aux_190 as civicrm_value_conference_membership_details_22_custom_190, value_conference_membership_details_22_civireport.catholic_aux_191 as civicrm_value_conference_membership_details_22_custom_191, value_conference_membership_details_22_civireport.total_others_honorary_young_reti_209 as civicrm_value_conference_membership_details_22_custom_209, value_conference_membership_details_version_2_62_civireport.membership_year_469 as civicrm_value_conference_membership_details_version_2_62_custom_469, address_civireport.street_name as civicrm_address_street_name, address_civireport.street_number as civicrm_address_street_number, address_civireport.street_address as civicrm_address_street_address, address_civireport.city as civicrm_address_city, address_civireport.postal_code as civicrm_address_postal_code
        FROM civicrm_activity activity_civireport
             INNER JOIN civicrm_activity_contact  activity_contact_civireport
                    ON activity_civireport.id = activity_contact_civireport.activity_id AND
                       activity_contact_civireport.record_type_id = 3
             INNER JOIN civicrm_contact civicrm_contact_target
                    ON activity_contact_civireport.contact_id = civicrm_contact_target.id

                 LEFT JOIN civicrm_address address_civireport
                           ON (civicrm_contact_target.id =
                               address_civireport.contact_id) AND
                               address_civireport.is_primary = 1

LEFT JOIN civicrm_value_conference_membership_details_22 value_conference_membership_details_22_civireport ON value_conference_membership_details_22_civireport.entity_id = activity_civireport.id
LEFT JOIN civicrm_value_conference_membership_details_version_2_62 value_conference_membership_details_version_2_62_civireport ON value_conference_membership_details_version_2_62_civireport.entity_id = activity_civireport.id  WHERE activity_civireport.is_test = 0 AND
                                activity_civireport.is_deleted = 0 AND
                                activity_civireport.is_current_revision = 1 AND ( activity_civireport.subject LIKE '%2014%' ) AND ( activity_civireport.activity_type_id IN (60) )  [nativecode=1166 ** Incorrect column name 'civicrm_value_conference_membership_details_version_2_62_custom_469']
    [to_string] => [db_error: message="DB Error: unknown error" code=-1 mode=callback callback=CRM_Core_Error::handle prefix="" info="CREATE TEMPORARY TABLE civireport_activity_temp_target  DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci AS
SELECT civicrm_contact_target.sort_name as civicrm_contact_contact_target, civicrm_contact_target.id as civicrm_contact_contact_target_id, activity_civireport.id as civicrm_activity_id, activity_civireport.source_record_id as civicrm_activity_source_record_id, activity_civireport.activity_type_id as civicrm_activity_activity_type_id, activity_civireport.subject as civicrm_activity_activity_subject, activity_civireport.activity_date_time as civicrm_activity_activity_date_time, value_conference_membership_details_22_civireport.total_member_180 as civicrm_value_conference_membership_details_22_custom_180, value_conference_membership_details_22_civireport.total_full_181 as civicrm_value_conference_membership_details_22_custom_181, value_conference_membership_details_22_civireport.male_full_182 as civicrm_value_conference_membership_details_22_custom_182, value_conference_membership_details_22_civireport.female_full_183 as civicrm_value_conference_membership_details_22_custom_183, value_conference_membership_details_22_civireport.catholic_full_184 as civicrm_value_conference_membership_details_22_custom_184, value_conference_membership_details_22_civireport.total_aux_188 as civicrm_value_conference_membership_details_22_custom_188, value_conference_membership_details_22_civireport.male_aux_189 as civicrm_value_conference_membership_details_22_custom_189, value_conference_membership_details_22_civireport.female_aux_190 as civicrm_value_conference_membership_details_22_custom_190, value_conference_membership_details_22_civireport.catholic_aux_191 as civicrm_value_conference_membership_details_22_custom_191, value_conference_membership_details_22_civireport.total_others_honorary_young_reti_209 as civicrm_value_conference_membership_details_22_custom_209, value_conference_membership_details_version_2_62_civireport.membership_year_469 as civicrm_value_conference_membership_details_version_2_62_custom_469, address_civireport.street_name as civicrm_address_street_name, address_civireport.street_number as civicrm_address_street_number, address_civireport.street_address as civicrm_address_street_address, address_civireport.city as civicrm_address_city, address_civireport.postal_code as civicrm_address_postal_code
        FROM civicrm_activity activity_civireport
             INNER JOIN civicrm_activity_contact  activity_contact_civireport
                    ON activity_civireport.id = activity_contact_civireport.activity_id AND
                       activity_contact_civireport.record_type_id = 3
             INNER JOIN civicrm_contact civicrm_contact_target
                    ON activity_contact_civireport.contact_id = civicrm_contact_target.id

                 LEFT JOIN civicrm_address address_civireport
                           ON (civicrm_contact_target.id =
                               address_civireport.contact_id) AND
                               address_civireport.is_primary = 1

LEFT JOIN civicrm_value_conference_membership_details_22 value_conference_membership_details_22_civireport ON value_conference_membership_details_22_civireport.entity_id = activity_civireport.id
LEFT JOIN civicrm_value_conference_membership_details_version_2_62 value_conference_membership_details_version_2_62_civireport ON value_conference_membership_details_version_2_62_civireport.entity_id = activity_civireport.id  WHERE activity_civireport.is_test = 0 AND
                                activity_civireport.is_deleted = 0 AND
                                activity_civireport.is_current_revision = 1 AND ( activity_civireport.subject LIKE '%2014%' ) AND ( activity_civireport.activity_type_id IN (60) )  [nativecode=1166 ** Incorrect column name 'civicrm_value_conference_membership_details_version_2_62_custom_469']"]
)

スタックトレース:

Mar 13 15:49:41  [info] $backTrace = #0 /var/www/sites/my_website/sites/all/modules/civicrm/CRM/Core/Error.php(232): CRM_Core_Error::backtrace("backTrace", TRUE)
    #1 [internal function](): CRM_Core_Error::handle(Object(DB_Error))
    #2 /var/www/sites/my_website/sites/all/modules/civicrm/packages/PEAR.php(921): call_user_func((Array:2), Object(DB_Error))
    #3 /var/www/sites/my_website/sites/all/modules/civicrm/packages/DB.php(985): PEAR_Error->__construct("DB Error: unknown error", -1, 16, (Array:2), "CREATE TEMPORARY TABLE civireport_activity_temp_target  DEFAULT CHARACTER SET...")
    #4 /var/www/sites/my_website/sites/all/modules/civicrm/packages/PEAR.php(575): DB_Error->__construct(-1, 16, (Array:2), "CREATE TEMPORARY TABLE civireport_activity_temp_target  DEFAULT CHARACTER SET...")
    #5 [internal function](): PEAR->_raiseError(Object(DB_mysqli), NULL, -1, NULL, NULL, "CREATE TEMPORARY TABLE civireport_activity_temp_target  DEFAULT CHARACTER SET...", "DB_Error", TRUE)
    #6 /var/www/sites/my_website/sites/all/modules/civicrm/packages/PEAR.php(224): call_user_func_array((Array:2), (Array:8))
    #7 /var/www/sites/my_website/sites/all/modules/civicrm/packages/DB/common.php(1905): PEAR->__call("raiseError", (Array:7))
    #8 /var/www/sites/my_website/sites/all/modules/civicrm/packages/DB/common.php(1905): PEAR->raiseError(NULL, -1, NULL, NULL, "CREATE TEMPORARY TABLE civireport_activity_temp_target  DEFAULT CHARACTER SET...", "DB_Error", TRUE)
    #9 /var/www/sites/my_website/sites/all/modules/civicrm/packages/DB/mysqli.php(933): DB_common->raiseError(-1, NULL, NULL, NULL, "1166 ** Incorrect column name 'civicrm_value_conference_membership_details_ve...")
    #10 /var/www/sites/my_website/sites/all/modules/civicrm/packages/DB/mysqli.php(403): DB_mysqli->mysqliRaiseError()
    #11 /var/www/sites/my_website/sites/all/modules/civicrm/packages/DB/common.php(1216): DB_mysqli->simpleQuery("CREATE TEMPORARY TABLE civireport_activity_temp_target  DEFAULT CHARACTER SET...")
    #12 /var/www/sites/my_website/sites/all/modules/civicrm/packages/DB/DataObject.php(2446): DB_common->query("CREATE TEMPORARY TABLE civireport_activity_temp_target  DEFAULT CHARACTER SET...")
    #13 /var/www/sites/my_website/sites/all/modules/civicrm/packages/DB/DataObject.php(1635): DB_DataObject->_query("CREATE TEMPORARY TABLE civireport_activity_temp_target  DEFAULT CHARACTER SET...")
    #14 /var/www/sites/my_website/sites/all/modules/civicrm/CRM/Core/DAO.php(392): DB_DataObject->query("CREATE TEMPORARY TABLE civireport_activity_temp_target  DEFAULT CHARACTER SET...")
    #15 /var/www/sites/my_website/sites/all/modules/civicrm/CRM/Core/DAO.php(1348): CRM_Core_DAO->query("CREATE TEMPORARY TABLE civireport_activity_temp_target  DEFAULT CHARACTER SET...", TRUE)
    #16 /var/www/sites/my_website/sites/all/modules/civicrm/CRM/Report/Form.php(3477): CRM_Core_DAO::executeQuery("CREATE TEMPORARY TABLE civireport_activity_temp_target  DEFAULT CHARACTER SET...", (Array:0))
    #17 /var/www/sites/my_website/sites/all/modules/civicrm/CRM/Report/Form/Activity.php(817): CRM_Report_Form->executeReportQuery("CREATE TEMPORARY TABLE civireport_activity_temp_target  DEFAULT CHARACTER SET...")
    #18 /var/www/sites/my_website/sites/all/modules/civicrm/CRM/Report/Form/Activity.php(905): CRM_Report_Form_Activity->buildQuery(TRUE)
    #19 /var/www/sites/my_website/sites/all/modules/civicrm/CRM/Core/Form.php(447): CRM_Report_Form_Activity->postProcess()
    #20 /var/www/sites/my_website/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Submit.php(74): CRM_Core_Form->mainProcess()
    #21 /var/www/sites/my_website/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Submit->perform(Object(CRM_Report_Form_Activity), "submit")
    #22 /var/www/sites/my_website/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Report_Form_Activity), "submit")
    #23 /var/www/sites/my_website/sites/all/modules/civicrm/CRM/Core/Controller.php(351): HTML_QuickForm_Page->handle("submit")
    #24 /var/www/sites/my_website/sites/all/modules/civicrm/CRM/Utils/Wrapper.php(113): CRM_Core_Controller->run()
    #25 /var/www/sites/my_website/sites/all/modules/civicrm/CRM/Report/Page/Instance.php(89): CRM_Utils_Wrapper->run("CRM_Report_Form_Activity", NULL, NULL)
    #26 /var/www/sites/my_website/sites/all/modules/civicrm/CRM/Core/Invoke.php(309): CRM_Report_Page_Instance->run((Array:4), NULL)
    #27 /var/www/sites/my_website/sites/all/modules/civicrm/CRM/Core/Invoke.php(84): CRM_Core_Invoke::runItem((Array:14))
    #28 /var/www/sites/my_website/sites/all/modules/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:4))
    #29 /var/www/sites/my_website/sites/all/modules/civicrm/drupal/civicrm.module(445): CRM_Core_Invoke::invoke((Array:4))
    #30 [internal function](): civicrm_invoke("report", "instance", "61")
    #31 /var/www/sites/my_website/includes/menu.inc(527): call_user_func_array("civicrm_invoke", (Array:3))
    #32 /var/www/sites/my_website/index.php(21): menu_execute_active_handler()
    #33 {main}
ベストアンサー
申し訳ありませんが、適切な答えはありません

返信を残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です