# Question
Title: Exporting contacts merged to households causes DB error version 4.6.8
Viewed contacts from a Smart Group and went to Export. Merged to household and tried with and without do-not-mail/deceased criteria.

Seems to work OK if I select a couple of fields, but if I do primary export it crashes to blank screen and leaves this in log:

```
$Fatal Error Details = Array ( [callback] => Array ( [0] => CRM_Core_Error [1] => handle ) [code] => -1 [message] => DB Error: unknown error [mode] => 16 [debug_info] => SELECT contact_a.id as contact_id, contact_a.contact_type as `contact_type`, contact_a.contact_sub_type as `contact_sub_type`, contact_a.sort_name as `sort_name`, contact_a.display_name as `display_name`, contact_a.do_not_email as `do_not_email`, contact_a.do_not_phone as `do_not_phone`, contact_a.do_not_mail as `do_not_mail`, contact_a.do_not_sms as `do_not_sms`, contact_a.do_not_trade as `do_not_trade`, contact_a.is_opt_out as `is_opt_out`, contact_a.legal_identifier as `legal_identifier`, contact_a.external_identifier as `external_identifier`, contact_a.nick_name as `nick_name`, contact_a.legal_name as `legal_name`, contact_a.image_URL as `image_URL`, contact_a.preferred_communication_method as `preferred_communication_method`, contact_a.preferred_language as `preferred_language`, contact_a.preferred_mail_format as `preferred_mail_format`, contact_a.hash as `hash`, contact_a.source as `contact_source`, contact_a.first_name as `first_name`, contact_a.middle_name as `middle_name`, contact_a.last_name as `last_name`, contact_a.prefix_id as `prefix_id`, contact_a.suffix_id as `suffix_id`, contact_a.formal_title as `formal_title`, contact_a.communication_style_id as `communication_style_id`, contact_a.job_title as `job_title`, contact_a.gender_id as `gender_id`, contact_a.birth_date as `birth_date`, contact_a.is_deceased as `is_deceased`, contact_a.deceased_date as `deceased_date`, contact_a.household_name as `household_name`, IF ( contact_a.contact_type = 'Individual', NULL, contact_a.organization_name ) as organization_name, contact_a.sic_code as `sic_code`, contact_a.user_unique_id as `user_unique_id`, contact_a.employer_id as `current_employer_id`, contact_a.is_deleted as `contact_is_deleted`, contact_a.created_date as `created_date`, contact_a.modified_date as `modified_date`, contact_a.addressee_id as addressee_id, contact_a.addressee_display as addressee_display, contact_a.addressee_custom as addressee_custom, contact_a.email_greeting_id as email_greeting_id, contact_a.email_greeting_display as email_greeting_display, contact_a.email_greeting_custom as email_greeting_custom, contact_a.postal_greeting_id as postal_greeting_id, contact_a.postal_greeting_display as postal_greeting_display, contact_a.postal_greeting_custom as postal_greeting_custom, IF ( contact_a.contact_type = 'Individual', contact_a.organization_name, NULL ) as current_employer, civicrm_address.id as address_id, civicrm_location_type.id as location_type_id, civicrm_location_type.name as `location_type`, civicrm_address.street_address as `street_address`, civicrm_address.street_number as `street_number`, civicrm_address.street_number_suffix as `street_number_suffix`, civicrm_address.street_name as `street_name`, civicrm_address.street_unit as `street_unit`, civicrm_address.supplemental_address_1 as `supplemental_address_1`, civicrm_address.supplemental_address_2 as `supplemental_address_2`, civicrm_address.city as `city`, civicrm_address.postal_code_suffix as `postal_code_suffix`, civicrm_address.postal_code as `postal_code`, civicrm_address.geo_code_1 as `geo_code_1`, civicrm_address.geo_code_2 as `geo_code_2`, civicrm_address.name as `address_name`, civicrm_address.master_id as `master_id`, civicrm_address.county_id as county_id, civicrm_address.state_province_id as state_province_id, civicrm_address.country_id as country_id, civicrm_phone.id as phone_id, civicrm_phone.phone_type_id as phone_type_id, civicrm_phone.phone as `phone`, civicrm_phone.phone_ext as `phone_ext`, civicrm_email.id as email_id, civicrm_email.email as `email`, civicrm_email.on_hold as `on_hold`, civicrm_email.is_bulkmail as `is_bulkmail`, civicrm_email.signature_text as `signature_text`, civicrm_email.signature_html as `signature_html`, civicrm_im.id as im_id, civicrm_im.provider_id as `im_provider`, civicrm_im.provider_id as provider_id, civicrm_im.name as `im`, civicrm_openid.id as openid_id, civicrm_openid.openid as `openid`, civicrm_worldregion.id as worldregion_id, civicrm_worldregion.name as `world_region`, civicrm_website.id as website_id, civicrm_website.url as `url`, GROUP_CONCAT(DISTINCT(civicrm_group.title)) as groups, GROUP_CONCAT(DISTINCT(civicrm_tag.name)) as tags, GROUP_CONCAT(DISTINCT(civicrm_note.note)) as notes FROM civicrm_contact contact_a LEFT JOIN civicrm_address ON ( contact_a.id = civicrm_address.contact_id AND civicrm_address.is_primary = 1 ) LEFT JOIN civicrm_email ON (contact_a.id = civicrm_email.contact_id AND civicrm_email.is_primary = 1) LEFT JOIN civicrm_phone ON (contact_a.id = civicrm_phone.contact_id AND civicrm_phone.is_primary = 1) LEFT JOIN civicrm_im ON (contact_a.id = civicrm_im.contact_id AND civicrm_im.is_primary = 1) LEFT JOIN civicrm_openid ON ( civicrm_openid.contact_id = contact_a.id AND civicrm_openid.is_primary = 1 ) LEFT JOIN civicrm_location_type ON civicrm_address.location_type_id = civicrm_location_type.id LEFT JOIN civicrm_group_contact ON civicrm_group_contact.contact_id = contact_a.id AND civicrm_group_contact.status = 'Added' LEFT JOIN civicrm_group_contact_cache ON civicrm_group_contact_cache.contact_id = contact_a.id LEFT JOIN civicrm_group ON (civicrm_group.id = civicrm_group_contact.group_id OR civicrm_group.id = civicrm_group_contact_cache.group_id) LEFT JOIN civicrm_entity_tag ON ( civicrm_entity_tag.entity_table = 'civicrm_contact' AND civicrm_entity_tag.entity_id = contact_a.id ) LEFT JOIN civicrm_note ON ( civicrm_note.entity_table = 'civicrm_contact' AND contact_a.id = civicrm_note.entity_id ) LEFT JOIN civicrm_country ON civicrm_address.country_id = civicrm_country.id LEFT JOIN civicrm_worldregion ON civicrm_country.region_id = civicrm_worldregion.id LEFT JOIN civicrm_group_contact `civicrm_group_contact-125` ON (contact_a.id = `civicrm_group_contact-125`.contact_id AND `civicrm_group_contact-125`.status IN ('Added')) LEFT JOIN civicrm_group_contact_cache `civicrm_group_contact_cache_125` ON contact_a.id = `civicrm_group_contact_cache_125`.contact_id LEFT JOIN civicrm_tag ON civicrm_entity_tag.tag_id = civicrm_tag.id LEFT JOIN civicrm_website ON contact_a.id = civicrm_website.contact_id WHERE ( ( ( `civicrm_group_contact-125`.group_id IN ( 125 ) ) OR ( `civicrm_group_contact_cache_125`.group_id IN ("125") ) ) ) AND (contact_a.is_deleted = 0) AND contact_a.is_deleted != 1 GROUP BY contact_a.id ORDER BY sort_name asc, contact_a.id LIMIT 0, 10000 [nativecode=126 ** Incorrect key file for table '/tmp/#sql_7ae3_0.MYI'; try to repair it] [type] => DB_Error [user_info] => SELECT contact_a.id as contact_id, contact_a.contact_type as `contact_type`, contact_a.contact_sub_type as `contact_sub_type`, contact_a.sort_name as `sort_name`, contact_a.display_name as `display_name`, contact_a.do_not_email as `do_not_email`, contact_a.do_not_phone as `do_not_phone`, contact_a.do_not_mail as `do_not_mail`, contact_a.do_not_sms as `do_not_sms`, contact_a.do_not_trade as `do_not_trade`, contact_a.is_opt_out as `is_opt_out`, contact_a.legal_identifier as `legal_identifier`, contact_a.external_identifier as `external_identifier`, contact_a.nick_name as `nick_name`, contact_a.legal_name as `legal_name`, contact_a.image_URL as `image_URL`, contact_a.preferred_communication_method as `preferred_communication_method`, contact_a.preferred_language as `preferred_language`, contact_a.preferred_mail_format as `preferred_mail_format`, contact_a.hash as `hash`, contact_a.source as `contact_source`, contact_a.first_name as `first_name`, contact_a.middle_name as `middle_name`, contact_a.last_name as `last_name`, contact_a.prefix_id as `prefix_id`, contact_a.suffix_id as `suffix_id`, contact_a.formal_title as `formal_title`, contact_a.communication_style_id as `communication_style_id`, contact_a.job_title as `job_title`, contact_a.gender_id as `gender_id`, contact_a.birth_date as `birth_date`, contact_a.is_deceased as `is_deceased`, contact_a.deceased_date as `deceased_date`, contact_a.household_name as `household_name`, IF ( contact_a.contact_type = 'Individual', NULL, contact_a.organization_name ) as organization_name, contact_a.sic_code as `sic_code`, contact_a.user_unique_id as `user_unique_id`, contact_a.employer_id as `current_employer_id`, contact_a.is_deleted as `contact_is_deleted`, contact_a.created_date as `created_date`, contact_a.modified_date as `modified_date`, contact_a.addressee_id as addressee_id, contact_a.addressee_display as addressee_display, contact_a.addressee_custom as addressee_custom, contact_a.email_greeting_id as email_greeting_id, contact_a.email_greeting_display as email_greeting_display, contact_a.email_greeting_custom as email_greeting_custom, contact_a.postal_greeting_id as postal_greeting_id, contact_a.postal_greeting_display as postal_greeting_display, contact_a.postal_greeting_custom as postal_greeting_custom, IF ( contact_a.contact_type = 'Individual', contact_a.organization_name, NULL ) as current_employer, civicrm_address.id as address_id, civicrm_location_type.id as location_type_id, civicrm_location_type.name as `location_type`, civicrm_address.street_address as `street_address`, civicrm_address.street_number as `street_number`, civicrm_address.street_number_suffix as `street_number_suffix`, civicrm_address.street_name as `street_name`, civicrm_address.street_unit as `street_unit`, civicrm_address.supplemental_address_1 as `supplemental_address_1`, civicrm_address.supplemental_address_2 as `supplemental_address_2`, civicrm_address.city as `city`, civicrm_address.postal_code_suffix as `postal_code_suffix`, civicrm_address.postal_code as `postal_code`, civicrm_address.geo_code_1 as `geo_code_1`, civicrm_address.geo_code_2 as `geo_code_2`, civicrm_address.name as `address_name`, civicrm_address.master_id as `master_id`, civicrm_address.county_id as county_id, civicrm_address.state_province_id as state_province_id, civicrm_address.country_id as country_id, civicrm_phone.id as phone_id, civicrm_phone.phone_type_id as phone_type_id, civicrm_phone.phone as `phone`, civicrm_phone.phone_ext as `phone_ext`, civicrm_email.id as email_id, civicrm_email.email as `email`, civicrm_email.on_hold as `on_hold`, civicrm_email.is_bulkmail as `is_bulkmail`, civicrm_email.signature_text as `signature_text`, civicrm_email.signature_html as `signature_html`, civicrm_im.id as im_id, civicrm_im.provider_id as `im_provider`, civicrm_im.provider_id as provider_id, civicrm_im.name as `im`, civicrm_openid.id as openid_id, civicrm_openid.openid as `openid`, civicrm_worldregion.id as worldregion_id, civicrm_worldregion.name as `world_region`, civicrm_website.id as website_id, civicrm_website.url as `url`, GROUP_CONCAT(DISTINCT(civicrm_group.title)) as groups, GROUP_CONCAT(DISTINCT(civicrm_tag.name)) as tags, GROUP_CONCAT(DISTINCT(civicrm_note.note)) as notes FROM civicrm_contact contact_a LEFT JOIN civicrm_address ON ( contact_a.id = civicrm_address.contact_id AND civicrm_address.is_primary = 1 ) LEFT JOIN civicrm_email ON (contact_a.id = civicrm_email.contact_id AND civicrm_email.is_primary = 1) LEFT JOIN civicrm_phone ON (contact_a.id = civicrm_phone.contact_id AND civicrm_phone.is_primary = 1) LEFT JOIN civicrm_im ON (contact_a.id = civicrm_im.contact_id AND civicrm_im.is_primary = 1) LEFT JOIN civicrm_openid ON ( civicrm_openid.contact_id = contact_a.id AND civicrm_openid.is_primary = 1 ) LEFT JOIN civicrm_location_type ON civicrm_address.location_type_id = civicrm_location_type.id LEFT JOIN civicrm_group_contact ON civicrm_group_contact.contact_id = contact_a.id AND civicrm_group_contact.status = 'Added' LEFT JOIN civicrm_group_contact_cache ON civicrm_group_contact_cache.contact_id = contact_a.id LEFT JOIN civicrm_group ON (civicrm_group.id = civicrm_group_contact.group_id OR civicrm_group.id = civicrm_group_contact_cache.group_id) LEFT JOIN civicrm_entity_tag ON ( civicrm_entity_tag.entity_table = 'civicrm_contact' AND civicrm_entity_tag.entity_id = contact_a.id ) LEFT JOIN civicrm_note ON ( civicrm_note.entity_table = 'civicrm_contact' AND contact_a.id = civicrm_note.entity_id ) LEFT JOIN civicrm_country ON civicrm_address.country_id = civicrm_country.id LEFT JOIN civicrm_worldregion ON civicrm_country.region_id = civicrm_worldregion.id LEFT JOIN civicrm_group_contact `civicrm_group_contact-125` ON (contact_a.id = `civicrm_group_contact-125`.contact_id AND `civicrm_group_contact-125`.status IN ('Added')) LEFT JOIN civicrm_group_contact_cache `civicrm_group_contact_cache_125` ON contact_a.id = `civicrm_group_contact_cache_125`.contact_id LEFT JOIN civicrm_tag ON civicrm_entity_tag.tag_id = civicrm_tag.id LEFT JOIN civicrm_website ON contact_a.id = civicrm_website.contact_id WHERE ( ( ( `civicrm_group_contact-125`.group_id IN ( 125 ) ) OR ( `civicrm_group_contact_cache_125`.group_id IN ("125") ) ) ) AND (contact_a.is_deleted = 0) AND contact_a.is_deleted != 1 GROUP BY contact_a.id ORDER BY sort_name asc, contact_a.id LIMIT 0, 10000 [nativecode=126 ** Incorrect key file for table '/tmp/#sql_7ae3_0.MYI'; try to repair it] [to_string] => [db_error: message="DB Error: unknown error" code=-1 mode=callback callback=CRM_Core_Error::handle prefix="" info="SELECT contact_a.id as contact_id, contact_a.contact_type as `contact_type`, contact_a.contact_sub_type as `contact_sub_type`, contact_a.sort_name as `sort_name`, contact_a.display_name as `display_name`, contact_a.do_not_email as `do_not_email`, contact_a.do_not_phone as `do_not_phone`, contact_a.do_not_mail as `do_not_mail`, contact_a.do_not_sms as `do_not_sms`, contact_a.do_not_trade as `do_not_trade`, contact_a.is_opt_out as `is_opt_out`, contact_a.legal_identifier as `legal_identifier`, contact_a.external_identifier as `external_identifier`, contact_a.nick_name as `nick_name`, contact_a.legal_name as `legal_name`, contact_a.image_URL as `image_URL`, contact_a.preferred_communication_method as `preferred_communication_method`, contact_a.preferred_language as `preferred_language`, contact_a.preferred_mail_format as `preferred_mail_format`, contact_a.hash as `hash`, contact_a.source as `contact_source`, contact_a.first_name as `first_name`, contact_a.middle_name as `middle_name`, contact_a.last_name as `last_name`, contact_a.prefix_id as `prefix_id`, contact_a.suffix_id as `suffix_id`, contact_a.formal_title as `formal_title`, contact_a.communication_style_id as `communication_style_id`, contact_a.job_title as `job_title`, contact_a.gender_id as `gender_id`, contact_a.birth_date as `birth_date`, contact_a.is_deceased as `is_deceased`, contact_a.deceased_date as `deceased_date`, contact_a.household_name as `household_name`, IF ( contact_a.contact_type = 'Individual', NULL, contact_a.organization_name ) as organization_name, contact_a.sic_code as `sic_code`, contact_a.user_unique_id as `user_unique_id`, contact_a.employer_id as `current_employer_id`, contact_a.is_deleted as `contact_is_deleted`, contact_a.created_date as `created_date`, contact_a.modified_date as `modified_date`, contact_a.addressee_id as addressee_id, contact_a.addressee_display as addressee_display, contact_a.addressee_custom as addressee_custom, contact_a.email_greeting_id as email_greeting_id, contact_a.email_greeting_display as email_greeting_display, contact_a.email_greeting_custom as email_greeting_custom, contact_a.postal_greeting_id as postal_greeting_id, contact_a.postal_greeting_display as postal_greeting_display, contact_a.postal_greeting_custom as postal_greeting_custom, IF ( contact_a.contact_type = 'Individual', contact_a.organization_name, NULL ) as current_employer, civicrm_address.id as address_id, civicrm_location_type.id as location_type_id, civicrm_location_type.name as `location_type`, civicrm_address.street_address as `street_address`, civicrm_address.street_number as `street_number`, civicrm_address.street_number_suffix as `street_number_suffix`, civicrm_address.street_name as `street_name`, civicrm_address.street_unit as `street_unit`, civicrm_address.supplemental_address_1 as `supplemental_address_1`, civicrm_address.supplemental_address_2 as `supplemental_address_2`, civicrm_address.city as `city`, civicrm_address.postal_code_suffix as `postal_code_suffix`, civicrm_address.postal_code as `postal_code`, civicrm_address.geo_code_1 as `geo_code_1`, civicrm_address.geo_code_2 as `geo_code_2`, civicrm_address.name as `address_name`, civicrm_address.master_id as `master_id`, civicrm_address.county_id as county_id, civicrm_address.state_province_id as state_province_id, civicrm_address.country_id as country_id, civicrm_phone.id as phone_id, civicrm_phone.phone_type_id as phone_type_id, civicrm_phone.phone as `phone`, civicrm_phone.phone_ext as `phone_ext`, civicrm_email.id as email_id, civicrm_email.email as `email`, civicrm_email.on_hold as `on_hold`, civicrm_email.is_bulkmail as `is_bulkmail`, civicrm_email.signature_text as `signature_text`, civicrm_email.signature_html as `signature_html`, civicrm_im.id as im_id, civicrm_im.provider_id as `im_provider`, civicrm_im.provider_id as provider_id, civicrm_im.name as `im`, civicrm_openid.id as openid_id, civicrm_openid.openid as `openid`, civicrm_worldregion.id as worldregion_id, civicrm_worldregion.name as `world_region`, civicrm_website.id as website_id, civicrm_website.url as `url`, GROUP_CONCAT(DISTINCT(civicrm_group.title)) as groups, GROUP_CONCAT(DISTINCT(civicrm_tag.name)) as tags, GROUP_CONCAT(DISTINCT(civicrm_note.note)) as notes FROM civicrm_contact contact_a LEFT JOIN civicrm_address ON ( contact_a.id = civicrm_address.contact_id AND civicrm_address.is_primary = 1 ) LEFT JOIN civicrm_email ON (contact_a.id = civicrm_email.contact_id AND civicrm_email.is_primary = 1) LEFT JOIN civicrm_phone ON (contact_a.id = civicrm_phone.contact_id AND civicrm_phone.is_primary = 1) LEFT JOIN civicrm_im ON (contact_a.id = civicrm_im.contact_id AND civicrm_im.is_primary = 1) LEFT JOIN civicrm_openid ON ( civicrm_openid.contact_id = contact_a.id AND civicrm_openid.is_primary = 1 ) LEFT JOIN civicrm_location_type ON civicrm_address.location_type_id = civicrm_location_type.id LEFT JOIN civicrm_group_contact ON civicrm_group_contact.contact_id = contact_a.id AND civicrm_group_contact.status = 'Added' LEFT JOIN civicrm_group_contact_cache ON civicrm_group_contact_cache.contact_id = contact_a.id LEFT JOIN civicrm_group ON (civicrm_group.id = civicrm_group_contact.group_id OR civicrm_group.id = civicrm_group_contact_cache.group_id) LEFT JOIN civicrm_entity_tag ON ( civicrm_entity_tag.entity_table = 'civicrm_contact' AND civicrm_entity_tag.entity_id = contact_a.id ) LEFT JOIN civicrm_note ON ( civicrm_note.entity_table = 'civicrm_contact' AND contact_a.id = civicrm_note.entity_id ) LEFT JOIN civicrm_country ON civicrm_address.country_id = civicrm_country.id LEFT JOIN civicrm_worldregion ON civicrm_country.region_id = civicrm_worldregion.id LEFT JOIN civicrm_group_contact `civicrm_group_contact-125` ON (contact_a.id = `civicrm_group_contact-125`.contact_id AND `civicrm_group_contact-125`.status IN ('Added')) LEFT JOIN civicrm_group_contact_cache `civicrm_group_contact_cache_125` ON contact_a.id = `civicrm_group_contact_cache_125`.contact_id LEFT JOIN civicrm_tag ON civicrm_entity_tag.tag_id = civicrm_tag.id LEFT JOIN civicrm_website ON contact_a.id = civicrm_website.contact_id WHERE ( ( ( `civicrm_group_contact-125`.group_id IN ( 125 ) ) OR ( `civicrm_group_contact_cache_125`.group_id IN ("125") ) ) ) AND (contact_a.is_deleted = 0) AND contact_a.is_deleted != 1 GROUP BY contact_a.id ORDER BY sort_name asc, contact_a.id LIMIT 0, 10000 [nativecode=126 ** Incorrect key file for table '/tmp/#sql_7ae3_0.MYI'; try to repair it]"] )
Severity    debug

```

And this in backtrace:

```
$backTrace = #0 /home/evanstonsymph/public_html/sites/all/modules/civicrm/CRM/Core/Error.php(235): CRM_Core_Error::backtrace("backTrace", TRUE) #1 [internal function](): CRM_Core_Error::handle(Object(DB_Error)) #2 /home/evanstonsymph/public_html/sites/all/modules/civicrm/packages/PEAR.php(931): call_user_func((Array:2), Object(DB_Error)) #3 /home/evanstonsymph/public_html/sites/all/modules/civicrm/packages/DB.php(976): PEAR_Error->PEAR_Error("DB Error: unknown error", -1, 16, (Array:2), "SELECT contact_a.id as contact_id, contact_a.contact_type as `contact_type`,...") #4 /home/evanstonsymph/public_html/sites/all/modules/civicrm/packages/PEAR.php(564): DB_Error->DB_Error(-1, 16, (Array:2), "SELECT contact_a.id as contact_id, contact_a.contact_type as `contact_type`,...") #5 /home/evanstonsymph/public_html/sites/all/modules/civicrm/packages/DB/common.php(1905): PEAR->raiseError(NULL, -1, NULL, NULL, "SELECT contact_a.id as contact_id, contact_a.contact_type as `contact_type`,...", "DB_Error", TRUE) #6 /home/evanstonsymph/public_html/sites/all/modules/civicrm/packages/DB/mysql.php(895): DB_common->raiseError(-1, NULL, NULL, NULL, "126 ** Incorrect key file for table '/tmp/#sql_7ae3_0.MYI'; try to repair it") #7 /home/evanstonsymph/public_html/sites/all/modules/civicrm/packages/DB/mysql.php(328): DB_mysql->mysqlRaiseError() #8 /home/evanstonsymph/public_html/sites/all/modules/civicrm/packages/DB/common.php(1216): DB_mysql->simpleQuery("SELECT contact_a.id as contact_id, contact_a.contact_type as `contact_type`,...") #9 /home/evanstonsymph/public_html/sites/all/modules/civicrm/packages/DB/DataObject.php(2442): DB_common->query("SELECT contact_a.id as contact_id, contact_a.contact_type as `contact_type`,...") #10 /home/evanstonsymph/public_html/sites/all/modules/civicrm/packages/DB/DataObject.php(1634): DB_DataObject->_query("SELECT contact_a.id as contact_id, contact_a.contact_type as `contact_type`,...") #11 /home/evanstonsymph/public_html/sites/all/modules/civicrm/CRM/Core/DAO.php(325): DB_DataObject->query("SELECT contact_a.id as contact_id, contact_a.contact_type as `contact_type`,...") #12 /home/evanstonsymph/public_html/sites/all/modules/civicrm/CRM/Core/DAO.php(1192): CRM_Core_DAO->query("SELECT contact_a.id as contact_id, contact_a.contact_type as `contact_type`,...", TRUE) #13 /home/evanstonsymph/public_html/sites/all/modules/civicrm/CRM/Export/BAO/Export.php(673): CRM_Core_DAO::executeQuery("SELECT contact_a.id as contact_id, contact_a.contact_type as `contact_type`,...") #14 /home/evanstonsymph/public_html/sites/all/modules/civicrm/CRM/Export/Form/Select.php(434): CRM_Export_BAO_Export::exportComponents(TRUE, (Array:0), (Array:3), "sort_name asc", NULL, NULL, 1, NULL, "civicrm_task_action_temp_b18a86a4753f6c9a7d554f52e40be414_8338", 0, 1, (Array:11), 1) #15 /home/evanstonsymph/public_html/sites/all/modules/civicrm/CRM/Core/Form.php(345): CRM_Export_Form_Select->postProcess() #16 /home/evanstonsymph/public_html/sites/all/modules/civicrm/CRM/Core/StateMachine.php(164): CRM_Core_Form->mainProcess() #17 /home/evanstonsymph/public_html/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Next.php(61): CRM_Core_StateMachine->perform(Object(CRM_Export_Form_Select), "next", "Next") #18 /home/evanstonsymph/public_html/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Next->perform(Object(CRM_Export_Form_Select), "next") #19 /home/evanstonsymph/public_html/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Export_Form_Select), "next") #20 /home/evanstonsymph/public_html/sites/all/modules/civicrm/CRM/Core/Controller.php(353): HTML_QuickForm_Page->handle("next") #21 /home/evanstonsymph/public_html/sites/all/modules/civicrm/CRM/Core/Invoke.php(312): CRM_Core_Controller->run((Array:3), (Array:0)) #22 /home/evanstonsymph/public_html/sites/all/modules/civicrm/CRM/Core/Invoke.php(86): CRM_Core_Invoke::runItem((Array:13)) #23 /home/evanstonsymph/public_html/sites/all/modules/civicrm/CRM/Core/Invoke.php(54): CRM_Core_Invoke::_invoke((Array:3)) #24 /home/evanstonsymph/public_html/sites/all/modules/civicrm/drupal/civicrm.module(489): CRM_Core_Invoke::invoke((Array:3)) #25 [internal function](): civicrm_invoke("group", "search") #26 /home/evanstonsymph/public_html/includes/menu.inc(519): call_user_func_array("civicrm_invoke", (Array:2)) #27 /home/evanstonsymph/public_html/index.php(21): menu_execute_active_handler() #28 {main}
Severity    debug

```

# Answer
> 1 votes
The error you are hitting is: 126 Incorrect key file for table '/tmp/#sql\_7ae3\_0.MYI'; try to repair it

A google search suggests you don't have enough space in /tmp for it to fully create the temp table.

---
Tags: issues, export, 4.6.8
---


# Question
Title: Is "Total Paid" in a report really supposed to show Amount Paid plus fees?
I am for the first time retrieving payment data for event participants through CiviReports. One of my columns is Total Paid, but for those who registered and paid online, this column shows numbers like "$409.10", which is the amount they paid $400 plus the $9.10. The Net Amount correctly shows $390.90.

I'm thinking this is a bug, but maybe there is another field I should use?

\[edited to add:\] I'm very sure this is a bug at this point, and I'll add it to the issues board. I'm running 4.6.8 and I can replicate it on the demo site: http://dmaster.demo.civicrm.org/civicrm/report/instance/39?reset=1

# Answer
This sounds like it could be a bug. Can you please edit your question to include what version of CiviCRM you are using and what report you are running.

Are you able to duplicate this result on the master demo site?
> 2 votes

---
Tags: civireport
---


# Question
Title: How do I choose whether my payment form will run in live or test mode?
I initially thought there would be an option in the form settings itself, to choose whether to run it in test or live mode. But there doesn't seem to be such an option.

So where do I configure this? Is it a URL difference between live and test mode?

In Wordpress, when using shortcodes to embed the payment form, I saw that you can set the option in the shortcode itself, for example: `[civicrm component="contribution" id="3" mode="test" hijack="0"]`

# Answer
It's a URL difference, yes.

From **Contributions menu \> Manage Contribution Pages**, you'll see a list of each contribution page, with a number of menus ("Configure", "Contribution", "Links", "More") next to each. Select **Links \> Live Page** for the live URL, **Links \> Test-Drive** for the test page. The URLs look like:

*Live*: https://example.org/civicrm/contribute/transact?reset=1&id=1

*Test*: https://example.org/civicrm/contribute/transact?reset=1&id=1&action=preview
> 2 votes

---
Tags: forms
---


# Question
Title: What sort of fix is needed to make Drupal Search work correctly on a civicrm page such as an Event or Contribution page
Just spotted that if you have a Drupal search block on eg a Contribution page, and try to use it, it will either take you back in to CiviCRM with a qf key (back to the last thing i modified i think), and for logged out (non permissioned) users they get a long message ending with "Error type: Could not find a valid session key". How does a Drupal search trigger this outcome?

# Answer
This can be reproduced on CiviCRM.org, which has both a search block and contribute pages.

1. Go to https://civicrm.org/civicrm/contribute/transact?reset=1&id=1&action=preview
2. Type "ponies" in the Drupal search box (top right)
3. Hit `ENTER` and see fairly misleading error messages.

I haven't looked into it in depth, but I'd *guess* something like this:

1. Drupal's Block Search form uses the current page callback to submit its form to.
2. CiviCRM intercepts form submissions to `/civicrm/*`, but can't handle form submissions in unexpected formats, so doesn't know what to do.
3. Yellow Page of Malaise. (A play on WSoD here.)

My suggested dodgy workarounds are:

* Add a form alter hook in CiviCRM, which identifies forms you use throughout the site and direct the form submit URLs elsewhere if the path contains `/civicrm`, OR
* Do not show those blocks on those paths at all.

My wild clever idea solution is:

* Make CiviCRM return Fatal errors using Drupal page callback rather than bombing out to the YPoM. This might permit Drupal to then do whatever redirect happens as part of the normal flow for Drupal forms.

My fantasy perfect solution is:

* Destroy all HTML QuickForm.

This last is happening, albeit slowly. Please donate to CiviCRM, avoid implementing new functionality in QuickForm, and support any efforts to remove QuickForm or improve the codebase which you are able to.
> 3 votes

---
Tags: drupal, search
---


title: Duplication of multi records on tab

text:
# Question
Title: Duplication of multi records on tab
I can't reproduce this on the Joomla demo site running 4.6.0, and I didn't have this problem before. Now on my 4.6.6 site, if I display custom fields with multi records in a tab, the set of records displays multiple times, along with multiple "Edit multi record" buttons.

If I have one record inserted, it shows once.

If I have two records inserted, they each show twice. (As in example below.)

If I have six records inserted, they each show six times.

I don't have multiple records if I click "Edit multi record", or in "Tab with table" or "Inline" modes. Only the data display in "Tab" mode.

Is this a bug introduced sometime between 4.6.0 and 4.6.6?

# Answer
This has been fixed in 4.6.7. Please upgrade to the latest version or patch your site with this PR.
> 1 votes

---
Tags: custom-fields, multi-record
---


# Question
Title: Fatal Error on manually executing Report Sender (daily)
If I execute the Job manually I get the following error in the log and no email

> Parameters raw (from db settings): instanceId=\[573\]
>
> Parameters parsed (and passed to API method): a:2:{s:7:"version";i:3;s:10:"instanceId";s:5:"\[573\]";}
>
> Full message: Finished execution of Report sender with result: Failure, Error message: A \> fatal error was triggered: is not of type String

I've tried it with or without the optional format option, but I'm not convinced I'm entering the parameters correctly because although I can see the instructions I haven't actually seen a working version that I can examine the parameters on. Hopefully someone will point me in the right direction or tell me what else I'm doing wrong.

# Answer
> 2 votes
It's Ok I was not removing the square brackets in the example, I found a working example here - civiCRM Cron only run one mail\_report scheduled jobs?

All working now :)

---
Tags: cron-job
---


# Question
Title: Enabling extensions - directory not found
I am attempting to enable extensions on civiCRM 4.6.8 via WordPress 4.3.

When I go to administer - system settings - manage extensions I am told I need to set my Extensions Directory. I do so via my file manager at public\_html/iowafarmersunion/wp-content/plugins/files/civicrm/custom\_ext, paste this file location into Civi, but them an told that the CiviCRM extension directory does not exist.

Am I skipping a step? I was following directly on this page: http://wiki.civicrm.org/confluence/display/CRMDOC/Extensions#Extensions-WordPress

Thank you!

edit: I have made sure the directory's permissions are set to 777 for the time being and still no dice.

# Answer
You need an absolute path from the server's root (/), and I doubt that there's a directory /public\_html in your setup. More common situations are:

* /var/www/public\_html
* /srv/www/yoursite/public\_html
* /home/someuser/public\_html

or something similar.

You can tell by looking in your `civicrm.settings.php` file that's in `wp-content/plugins/civicrm` and scrolling down to the file paths. One of them will be to the `templates_c` folder, which should normally be in `wp-content/plugins/files/civicrm`. That path will be all the way to the root of your server, so you can just copy that and replace `templates_c` with `custom_ext`.

Of course, you could also look at the Temporary Files and Custom Files fields in your Directories admin page. Under normal circumstances, those should also be pointing to sibling folders of your `custom_ext` folder.

While you're at it, make sure you set the Extension Resource URL under *Administer - System Settings - Resource URLs*. You can probably use the Image Upload URL as an example, replacing `persist/contribute` with `custom_ext`.

Now, why CiviCRM doesn't just create the extensions folder and record its location when installing is totally beyond me.
> 2 votes

---
Tags: extension, configuration
---


title: Mandrill on CiviCRM - SMTP or API?

text:
# Question
Title: Mandrill on CiviCRM - SMTP or API?
Is it possible to integrate Mandrill with CiviCRM via their SMTP, or do I need to set up API via extension?

# Answer
you can send via SMTP, so without any extension.

However, you will not handle events about bounces, so civicrm will not be able to update the contact to flag that the email is invalid.

So you will keep sending emails to the same invalid email, how mandrill will handle that (eg blacklist these emails, invoicing them as sent... up to ban you) is based on how many emails you have in that case and other factors.

Bottom line, if you don't want to risk them closing your account, you should install the extension and configure it properly, it's not a risk worthwhile taking
> 6 votes

---
Tags: api, mandrill, smtp
---


# Question
Title: How to display smart group search results to unauthenticated users?
I created a smart group and want to display its result in a public page, ie **visible even to a non logged in user**. I followed the steps here: Public listings but still receiving:

```
The requested Profile (gid=17) is disabled OR
it is not configured to be used for 'Profile' listings in its Settings
OR there is no Profile with that ID
OR you do not have permission to access this profile.
Please contact the site administrator if you need assistance.

```

How can I display the results of a smart group on a public page?

I am using Civicrm 4.6.2

# Answer
> 3 votes
I will assist Xavier answer, as I don't have reputation to comment.

The user permission can be found navigating to **Administer\>User and Permissions\>Permissions\>WordPress Access Control** URL: www.yoursite.com/wp-admin/admin.php?page=CiviCRM&q=civicrm/admin/access/wp-permissions&reset=1

**CiviCRM: profile listings and forms** has to checked for anonymous user, if you have custom data in your profile, as Xavier says you will need to enable it as well.

Also make sure the profile has both "Standalone form or directory" and "Search view" checked.

And last, make sure your Smart group has "Public pages" as visibility, in the group settings.

Groups URL: www.yoursite.com/wp-admin/admin.php?page=CiviCRM&q=civicrm/group&reset=1

Hope that helps.

# Answer
> 1 votes
so does it work for authenticated users? that would exclude a bunch of potential errors.

What is your CMS? you probably need to add to anonymous users the right to see profiles, it might be disabled on your site.

Another common permission issue is to have custom fields on the profile, you'll need to add the permission to anonymous users to see custom fields

X+

---
Tags: smartgroups
---


# Question
Title: Civicase Dashboard - reordering case types
Running Wordpress 4.3 , and Civi 4.6.8.

My organisation currently has around a dozen Case types, and we will soon have more. In the CiviCase Dashboard, these are listed under "Summary of Involvement" Table. We would like to re-order the table to make it more logical for users to find the right one. The same issue applies to the Case Type Drop down when creating a new case.

My primary issue is - Can anyone suggest the best method for reordering these case-types?

Currently I cannot understand any logic to the order the they are listed - not by the order they were created, nor alphabetically, and not as i tried, by changing the 'weight' field as found in the db. (What even is this used for?)

Thanks

# Answer
The Comment from Demerit is correct. Rewriting the order of 'weight' in civicrm\_case\_type - then flushing civi and browser cache - correctly reordered the lists.
(I'm not exactly sure why this didn't seem to work the first time) Thanks
> 2 votes

---
Tags: wordpress, civicase
---


# Question
Title: CiviCase My Cases Widget not working on main Civi dashboard
Wordpress 4.3 CiviCRM 4.6.8

Having trouble with the 'My Cases' Widget, as it appears on the Main Civi dashboard. Setting up the 'My Cases' widget only ever produces the error - 'There are no open cases with activities scheduled in the next two weeks. Use Find Cases to expand your search.'

By Contrast the CiviCase Dashboard works fine, specifically the 'My Cases With Upcoming Activities' area, which lists upcoming case activities relating to the user correctly.

One thing it may be related to, is that all cases that need to be listed are custom Case types, using the standard timeline, and they only have Open case = completed on the timeline, as anything else related such as the scheduled meetings or phone calls etc do not have a set time line..

I am very carefully attempting to schedule activities in the cases well within the two weeks, but the cases do not show in the widget.

Any ideas?

# Answer
> 0 votes
As for last comment - this appears to be a simple caching error. Now working.

---
Tags: civicase, dashboard
---


title: Custom drupal contact display fields?

text:
# Question
Title: Custom drupal contact display fields?
We have a situation where staff will be filling in a Drupal webform in order to record an activity on a contact within Civi.

We are looking for a way to pull out some data from Civi into the webform by way of typing the contact into the 'Existing Contact' field. We know how to pull out the standard info about an existing contact (eg. Display Name, Address, Postcode etc.) Which gets displayed in this box on the webform.

---

But we want to be able to pull out a 'custom field' that we added to the contact in Civi which describes how much VAT that contact is paying. In Civi the field is either populated with '20%' or '0%' and we need it displayed on the form so that the staff member filling in the activity knows how much VAT that contact pays without having to go into the Civi contact to see the amount and then back out to finish the form.

So we are thinking we just need to find a way to get the custom fields to show in the following list so that we can select it for view. Is this right? It doesn't need to be editable in anyway, just a view.

# Answer
> 3 votes
We did nothing special, the custom fields showed up for contact in the webform settings? Like so (on the CiviCRM tab in the Webform):

And if you then click 'Yes' you can use the custom fields?

# Answer
> 1 votes
You can make a field view only by editing the field checking the Disabled box near the bottom of the list of options. (IMHO, not a very good name for the box)

# Answer
> 0 votes
Are you using the Drupal module Webform CiviCRM Integration? It will allow you to show the custom data as far as I know?

---
Tags: drupal, contacts, webform-civicrm
---


# Question
Title: How do I sort by Case Type Title instead of id in a Drupal View?
We frequently need to sort Drupal Views by Case Type.

It works, but sorts by id not the title field.

I believe it has to do with the pseudoconstant references in civicrm.case.inc and civicrm.core.inc.

I think that approach is fine except when it's time to sort and/or filter.

In Drupal Views, all exposed filters are sorted by id. So when a user tries to filter by Case Type they get an unordered list of Case Types that to their eyes are in a very random order and is more difficult to use.

Same thing if I sort the overall view by case type. Cases appear in non-alphabetical order and require a bit more concentration to digest them.

Is there a way to sort these fields in alphabetical order?

# Answer
The simplest solution of all. As mentioned here: Civicase Dashboard - reordering case types

I changed the weights in the table to easily change the order.

Why the heck didn't I think of that?

It would be nice to be able to change the weight within the Case Type UI.

**Update** While the weight solution worked nicely for the select lists in Views exposed filters, it would not sort the results by case type name only by id.

For example, a view listing case types came out like this:
Case Type C
Case Type E
Case Type A
Case Type D
Case Type B

The issue appears to be that the civicrm\_case\_type table is never exposed to views.

So I added this to civicrm.case.inc:

```
//----------------------------------------------------------------
  // CIVICRM Case Type Names are here, base tabling it up.
  //----------------------------------------------------------------

  $data['civicrm_case_type']['table']['group'] = t('CiviCRM Case Type Names');

  $data['civicrm_case_type']['table']['base'] = array(
    // Governs the whole mozilla
    'field' => 'id',
    'title' => t('CiviCRM Case Type Names'),
    'help' => t("View displays CiviCRM Case Type Names"),
  );

  // Explain how this table joins to others.
  $data['civicrm_case_type']['table']['join'] = array(
    // Directly links to case table.
    'civicrm_case' => array(
      'left_field' => 'case_type_id',
      'field' => 'id',
    ),
  );

  //CiviCRM Case Type - FIELDS

  //Case Type Title
  $data['civicrm_case_type']['title'] = array(
    'title' => t('Case Type Name'),
    'real field' => 'title',
    'help' => t('The Name of the Case Type'),
    'field' => array(
    'handler' => 'views_handler_field',
    'click sortable' => TRUE,
    ),
    'argument' => array(
     'handler' => 'views_handler_argument',
    ),
    'sort' => array(
    'handler' => 'views_handler_sort',
    ),
  );

```

Which joins the table and only exposes the title field to Views.

After I applied this, the same view printed out:
Case Type A
Case Type B
Case Type C
Case Type D
Case Type E
> 1 votes

# Answer
Have you tried Civicrm Entities in Drupal? It should allow you to expose anything as a drupal entity but I haven't verified this case.
> 2 votes

# Answer
I had a similar problem on a non-civi drupal site (since this is a general drupal views problem). I worked around it with this inelegant junk in my custom module:

`function mymodule_views_pre_render($view) {
 if ($view->name == 'the_name_of_the_view') {
 foreach ($view->result as $i => $r) {
 // Might not need to loop - idea is to do your own custom sorting and put result into some $new_result variable
 }
 $view->result = $new_result;
 }
}`

Note it's drupal 6. Might have to fiddle for drupal 7. You may want to use your favorite technique to examine $view-\>result to see what it looks like first.
> 1 votes

# Answer
I think this will require a patch to the CiviCRM Views code. If you can offer to do so, you could open a ticket in JIRA and supply the fix
> 1 votes

---
Tags: civicase, drupal-views
---


# Question
Title: Payment options do not display when https used only when http used
I'm using CiviCRM on Joomla. Under http Membership and Event Registration pages are displayed completely including Payment Options (pay later is enable and Standard Paypal).

Under https the Payment Options section does not display.

Any hints?

# Answer
My hunch is that CiviCRM is looking for an AJAX callback with an absolute URL. It'll go with what's in the Administer - System Settings - Resource URLs, which is in turn influenced by the base URL in civicrm.settings.php. The solution is to have the same URL, with https, be in effect across your entire site.

For a number of reasons, including potential problems with your session ending when you follow an absolute URL to http from https or vice-versa, you should have your site use a single canonical URL, with everything else redirecting to it. For example, you might decide that https://example.org is the proper URL. You should set up redirects in Apache/Nginx to have http://example.org, https://www.example.org, and http://www.example.org all send a visitor to https://example.org.

Read more at https://civicrm.stackexchange.com/a/3233/44
> 1 votes

---
Tags: joomla, payment-processor
---


# Question
Title: Why is the event registration "Thank You" page generating an error?
After our organization updated to the latest version of CiviCRM, our users started receiving the following error after registering for events on our website:

> **Sorry but we are not able to provide this at the moment.**
>
> Could not find valid value for id
>
> Return to home page.

The user is properly registered on our system and receives a confirmation email. It seems to be a problem with the thank you screen. The configuration of the thank you screen is the same as before.

Ideas?

# Answer
This seems to be similar to: CiviEvent - Error when registering: Could not find valid value for id

If you are using WordPress, then setting the base url might help. Copying my response to that issue below:

I was having a similar problem. I noticed the base url for WordPress was not set.

If you haven't set that, try setting that in Administer \> CMS Database Integration and let us know if that fixed your issue.

Make sure the event is not the home page, that seems to cause problems with the base url.
> 2 votes

# Answer
The most common cause for this is that the form and thanks pages are not being viewed on the same URL; CiviCRM's form handling depends on these not varying, but often (for example) a CiviCRM form displayed on `example.org` will redirect to `www.example.org` after submission.

Check that the server base URL is the same before and after your form submission. Check hostname, path, and protocol; the following are example URLs which are NOT the same.

```
http://example.org
https://example.org
http://www.example.org
https://www.example.org
http://www2.example.org
https://www2.example.org

```

If this is affecting your site, the best step to take is to ensure that your webserver is configured to make all URLs *canonical*.

By ensuring that the form can only be viewed at a single base URL, you can ensure that CiviCRM will not be redirecting a viewer to another base URL after its submission.
> 1 votes

---
Tags: civievent
---


title: Can I go back to CiviCRM 4.5.8?

text:
# Question
Title: Can I go back to CiviCRM 4.5.8?
We've recently installed CiviCRM 4.6.6 and we're on WordPress 4.3. I've got a major problem with CiviMail (see HERE. No one has responded in six days. Is there backwards compatibility? Would it be safe to install 4.5.8?? At this point, we're just using the Contact table. I'd rather not import all the data again, since I could only do 600 records at a time (the command line doesn't support groups or dup checking). I've got to get this fixed...someone please help me!! thanks...jim

# Answer
> 3 votes
I recommend you engage a professional to help you resolve the issue you experienced with 4.6.x, because then you'll have the bug fixed AND the security fixes which 4.5.x lacks.

# Answer
> 1 votes
The recommended method for downgrading is to restore to the backups you made before upgrading.

For contact data modified between when you upgraded and now, you'd need to either export your changes and import them to the 4.5.x system, or keep the upgraded system running and copy the data over.

I would not expect downgrading the DB directly to work, and I would expect manually reversing the DB changes between versions to be more complex than fixing your mail issue.

---
Tags: civimail
---


# Question
Title: Fatal error: Uncaught CRM_Core_Exception: [0: Transaction integrity error: Expected to find active frame
When a user tries to create a new membership from the front end we are getting this:

DB Error: already exists Return to home page.

Fatal error: Uncaught CRM\_Core\_Exception: \[0: Transaction integrity error: Expected to find active frame thrown in /home1/.../public\_html/wp-content/plugins/civicrm/civicrm/Civi/Core/Transaction/Manager.php on line 107

When I try to create the membership manually from CiviCRM Dashboard it just churns. This was working until the latest update 4.6.8. We are running Wordpress.

Renewals seem to be unaffected for administrators and for unavailable for others.

# Answer
I was able to narrow this down to the Member ID extension. Disabled that and the DB Error resolved it's self. ONE member is unable to renew at this time, but I can process manually
> 3 votes

---
Tags: wordpress, civimember, upgrade, database, error-page
---


title: smart groups showing on tab

text:
# Question
Title: smart groups showing on tab
CiviCRM 4.5.8(really any version, I think) and WP 4.2.4.

In a contact record the Groups tab will show a number. This is the number of the "Regular Groups". Is it possible to also show/combine the Smart Groups number on the Groups tab as well?

# Answer
> 2 votes
Gary,

the quick answer is no ....the way CiviCRM stores the groups for a contacts is different than the way CiviCRM determines which smart groups a contact is in. There is one group table that references which contact is in which group. This table does not contain smart group references.

See the CiviCRM group architecture here

---
Tags: groups, smartgroups
---


# Question
Title: What should be synced to an accounting package from civicrm?
My church uses Aplos Accounting. It's a web-based accounting package aimed at non-profits (www.aplos.com). They have recently implemented an api (www.aplos.com/api). I am interested in doing some syncing from Civi to Aplos to automate some things.

Our thoughts were to have an extension that implemented a scheduled job that would run daily and create a Civi accounting batch for the previous day. That batch would include all financial transactions that civiCRM processed that would be deposited into the bank account.

That total would then be posted to Aplos as a Deposit transaction with the Civi Accounting batch ID located in the comments of the transaction. That way if there was ever any question we could cross reference between the two.

Also, if a refund is processed through Civi then that would be posted as a Debit to Aplos with the Payee just being REFUND and in the comments it would notate the details.

What are you thoughts on this and do you have suggestions?

# Answer
> 3 votes
Tommy,

I think an extension is a good idea, but a quick glance at the aplos API and it looks like aplos wants each transaction mapped to an aplos contact id. This seems like a lot of work that is not necessary. My advice is to see if you can upload a batch at a time through CiviCRM export (maybe a custom search or report) and see how that works first. the effort level will be a lot less.

I don't know aplos, but many of the small accounting packages assume that they are the transaction system of record and need the contact id passed with each transaction - this appears to the case with aplos. What you are asking is for a batch transfer with CiviCRM as the sub ledger and using Aplos as the general ledger. This works fine with larger systems like Dynamics. I don't see any aplos documentation on JE imports and my guess is that they have not implemented it yet.

it would be a great extension and many we get aplos to fund it (seems like a biz dev opportunity for Josh of the core team)

# Answer
> 0 votes
Makes sense. Not sure if the total as a deposit transaction to Aplos is good enough, especially aif you want to register refunds. It might be worth posting each transaction in Aplos?

# Answer
> 0 votes
I suggest you look at the existing options for accounting package integration, including Eileen's **CiviXero extension** (github, description).

This will give you a concrete example of how accounting integration can be done, and possibly even a leg up implementing your own - yay open source!

Don't forget to contribute your end results back to the community :)

Another document worth reviewing is this wiki page on Finance and Accounting.

---
Tags: civicontribute, api, accounting
---


# Question
Title: Existing organizations getting updated when new person signs up with the same org name
We have a civi membership contribution form that is on behalf of an organization. Right now, when new members sign up, if their organization has the same name as an existing organization, civi renews and updates the existing organization instead of creating a new organization. And the new member also gets added to the existing organization.

The dedupe rules for contacts don’t seem to have an effect on organizations for "on behalf of" contribution forms.

What is the best way to make sure a new organization is created and a new membership is created every time a user signs up?

# Answer
> 2 votes
I am wondering if you really want the membership form to be "on behalf of" an organization.

That feature is designed to be used when the organization is to be the member, (eg for a trade association) but, because organizations can't fill in forms, a person has to sign up "on behalf of" the organization. The organization can only have one membership, so when someone else comes along to sign up 'on behalf of' the organization they are effectively renewing that membership and will be added to that organization.

It sounds like you want the individual to have the membership, but you want to know that they belong to a particular organization. If that is the case then your memberships should be for individuals, you should not let contacts sign up "on behalf of organizations" and you should include the "employee of" field in the profile on your membership form so that you have a relationship created between the organization record and the individual's record.

# Answer
> 1 votes
And when the "employee of"/"employer of" relationship isn't the correct one, you can create new relationship types such as "player for"/"has player" (teams), "spokesperson for"/"spokesperson is", etc.

# Answer
> 0 votes
This may not be a popular answer, but I am not big fan of allowing membership renewal without authenticating. I think there are too many potential issues like the one you are running into.

You can also try sending a checksum email to the primary organization contact with a link to renew. I know of several organizations using this technique.

A couple references:

-- CiviCRM documentation

-- an example

---
Tags: contributions
---


# Question
Title: Smarty Error when setting Organization Name in civicrm-4.6.8-wordpress?
I just setup civicrm 4.6.8 on Wordpress 4.3 "Billie". I setup my database, and username for Civi to access, and now I'm on the CiviCRM Home screen where it is asking for my `Organization Name`, `Email Address`, and `Default CiviMail Mailbox`.

When I click `Go` next to `Organization Name` I am presented with the following error:

```
Organization Address and Contact Info

Warning: Smarty error: unable to read resource: "CRM/common/stateCountry.tpl" in /srv/www/wordpress-default/wp-content/plugins/civicrm/civicrm/packages/Smarty/Smarty.class.php on line 1094

Warning: Smarty error: unable to read resource: "CRM/common/stateCountry.tpl" in /srv/www/wordpress-default/wp-content/plugins/civicrm/civicrm/packages/Smarty/Smarty.class.php on line 1094

Fatal error: Smarty error: [in CRM/common/formButtons.tpl line 38]: [plugin] modifier 'crmBtnValidate' is not implemented (core.load_plugins.php, line 118) in /srv/www/wordpress-default/wp-content/plugins/civicrm/civicrm/packages/Smarty/Smarty.class.php on line 1094

```

Looking in my `<wordpress>/wp-content/plugins/civicrm` folder does not reveal a packages directory, so I'm uncertain what includes are being requested here.

# Answer
It looks like some files might be missing in your install. How did you install civicrm plugin?

Packages folder is at /srv/www/wordpress-default/wp-content/plugins/civicrm/civicrm/

Can you check if /srv/www/wordpress-default/wp-content/plugins/civicrm/civicrm/templates/CRM/common/stateCountry.tpl file exists?
> 1 votes

---
Tags: wordpress, installation, 4.6.8
---


# Question
Title: How to browse available payment extensions?
The extensions directory lists various extensions, but I don't see a way to filter by purpose. I'm looking for payment extension options.

https://civicrm.org/extensions/index lists 208 extensions, but gives no indication or easy way to filter by purpose.

https://civicrm.org/extensions and some of the other URLs show no extensions at all, even if I hit submit on a blank form or put a single vowel into the "name" field (which I'd expect to see *some* results for). (This might just be a bug so isn't really part of my question!)

This seems like an obvious feature for a directory - what am I missing?

# Answer
> 1 votes
When it comes to selecting a suiting payment processors I would recommend having a look at this page.

Also, make sure to read any documentation you can find on those payment processors intersting to you, such as:

* Developers Website
* Extension's Githup Page
* CiviCRM Wiki
* ...

Make sure it is compatible with your version of CiviCRM and does not have major bugs that prevent you from using it.

---
Tags: extension, payment-processor
---


# Question
Title: How do I get correct currency data to stripe.com from my CiviCRM transactions
Background: Wordpress site, CiviCRM 4.6.x, Stripe extension version 1.9.1 is reported, and the directory in my extensions folder is called com.drastikbydesign.stripe-4.6-dev (installed in June/July).

Civi is configured with GBP as the default currency, and GBP, USD and EUR are all set as available currencies. We have - at present - three contribution pages, one for each of the three currencies, and the currency is set in the configuration for each page.

CiviCRM is recording the transaction in the correct currency (USD). Stripe is recording the transaction, but is recording it in GBP. This is causing a major issue as you might expect. For example, we have a user who has donated USD20. CiviCRM tells us they have donated USD20, but Stripe has read this as GBP20, and taken USD31.64 from the user's credit card. Not good.

Looking at the events and logs data in the Stripe dashboard I can see that 'gbp' is being given everywhere as the currency.

I don't know if this is a bug in this extension or more generally in CiviCRM, but my guess - and it is a guess - is that the currency data is being taken from the default currency rather than from the currency that is set for the specific contribution page.

Here's a link to the issue in the extension repo: https://github.com/drastik/com.drastikbydesign.stripe/issues/91

# Answer
> 2 votes
It transpired that the error was due to the fact that the affected transactions were recurring payments, and the stripe extension did not pass currency data to stripe.com. So, in my use case, a user has submitted a recurring payment in GBP, and a subsequent user has attempted to submit the same payment in terms of amount and frequency, but in USD. As the currency was not being included in the payment plan data being submitted, stripe.com assumes that the plan is in GBP, because that is how the plan was originally defined, and so takes the payment in GBP.

Having liaised with the extension developer, this issue has since been addressed and I'm aiming to test the changes as soon as possible to see if it has resolved the issue.

---
Tags: civicontribute, contributions, payment-processor, contribution-page, currency
---


# Question
Title: What's the best way to take a 'snapshot' of membership counts at a point in time?
I want to create a graph of current membership counts at various intervals - weekly, biweekly, monthly, annual. What's the best way to do this?

# Answer
This is a tricky one - see these questions for a variety of approaches:

Is it possible to get point-in-time membership data?

How can I see the number of memberships at a given date in the past?

Membership Status Report
> 4 votes

---
Tags: civimember, civisualize
---


# Question
Title: Twilio extension installation problem - php query (I think!)
I have installed the twilio extension (extensions, github) on a new civicrm site.

I was unable to install using the in civicrm method so uploaded via FTP and then refreshed the installed extension page. Pressed install and got the following error message.

> Warning: Invalid argument supplied for foreach() in \_twilio\_civix\_civicrm\_xmlMenu() (line 34 of /var/www/vhosts/XXXX.net/httpdocs/sites/default/files/civicrm/custom\_ext/org.civicrm.sms.twilio-master/twilio.civix.php).
>
> Warning: Invalid argument supplied for foreach() in \_twilio\_civix\_find\_files() (line 118 of /var/www/vhosts/XXXXX.net/httpdocs/sites/default/files/civicrm/custom\_ext/org.civicrm.sms.twilio-master/twilio.civix.php).

I have gone and looked the twilio.civix.php file

The first instance:

```
function _twilio_civix_civicrm_xmlMenu(&$files) {
  foreach (glob(__DIR__ . '/xml/Menu/*.xml') as $file) {  // this is line 34
    $files[] = $file;
  }
}

```

And the second instance:

```
function _twilio_civix_find_files($dir, $pattern) {
  $todos = array($dir);
  $result = array();
  while (!empty($todos)) {
    $subdir = array_shift($todos);
    foreach (glob("$subdir/$pattern") as $match) { // this is line 118
      if (!is_dir($match)) {
        $result[] = $match;
      }
    }
    if ($dh = opendir($subdir)) {
      while (FALSE !== ($entry = readdir($dh))) {
        $path = $subdir . DIRECTORY_SEPARATOR . $entry;
        if ($entry == '.' || $entry == '..') {
        } elseif (is_dir($path)) {
          $todos[] = $path;
        }
      }
      closedir($dh);
    }
  }
  return $result;
}

```

But I literally have no clue what is wrong as I am not that familiar with PHP. I have tried to install both the new version of twilio and the previous version but the error message is the same. I have successfully used the twilio extension on another site.

Any thoughts about where to go with this woudl be gratefully received!

Thanks Caroline

Site is drupal 7/CiviCRM 4.6.8.

# Answer
> 2 votes
These two are *warnings*, not fatal errors. It's possible that they are harmless, and likely that they indicate that the extension is not yet configured.

Both report that the `glob()` for files returned something other than an array - which suggests that glob returned `FALSE`, meaning either the path searched didn't exist or the web user's permissions didn't allow CiviCRM to scan for files there.

First off, I'd make sure the extension is configured properly. If that didn't solve the issue, I'd add some debug code to see what the return value of `glob()` is before treating it as an array, and if the return value *isn't* an array to produce a helpful error message.

If that sounds too complex, you could open an issue on the Github project for Twilio, and refer the authors to this extension.

---
Tags: civisms
---


title: Member dues report

text:
# Question
Title: Member dues report
CiviCRM 4.6.8 and WP4.3 I have Memberships setup with a main membership and chapter memberships. When a person buys a Main Membership and Chapter Membership with one payment I can not report on the Chapter Member only. It gives me the amount for the full payment. When I look at the detail I can see the items for the payment. How can I report on just the Chapter payment? I can get just the Chapters but it shows the full payment. Again, I need just the Chapter amount.

# Answer
> 3 votes
If you are using price set then you might find this blog and the extended reports extension useful

---
Tags: civicontribute, civimember
---


# Question
Title: How do I partially hide Ajax supplied content?
I tried hiding the edit, delete, enable and disable links in contact relationships writing an extension in the hook \_civicrm\_alterContent and injecting jquery:

```
  $content= $content . "
    <script type='text/javascript'>
      CRM.$(document).ready(
        function($) {
          $( '.crm-contact-relationship-links span a:nth-child(2)' ).remove();
          $( '.crm-contact-relationship-links span:nth-child(2)' ).remove();
        }
      );
    </script>
  ";

```

The data I want to hide is supplied through Ajax and apparently out of Jquery's reach because I don't see the desired effect.

Then I tried it using the dataTable API:

```
        <script type='text/javascript'>

      CRM.$(document).ready(
        function($) {
          var table = $('table.crm-contact-relationship-selector-current').DataTable();
          table.$( '.crm-contact-relationship-links span a:nth-child(2)' ).remove();
          table.$( '.crm-contact-relationship-links span:nth-child(2)' ).remove();
        }
      );
    </script>

```

Without success!

Any suggestion to still reach my goal?

# Answer
> 2 votes
Please see the Civi JavaScript reference , specially this:

```
CRM.$(function($) {

// Your code here

 });

```

> Remember that CRM.$ is our alias of jQuery. So the first line is shorthand notation for CRM.$('document').ready(function($) { The function receives jQuery as it's param, so now we have access to jQuery as the familiar $ for use in our code.

Also make sure you are targeting the right template: CRM/Contact/Page/View/RelationshipSelector.tpl

A different approach would be to create a custom template as explained here and disable the actions links based on $context

**Update**: according to dataTable API, you could do this:

```
CRM.$(function($) {
    var table = $('table.crm-contact-relationship-selector-current').DataTable();
    var column = table.column('.crm-contact-relationship-links');
    column.visible( false );
});

```

---
Tags: ajax
---


# Question
Title: How can I put Civi data in a data warehouse that supports OLAP cubes?
Jon G wrote this as part of an Answer to a Question about point-in-time/snapshot queries for membership data - "consider putting Civi data in a data warehouse that supports OLAP cubes. Parvez Saleh at Veda has implemented this and can probably speak to best practices." What is the best way to do this?

# Answer
> 1 votes
What do you mean? If you want to just do some reporting you could use any toolset like Pentaho, ClickView, Business Objects, Tableau or Periscope that you can attach to the CiviCRM database. Data warehousing sort of assumes you want to do your reporting on a frozen copy of the database, which you can easily do by dumping the CiviCRM database regularly. If you use a toolset that works with OLAP cubes you will have to define those cubes in your toolset. Something like ClickView does not need that. It does however require that you know your way around the CiviCRM database.

---
Tags: civimember
---


# Question
Title: Cancelling 1 Participant when Registered Multiple Participants
So, I have what seems like a simple problem with no clear solution.

One of my users registered 4 contacts for an event (3 others and himself) and selected "pay later". When he went to pay hsi balance, he asked our administrative assistant to cancel one of the participants he registered, as they were no longer able to attend.

The registration was cancelled, but the amount due remains the same. The guy's paid for 3 of the 4 participants, which makes us even in our book, but he remains outstanding by $375 according to Civi.

What's the best course of action here? I want the total fee to reflect that he registered 3 participants, for $375 a piece.

# Answer
Just cancel their whole Event Registration and register it again for 3 participant - by this way you can match with amount paid in -

Please take an Back of the DB before trying out anything or create a test system for testing the issue - if this didn't work please let me know
> 1 votes

---
Tags: civievent, registration
---


# Question
Title: Is there a way to disable the wysiwyg editor when editing mail templates?
I'm trying to add the "shortlink" html schema so my users on gmail can have the direct link to RSVP to the event or confirm their signature for the petition

Unfortunately, the editor on civicrm fubar the html to the point gmail can't recognise it anymore

Is this possible to disable the editor only when editing the mail template? So my users still have the wysiwyg editor when composing their mail, just the admins being able to write nice html templates without having the html editor messing up

# Answer
> 2 votes
Editor can be disabled completely by the following

Administer \> Customize Data and Screens \> Display Preferences. CKEditor can be changed to TextArea

http://book.civicrm.org/user/current/initial-set-up/customizing-the-user-interface/

---

**For specify Action**

Editor can be disabled before editing the template using SQL

civicrm\_setting table holds the CKEditor setting

Id: - 11

Group name: - CiviCRM Preferences

Name: - editor\_id

Value: - s:1:"2";

If the value is made null then it changes to Text Area and later it can be changed back to CKEditor

But, any member accessing the Editor at the every moment like in contact summary screen for creating PDF at the same time cannot view Editor till this is been changed -

---
Tags: email, wysiwyg
---


title: How to modify unsupervised dedupe rule

text:
# Question
Title: How to modify unsupervised dedupe rule
In some of my CiviCRM database, i have contacts who share the same email. I don't want people to modify the wrong contact when filling a public anonymous form.

To avoid that, I'd like the unsupervised dedupe rule for individual to be Email + First Name.

When i go to the UI (`/civicrm/contact/deduperules?reset=1&action=browse`) i see it's not possible to change the default rule. Is there any problem to expect if i disable the default rule in the database by setting `is_active = 0` and create a new unsupervised rule ?

**EDIT**

I see there is no `is_active` field so i guess i will have to either delete, either changed it to a `General` type of rule.

The question is the same - is there any problem to expect ?

# Answer
On our site we simply created a new rule, and chose the 'Unsupervised' option when creating it.

That creates the rule, and marks it as the default 'Unsupervised' one. The old default is downgraded to a 'General' rule. If it was a built-in rule then it stays 'reserved' so you can't edit it.

I don't think there's any need to delete them, or fiddle in the database =\]
> 6 votes

---
Tags: duplicate-contacts
---


title: Can I use Smart Groups to dedupe?

text:
# Question
Title: Can I use Smart Groups to dedupe?
I am helping someone who is trying to segment their contacts into smaller chunks as they go through to dedupe, so they have created a smart group to try to filter the dedupe rule on. (e.g. a subsection of contacts based on state, or a custom field).

When they prepare to dedupe, they have an option to select a group:

However, they are experiencing some strangeness in the results, including people showing up in the potential duplicates list that aren't in the smart group at all.

This brings up two questions:

1. Does deduping work with Smart Groups? (This post suggests it should have been fixed way back in Civi 2.1, but this documentation says it doesn't work)
2. Does deduping on a group compare only the people in the group to each other, or does it compare the people in the group to anyone else in the database (whether they are in the group or not)?

# Answer
> 2 votes
Our understanding is:

1. Yes it does work =\]
2. Using this feature compares everyone in the smart group with everyone in the database (whether they are in the group or not). But this still dramatically reduces the number of comparisons.

---
Tags: smartgroups, duplicate-contacts
---


# Question
Title: Transferring contacts from one CiviCRM installation to another
I have two different Civi installation on different servers. I want to move all contacts from one CRM to another one(to a new group). Total contacts are more than 15k. I have facing some error if I export more than 1000 contacts and the same thing on Import also If I tried to upload more than 1000 contacts getting 500 server error.

Please let know if there is any software available for transferring contacts.

\_Ashwin

# Answer
> 3 votes
Please increase your max\_execution\_time

if you are using Xamp look for following file and change

xampp\phpMyAdmin\libraries for config.default.php

change $cfg\['ExecTimeLimit'\] = 300; to 0 - for unlimited

this should fix the issue

# Answer
> 2 votes
The errors you're experiencing are related to your hosting environment rather than CiviCRM, so it's difficult to make suggestions without knowing more about your hosting environment. However, I would recommend the following:

* The best solution is to set up a development server under your own control - perhaps on your local computer.
* Increasing the max execution time as Ramesh suggests.
* Use the command line export tools, if you're comfortable with SSH. See here: https://civicrm.org/blogs/xavier/api\_batch\_tools
* There's a class of tools called "ETL" that are designed for this exact purpose. I often use Kettle, a free ETL tool, to do what you're describing (usually migrating from other software into CiviCRM). However, ETL tools have a steep learning curve - for what you want, you're best off using the command line tool and/or a development server.

# Answer
> 1 votes
Generally, I have not seen issues with exports of contacts.

However, CiviCRM generally has issues with large imports.

My usual recommendation is to write a php script that reads through the import file record by record and inserts them using the CiviCRM API.

Theoretically, you could set things up to use the API to read the old CiviCRM to get a record, and then the API to insert in the new one. (Kinda interesting application that.)

---
Tags: contacts
---


# Question
Title: ACL permissions still broken after 4.6.8 upgrade
I was running 4.6.6 and noticed I was unable to access some of the settings for an event. I then noticed I didn't have permission to get to other areas of CiviCRM, this in spite of having full admin access.

I saw the bulletin regarding 4.6.6 breaking ACL permissions, so I just upgraded to 4.6.8, but the permissions are still broken - I can't get into any of the administrative functions of CiviCRM at all, and I'm kind of freaking out. As usual, this couldn't have happened at a worse possible time - we have our National Convention in less than 30 days and I desperately need to make changes to my event settings and price sets.

We're running Drupal 7.3.8 and Civi 4.6.8. We have 50 states set up with content access control controlled by smart groups based on state. Any help anyone can provide is greatly appreciated!

# Answer
The ACL bugs fixed in the most recent point releases wouldn't affect a full administrator. I believe it's unrelated to your current problem.

Your symptoms sound like you're logging in over HTTP, but with HTTPS forced to on. Try logging in over HTTPS and see if your problem goes away.
> 1 votes

# Answer
if you think you've come across a bug then check the issue tracker here: https://issues.civicrm.org/jira/issues/?jql=text%20~%20acl%20ORDER%20BY%20updated%20DESC

If it's not already in there then feel free to report the issue, with steps on how to recreate the problem. Ie: Exactly what ACLs are you using, how are your users/permissions set up, how someone can you recreate the issues in a fresh installation of CiviCRM.

But if you think you've identified a security issue then you can follow the guidance here: https://civicrm.org/security
> 0 votes

---
Tags: acl, 4.6.6
---


# Question
Title: Upgraded CiviCRM 4.4.6 to 4.5.4; Case is adding but its not showing?
Upgraded civicrm 4.4.6 to 4.5.4. Case is adding but its not showing? I am using drupal-7.22.

# Answer
Check your permissions, they may have changed and you'll need to give the relevant role the permissions. You should also clarify which CMS your using to make it easier to support you!
> 1 votes

# Answer
Not sure what your logic is for upgrading to 4.5.4 but there have been changes with the way Case works and in some cases that requires the renaming of Case Type 'names' and the XML files but i would have expected you would have had some warnings post upgrade
> 0 votes

---
Tags: civicase
---


# Question
Title: How to create a multiple-record custom field set for a Membership?
Short version: Using the standard New Custom Field Set form, it is currently not possible to create a multiple-record field set for memberships. Is there some other way to achieve this?

Long version: I work for a membership-based society comprised of, among other things, a number of choral music organizations. As part of their being members, we would like them to tell us the names of the choirs that are part of their organization, and the number of singers in each choir. Given that a single organization can run multiple choirs, a multiple-record field set would be perfect for this information...if only I could create one. Using CiviCRM's built-in facilities, the only options I can see available to me are:

a) creating a finite series of separate fields for the membership type based on some reasonably safe assumptions about the maximum number of choirs a single organization is likely to have, or

b) creating a new contact type specific to these members, creating a multiple-record field set to associate with it, and then forcing someone in the office to update the information manually.

At present I'm leaning toward the first option, but I'd love to hear if anyone has any other ideas, especially ones that would allow me to use the correct (for the situation) field set type associated with the membership scope.

Thanks!

# Answer
We ended up going with option c): create each choir as its own contact, then create custom relationships between the choirs and the organization they're a part of. This in addition to making the choirs themselves easily searchable, this also allows us to create separate relationships between conductors and their individual choirs (since each choir in an organization might have a different conductor).
> 1 votes

# Answer
I'm a fan of your 'B' option, and here's why. If we tie the information to a membership, won't they have to retype everything each time they renew? Could that leave things in a weird place with reporting or search when an org has a long membership history with different information in each membership?

Maybe down the road you're trying to set up some contract events with a school system. You want to find members who manage choirs with at least 20 singers. But with this info tied to the membership, you could get false positives with choirs who have shrunk, or false negatives with choirs who have grown. I don't have the full context of what your goal is by knowing these details, so this is just something to consider.
> 0 votes

---
Tags: civimember, custom-fields
---


# Question
Title: Error "Select at least one membership option" when adding a membership with a price set
I'm new to CiviCRM. my version is 4.6.8

The problem happen when I try to add a New Membership. I have the following: Membership Organization and Type "Organizzation-NAME" - "select" OR "chose price set"

Select Membership Organization and then Membership Type. Alternatively, you can use a price set.

Well When I did not select a Membership type but I chose the price set and add one or more types I can't save because I receive the following message:

Please correct the following errors in the form fields below: Select at least one membership option.

Please help Thanks

# Answer
> 1 votes
While creating the price set option value you need to select the corresponding membership

If this is not selected then you cannot create an membership using price set

---
Tags: civimember
---


# Question
Title: How would one go about creating a workflow for activities?
I'm thinking something like the following:

1. Employee enters an activity entitled Check Request and submits it.
2. It is automatically submitted to his/her supervisor(based on preconfigured rule).
3. Supervisor either approves request whereby it automatically goes to appropriate person to cut the check. If denied then it is assigned back to the employee.

I can deal with it not doing the assigning automatically but it does need some way to show that each level signed off on/approved the request. Just having each person put a comment in the Description section of the activity is not enough because it could easily be "cheated" by the employee just putting in comments. What's the best suggestion on having some sort of "approval history" for an activity?

Just a note: CiviCase is wayyy overkill for this.

# Answer
Assuming you have server permissions to implement this, I think a binary log is the best approach. Turn on binary logging at **Administer menu \> System Settings \> Misc** by setting "Logging" to "Yes".

At this point, you'll have a complete history of who made what changes in a SQL table called`log_civicrm_activity`. To add a "visible change log" to the activity is a little trickier - you can probably write a custom report pretty easily, but to add the data directly to the activity page, you'd need to create a small extension that injected the data onto the activity.
> 1 votes

---
Tags: activities, permissions, workflow
---


# Question
Title: Is CiviCRM compatible with Postgres and Wordpress?
Is there a version of CiviCRM that's compatible with Postgres and Wordpress?

# Answer
**No.**

CiviCRM uses MySQL functions extensively, so it can't be run with PostgreSQL.

This has been raised before over on forum.civicrm.org (at least in 2010 and 2007). Tim Otten's answer in this forum post may also help understand some of the workings currently in the DB layer (and specific to MySQL).

It could (in theory) be done, but it would take significant effort and leadership from the community who wanted to make it happen.
> 3 votes

---
Tags: wordpress, database, evaluating-civicrm, compatiblity
---


# Question
Title: Cron Invalid username and/or password, After 4.2.9 to 4.2.20 Joomla Upgrade
Very grateful if anyone can tell me where to start debugging this issue.

I had cron working fine in 4.2.9

I've cleared all, caches, templates, sessions, logged in and out as the cron user who is Super Admin. Key was also restored from backup settings files.

# Answer
> 1 votes
This is all due to Joomla changing its password authentication methods on 2.5.18 and above, to fix (not the nicest fix but it works) you need to edit the following.

administrator/components/com\_civicrm/civicrm/CRM/Utils/System/Joomla.php

CHANGE TO THIS AROUND LINE 445

```
  // now check password
  if (strpos($dbPassword, ':') === FALSE) {
    if ($dbPassword != md5($password)) {
      if (!JUserHelper::verifyPassword($password, $dbPassword, $dbId)) {
        return FALSE;
      }
    }
  }
  else {
    list($hash, $salt) = explode(':', $dbPassword);
    $cryptpass = md5($password . $salt);
    if ($hash != $cryptpass) {
      if (!JUserHelper::verifyPassword($password, $dbPassword, $dbId)) {
        return FALSE;
      }
    }
  }

```

---
Tags: cron-job
---


title: Importing data with households

text:
# Question
Title: Importing data with households
I've been attempting a data import for households and contacts on a new civi install, and cannot for the life of me figure out how to import the data and keep civi from creating duplicate records of contacts and/or households along the way.

I've followed the instructions provided here: http://wiki.civicrm.org/confluence/display/CRMDOC/Importing+Households+and+Household+Members

And about any number of combinations of data uploads, but am having no luck.

Does anyone have tips or instructions they like to follow for importing of contacts initially, when contacts need to be associated with households?

Thank you!

# Answer
Your dedupe rules aren't probably tight enough so instead of seeing that the contact exists already, it creates a new one.

The fact that your getting dups also probably says you are doing multiple imports with the same CVS. When I do imports I often do run the same file more than once, but the key difference is if the contact already exists and you are say adding them to a household, you should check the update box on the import instead of the default.

So having said all that, if I'm importing new hh and individuals and trying to create the relationships, I will import the hh and ind and give them an external id. The external id can be anything, number, letters, a combination. Then I use that external id as the link for creating the relationships, importing contributions, etc. The external id has to be unique unlike names and email so it won't create new contacts when it doesn't match like it does with just names.
> 2 votes

---
Tags: contacts, import, duplicate-contacts, households
---


# Question
Title: Do sites without SSL now need one for PayPal IPN?
PayPal is upgrading their certificate and require that people's certificates are also upgraded. Copying the notice below.

But IPN can currently be used without a certificate. Does anyone know if that will not be allowed in future? Or if the older certificates will not work but non-ssl connections will continue to work?

I know it's advisable to have SSL... But some sites want to avoid having SSL and that's why they use PayPal, to avoid asking for credit card information on their site.

PayPal email:

> As we have previously communicated to you, PayPal is upgrading the certificate for www.paypal.com to SHA-256. This endpoint is also used by merchants using the Instant Payment Notification (IPN) product.
>
> This upgrade is scheduled for 9/30/2015; however, we may need to change this date on short notice to you to align to the industry security standard.
>
> You’re receiving this notification because you’ve been identified as a merchant who has used IPN endpoints within the past year. If you have not made the necessary changes, we urge you to do so right away to avoid a disruption of your service!

https://www.paypal-community.com/t5/About-Business/PayPal-Endpoint-certificate-upgrade-SHA-256-encryption/m-p/997455#U997455

> Merchants using PayPal Instant Payment Notifications (IPN) may be impacted by the change if their web server is not enabled for SHA-256 compliance. If you are using a 3rd party solution for order management and for integrating PayPal on your website, you may be using IPN. Please check with your shopping cart provider to see if you are affected.

and

> If you are a merchant who uses IPN with PayPal, your server will need to be upgraded to support SHA-256. Please contact your web host or the checkout partner providing the integration solution to ensure SHA-256 is enabled for the server.

# Answer
**No, PayPal state that SSL will not required for IPN.** I contacted PayPal MTS to confirm and got the responses below:

---

PayPal seem to be saying

* **if you have SSL yourself**, your certificate and its chain need SHA-256 not SHA-1 both for PayPal and modern browser support,
* **when you connect to their server**, your webserver must accommodate *their* SHA-256 certificate. Most hosting environments will be fine, but older envs lacking SHA-256 support in SSL libs won't.

PayPals docs are a bit unclear (hence your question!), but they seem to be stating *certificates must be SHA-256* rather than *all sites require a certificate*. In particular the graphic at top of 2015-2016 SSL Cert Change Microsite) can confuse since it says "must be running a SHA-256 compliant server".

My assessment, based on the following (later confirmed via PayPal MTS), is that non-SSL IPN will still be supported. Rationale:

* Requiring SSL for all sites would be a **big business change**; it would kill IPN on a lot of small orgs who don't have the $$ for SSL hosting.
* PayPal's **IPN simulator does not validate the protocol** for SSL. If this was a requirement, they would implement it in their simulator.
* PayPal's **IPN simulator works using plain HTTP**, fails when using SSL to a SHA-1 cert site, and works when using SSL to a SHA-256 cert site.
* PayPal's docs **refer to "SHA-256 compliance"** and seem to say "require SHA-256 compliant cert" rather than "require a cert".

I've submitted a support question & asked PayPal on Twitter (, ). Will update if we get a canonical YES or NO - we have multiple clients asking the same.

Update: Initial responses (reply from MTS, Twitter) are that HTTP IPN will be a supported use case after SHA256 rollout.

Update 2: PayPal Merchant Technical Services have replied that *IPN over plain HTTP can be supported once 2015-2016 SSL migration completes.* Answer updated.

Update 3: Adding confirmation from @PayPal\_Frank in a paypal-community.com forum question

---

All that said - I recommend that ALL organisations using CiviCRM should SSL their traffic for contact privacy. Read Joe Murray's post on the CiviCRM blog and consider your contact's privacy - SSL is inexpensive and helps build trust; it'll probably pay off for your org.
> 7 votes

# Answer
You probably need to pose this question directly to PayPal. It's really a matter of whether they will require a secure connection going forward. It could be that they will force it.

It also may depend upon your host. One client of mine is hosted on HostGator and they too do not have an SSL cert, however in its absence the HostGator SSL cert takes over (and it has SHA-256 encryption). The best way to check this is to go to your site using HTTPS and see if a cert is presented, and if so, you can see whose cert it is and if it has the proper encryption.

As you said it is advisable to have an SSL, and these days, it really is a no-brainer that you should have one. The price for a basic cert is dirt cheap; I usually can get one for $30/yr. Highly recommended.
> 1 votes

---
Tags: payment-processor, paypal
---


title: Joomla Report Result - Blank Screen

text:
# Question
Title: Joomla Report Result - Blank Screen
I've created multiple custom reports. On several of them, the results are a blank, white screen; no results and no errors. Any idea what might be causing this? I checked my site logs, but there are no errors (that I can find). Other than that, I don't know where to start.

# Answer
> 1 votes
Blank pages indicate that PHP has exited ("fatal error" etc), but that debug output is disabled. Your next step is either to enable display of debug in the page output, OR to obtain the debug from the backend.

Please refer to this answer which explains how to debug when you run into a blank page:

Can you be specific about which site logs you've checked? It may be there are some other logfiles you need to look at (see linked answer).

---
Tags: civireport, joomla
---


# Question
Title: Why won't data entered into CiviCRM profile html snippet save?
I'm using Joomla 3.4.1 with CiviCRM 4.6.3 on a demo site as part of a re-design. I've used the CiviCRM profiles html snippet to create a Joomla signup module. See here for example.

It worked once - storing the name and email into CiviCRM and even re-directing to the proper page and giving a thank you message after it stored the data.

However, now when you hit "save" in the module, this time nothing is saved and it kicks you back to the front page. I've read the manual, searched the forums, and tried a bunch of stuff, but nothing works. What am I missing?

# Answer
I wonder if it's the recaptcha on the form action page?

http://tremololabs.com/clients/IREHRTEST/index.php?option=com\_civicrm&task=civicrm/profile/create&gid=15&reset=1

My guess is that posting to that page without the recaptcha data (which is what your form does) is going to cause the server to be annoyed, and perhaps there's some kind of code or server security something that is hiding the response and just sending the user to the front page of your site? Do you have some kind of special configuration for your recaptcha perhaps?
> 1 votes

# Answer
I think I've tracked down the problem on my site to the uk.co.vedaconsulting Mailchimp plugin. Removing that seems to fix my issue on my test server, making my hack of embedding an iframe unnecessary. Hopefully it also fixes my timeout problem described at How do I make profile submissions more reliable, or at least not silently fail?

I need to confirm that this fixes the problem on our production server.

Devin, are you using the Mailchimp extension? Or any others you can try disabling?
> 0 votes

---
Tags: profile, form-snippets
---


# Question
Title: How do I make profile submissions more reliable, or at least not silently fail?
When a profile is submitted without a valid cookie, the submission is lost (no data saved in the database) and the site redirects to the front page of the website. This occurs on Joomla when:

* An HTML snippet is used (I'm working around this by embedding an iframe loading a standalone profile page, with CSS display:none to hide it)
* You load a profile, then delete the cookies for the site
* You load a profile, then wait a few hours before submitting it

We just had the 3rd condition trip up someone trying to fill out a form on our website. She loaded the page, let it sit overnight, and tried to submit the form 8 hours later. I don't know how to prevent this besides adding a note by the Save button to the effect of "If it has been more than an hour since you loaded this page, please reload it before saving the form". This seems really clunky, and will potentially lose the long answers users have entered into the form, if their browsers don't handle the reload well.

Is there a way to remove the dependence of the form submission on a cookie?

If not, is there a way to control what I assume is a cookie timeout, to reduce the incidence of the 3rd condition?

If not, is there a way to redirect the failed profile submission to an error page instructing the user to go back and try again? As it is, with no error given and the site redirecting to the front page of the website, the user has no idea anything went wrong and that their submission has been totally lost. This seems like a serious problem.

# Answer
I think I've tracked down the problem on my site to the uk.co.vedaconsulting Mailchimp plugin. Removing that seems to fix my issue on my test server, making my hack of embedding an iframe unnecessary (described at Why won't data entered into CiviCRM profile html snippet save? ). Hopefully it also fixes my timeout problem described here...testing that now.

EDIT Sept 22 2015:

Nope, i was wrong...misled by confusions in reloading pages and accidentally making it work with the background-loaded embedded form hack. Disabling Mailchimp or other plugins does not in fact change anything.

The approach I'm now using, successfully so far, is to load the embedded iframe hack at the time of form submission, rather than when the page is first loaded. So there's no danger of the page sitting too long , having the magic cookie (or whatever it is) time out.

1) user loads profile or page with HTML snippet

2) user eventually clicks "submit"

3) iframe hidden with CSS loads a small profile to set the magic cookie

4) when iframe finishes loading, it uses javascript to submit the original form

To accomplish this, I:

1) Embed javascript function in the head of each page with a profile:

```
<script type="text/javascript">
function loadHack() {
  var ifrm = document.createElement('iframe');
  ifrm.setAttribute('id', 'embeddedhack'); // assign an id
  document.body.appendChild(ifrm); // to place at end of document
  ifrm.setAttribute('src', '/en/?option=com_civicrm&task=civicrm/profile/create&gid=21&reset=1'); // assign url
}
</script>

```

2) use the alterContent hook (and manually edit HTML snippets) to make the submit button call the function above instead of submitting:

```
if($tplName == "CRM/Profile/Form/Edit.tpl")
  $content = str_replace('id="_qf_Edit_next"', 'id="_qf_Edit_next" onClick="loadHack(); return false;"', $content);

```

3) use the alterContent hook to add a callback to the embedded hack profile, to submit the original form once it's finished loading the iframe:

```
if ($object->getVar('_gid') == 21) //hack form
        $content .= "<script type=\"text/javascript\">window.onload = function() {\n    parent.document.getElementById('Edit').submit();\n}\n</script>";

```

This is all ugly, but seems to work. I think this really needs to be addressed in core code, though.
> 1 votes

---
Tags: profile, cookies
---


# Question
Title: How can I add my Wordpress Site's template to my contribution page?
I have a contribution page located here: http://pghchoralarts.org/civicrm/?page=CiviCRM&q=civicrm/contribute/transact&reset=1&id=1

I haven't gone through the entire process of testing the PayPal integration yet, but one thing I am having a bit of trouble with is figuring out how to incorporate the rest of my Wordpress theme into this page. Right now the page is an incomplete, unstyled HTML document, and I want to be able to essentially wrap my WordPress theme around it. Is there a fairly straightforward way to do this?

**EDIT:** I have narrowed down my issue to the fact that `wp_head()` in `civicrm.php` does not get called when it should. I have verified that `CiviCRM_For_WordPress->wp_head` gets added as a hook in the main `wp_head()`, but my theme does not call it when the main WordPress `wp_head()` is called. When I switch to twentyfifteen theme, the `wp_head()` function in `civicrm.php` gets called as expected. Any ideas on what may be going wrong?

# Answer
> 2 votes
I finally figured out the issue!

When CiviCRM was applying the template in `civicrm.basepage.php`, `$page_template` was coming back as `page.php`, but my base template was actually named `base.php`.

I added the following code in my theme's initialization and it resolved the issue:

```
add_filter( 'civicrm_basepage_template', 'psca_civicrm_basepage_template' );
function psca_civicrm_basepage_template( $template ) {
  return 'base.php';
}

```

# Answer
> 3 votes
Sorry, I don't have enough reputation to comment.

As Jon says, you need to go to **CMS Database Integration**

www.example.com/wp-admin/admin.php?page=CiviCRM&q=civicrm/admin/setting/uf&reset=1

There you have the WordPress users table and the WordPress base page, I would suggest to create an empty page named CiviCRM - slug 'civicrm' and use that page as your base page in the menu mentioned above.

This should be the default behaviour when you install Civi, as Civi automatically creates this page and sets it as the default base page, more info about this here.

# Answer
> 2 votes
It's easiest if you think of it as "Adding my contribution page to a WordPress page".

When editing a WordPress page, there is a CiviCRM button that allows you to insert a shortcode to insert a contribution page.

Also - it sounds like your base page isn't set. Contribution pages should inherit the default theme. **Check Administer menu \> System Settings \> CMS Integration Options**.

---
Tags: civicontribute, wordpress, contribution-page
---