# Question
Title: Resolving db error for unknown column in 'field list'"
Error: "Unknown column 'a\_to\_civicrm\_value\_reporting\_doc\_10.resource\_2\_67' in 'field list'"

This is a follow-up question to one that started over here. From that thread, I am clear that this is referring to a custom field that was created for CiviCase.

The error is popping up and causing database update problems in all sorts of places from contribution pages to membership update jobs.

Here is the CiviCRM log output for a failure on a contribution page:

```
Oct 21 12:15:08  [error] $Fatal Error Details = Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => exceptionHandler
        )

    [code] => -19
    [message] => DB Error: no such field
    [mode] => 16
    [debug_info] => SELECT a.id as `id`, a.source_record_id as `source_record_id`, a.activity_type_id as `activity_type_id`, a.subject as `subject`, a.activity_date_time as `activity_date_time`, a.duration as `duration`, a.location as `location`, a.phone_id as `phone_id`, a.phone_number as `phone_number`, a.details as `details`, a.status_id as `status_id`, a.priority_id as `priority_id`, a.parent_id as `parent_id`, a.is_test as `is_test`, a.medium_id as `medium_id`, a.is_auto as `is_auto`, a.relationship_id as `relationship_id`, a.is_current_revision as `is_current_revision`, a.original_id as `original_id`, a.result as `result`, a.is_deleted as `is_deleted`, a.campaign_id as `campaign_id`, a.engagement_level as `engagement_level`, a.weight as `weight`, a.is_star as `is_star`, a.created_date as `created_date`, a.modified_date as `modified_date`, a_to_civicrm_value_reporting_doc_10.narrative_interim_report_59 as `custom_59`, a_to_civicrm_value_reporting_doc_10.financial_interim_report_60 as `custom_60`, a_to_civicrm_value_reporting_doc_10.interim_reciepts_61 as `custom_61`, a_to_civicrm_value_reporting_doc_10.narrative_final_report_62 as `custom_62`, a_to_civicrm_value_reporting_doc_10.financial_final_report_63 as `custom_63`, a_to_civicrm_value_reporting_doc_10.financial_audit_64 as `custom_64`, a_to_civicrm_value_reporting_doc_10.final_reciepts_65 as `custom_65`, a_to_civicrm_value_reporting_doc_10.resource_2_67 as `custom_67`, a_to_civicrm_value_reporting_doc_10.resource_3_68 as `custom_68`, a_to_civicrm_value_reporting_doc_10.resource_4_69 as `custom_69`, a_to_civicrm_value_reporting_doc_10.resource_5_70 as `custom_70`, a_to_civicrm_value_reporting_doc_10.photo_1_71 as `custom_71`, a_to_civicrm_value_reporting_doc_10.photo_2_72 as `custom_72`, a_to_civicrm_value_reporting_doc_10.photo_3_73 as `custom_73`, a_to_civicrm_value_reporting_doc_10.photo_4_74 as `custom_74`, a_to_civicrm_value_reporting_doc_10.photo_5_75 as `custom_75`, a_to_civicrm_value_payment_reque_13.payment_number_94 as `custom_94`, a_to_civicrm_value_payment_reque_13.payment_amount_95 as `custom_95`, a_to_civicrm_value_payment_12.payment_approval_96 as `custom_96`, a_to_civicrm_value_grant_payment_15.amount_100 as `custom_100`, a_to_civicrm_value_grant_payment_15.cheque_or_confirmation_number_101 as `custom_101`
FROM civicrm_activity a
LEFT JOIN `civicrm_value_reporting_doc_10` `a_to_civicrm_value_reporting_doc_10` ON `a_to_civicrm_value_reporting_doc_10`.entity_id = `a`.id
LEFT JOIN `civicrm_value_payment_reque_13` `a_to_civicrm_value_payment_reque_13` ON `a_to_civicrm_value_payment_reque_13`.entity_id = `a`.id
LEFT JOIN `civicrm_value_payment_12` `a_to_civicrm_value_payment_12` ON `a_to_civicrm_value_payment_12`.entity_id = `a`.id
LEFT JOIN `civicrm_value_grant_payment_15` `a_to_civicrm_value_grant_payment_15` ON `a_to_civicrm_value_grant_payment_15`.entity_id = `a`.id
WHERE (a.source_record_id = "415") AND (a.activity_type_id = "6")
LIMIT 25
OFFSET 0
 [nativecode=1054 ** Unknown column 'a_to_civicrm_value_reporting_doc_10.resource_2_67' in 'field list']
    [type] => DB_Error
    [user_info] => SELECT a.id as `id`, a.source_record_id as `source_record_id`, a.activity_type_id as `activity_type_id`, a.subject as `subject`, a.activity_date_time as `activity_date_time`, a.duration as `duration`, a.location as `location`, a.phone_id as `phone_id`, a.phone_number as `phone_number`, a.details as `details`, a.status_id as `status_id`, a.priority_id as `priority_id`, a.parent_id as `parent_id`, a.is_test as `is_test`, a.medium_id as `medium_id`, a.is_auto as `is_auto`, a.relationship_id as `relationship_id`, a.is_current_revision as `is_current_revision`, a.original_id as `original_id`, a.result as `result`, a.is_deleted as `is_deleted`, a.campaign_id as `campaign_id`, a.engagement_level as `engagement_level`, a.weight as `weight`, a.is_star as `is_star`, a.created_date as `created_date`, a.modified_date as `modified_date`, a_to_civicrm_value_reporting_doc_10.narrative_interim_report_59 as `custom_59`, a_to_civicrm_value_reporting_doc_10.financial_interim_report_60 as `custom_60`, a_to_civicrm_value_reporting_doc_10.interim_reciepts_61 as `custom_61`, a_to_civicrm_value_reporting_doc_10.narrative_final_report_62 as `custom_62`, a_to_civicrm_value_reporting_doc_10.financial_final_report_63 as `custom_63`, a_to_civicrm_value_reporting_doc_10.financial_audit_64 as `custom_64`, a_to_civicrm_value_reporting_doc_10.final_reciepts_65 as `custom_65`, a_to_civicrm_value_reporting_doc_10.resource_2_67 as `custom_67`, a_to_civicrm_value_reporting_doc_10.resource_3_68 as `custom_68`, a_to_civicrm_value_reporting_doc_10.resource_4_69 as `custom_69`, a_to_civicrm_value_reporting_doc_10.resource_5_70 as `custom_70`, a_to_civicrm_value_reporting_doc_10.photo_1_71 as `custom_71`, a_to_civicrm_value_reporting_doc_10.photo_2_72 as `custom_72`, a_to_civicrm_value_reporting_doc_10.photo_3_73 as `custom_73`, a_to_civicrm_value_reporting_doc_10.photo_4_74 as `custom_74`, a_to_civicrm_value_reporting_doc_10.photo_5_75 as `custom_75`, a_to_civicrm_value_payment_reque_13.payment_number_94 as `custom_94`, a_to_civicrm_value_payment_reque_13.payment_amount_95 as `custom_95`, a_to_civicrm_value_payment_12.payment_approval_96 as `custom_96`, a_to_civicrm_value_grant_payment_15.amount_100 as `custom_100`, a_to_civicrm_value_grant_payment_15.cheque_or_confirmation_number_101 as `custom_101`
FROM civicrm_activity a
LEFT JOIN `civicrm_value_reporting_doc_10` `a_to_civicrm_value_reporting_doc_10` ON `a_to_civicrm_value_reporting_doc_10`.entity_id = `a`.id
LEFT JOIN `civicrm_value_payment_reque_13` `a_to_civicrm_value_payment_reque_13` ON `a_to_civicrm_value_payment_reque_13`.entity_id = `a`.id
LEFT JOIN `civicrm_value_payment_12` `a_to_civicrm_value_payment_12` ON `a_to_civicrm_value_payment_12`.entity_id = `a`.id
LEFT JOIN `civicrm_value_grant_payment_15` `a_to_civicrm_value_grant_payment_15` ON `a_to_civicrm_value_grant_payment_15`.entity_id = `a`.id
WHERE (a.source_record_id = "415") AND (a.activity_type_id = "6")
LIMIT 25
OFFSET 0
 [nativecode=1054 ** Unknown column 'a_to_civicrm_value_reporting_doc_10.resource_2_67' in 'field list']
    [to_string] => [db_error: message="DB Error: no such field" code=-19 mode=callback callback=CRM_Core_Error::exceptionHandler prefix="" info="SELECT a.id as `id`, a.source_record_id as `source_record_id`, a.activity_type_id as `activity_type_id`, a.subject as `subject`, a.activity_date_time as `activity_date_time`, a.duration as `duration`, a.location as `location`, a.phone_id as `phone_id`, a.phone_number as `phone_number`, a.details as `details`, a.status_id as `status_id`, a.priority_id as `priority_id`, a.parent_id as `parent_id`, a.is_test as `is_test`, a.medium_id as `medium_id`, a.is_auto as `is_auto`, a.relationship_id as `relationship_id`, a.is_current_revision as `is_current_revision`, a.original_id as `original_id`, a.result as `result`, a.is_deleted as `is_deleted`, a.campaign_id as `campaign_id`, a.engagement_level as `engagement_level`, a.weight as `weight`, a.is_star as `is_star`, a.created_date as `created_date`, a.modified_date as `modified_date`, a_to_civicrm_value_reporting_doc_10.narrative_interim_report_59 as `custom_59`, a_to_civicrm_value_reporting_doc_10.financial_interim_report_60 as `custom_60`, a_to_civicrm_value_reporting_doc_10.interim_reciepts_61 as `custom_61`, a_to_civicrm_value_reporting_doc_10.narrative_final_report_62 as `custom_62`, a_to_civicrm_value_reporting_doc_10.financial_final_report_63 as `custom_63`, a_to_civicrm_value_reporting_doc_10.financial_audit_64 as `custom_64`, a_to_civicrm_value_reporting_doc_10.final_reciepts_65 as `custom_65`, a_to_civicrm_value_reporting_doc_10.resource_2_67 as `custom_67`, a_to_civicrm_value_reporting_doc_10.resource_3_68 as `custom_68`, a_to_civicrm_value_reporting_doc_10.resource_4_69 as `custom_69`, a_to_civicrm_value_reporting_doc_10.resource_5_70 as `custom_70`, a_to_civicrm_value_reporting_doc_10.photo_1_71 as `custom_71`, a_to_civicrm_value_reporting_doc_10.photo_2_72 as `custom_72`, a_to_civicrm_value_reporting_doc_10.photo_3_73 as `custom_73`, a_to_civicrm_value_reporting_doc_10.photo_4_74 as `custom_74`, a_to_civicrm_value_reporting_doc_10.photo_5_75 as `custom_75`, a_to_civicrm_value_payment_reque_13.payment_number_94 as `custom_94`, a_to_civicrm_value_payment_reque_13.payment_amount_95 as `custom_95`, a_to_civicrm_value_payment_12.payment_approval_96 as `custom_96`, a_to_civicrm_value_grant_payment_15.amount_100 as `custom_100`, a_to_civicrm_value_grant_payment_15.cheque_or_confirmation_number_101 as `custom_101`
FROM civicrm_activity a
LEFT JOIN `civicrm_value_reporting_doc_10` `a_to_civicrm_value_reporting_doc_10` ON `a_to_civicrm_value_reporting_doc_10`.entity_id = `a`.id
LEFT JOIN `civicrm_value_payment_reque_13` `a_to_civicrm_value_payment_reque_13` ON `a_to_civicrm_value_payment_reque_13`.entity_id = `a`.id
LEFT JOIN `civicrm_value_payment_12` `a_to_civicrm_value_payment_12` ON `a_to_civicrm_value_payment_12`.entity_id = `a`.id
LEFT JOIN `civicrm_value_grant_payment_15` `a_to_civicrm_value_grant_payment_15` ON `a_to_civicrm_value_grant_payment_15`.entity_id = `a`.id
WHERE (a.source_record_id = "415") AND (a.activity_type_id = "6")
LIMIT 25
OFFSET 0
 [nativecode=1054 ** Unknown column 'a_to_civicrm_value_reporting_doc_10.resource_2_67' in 'field list']"])

Oct 21 12:15:08  [debug] $backTrace = #0 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(954): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(922): CRM_Core_Error::exceptionHandler(Object(DB_Error))
#2 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB.php(997): PEAR_Error->__construct("DB Error: no such field", -19, 16, (Array:2), "SELECT a.id as `id`, a.source_record_id as `source_record_id`, a.activity_typ...")
#3 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(575): DB_Error->__construct(-19, 16, (Array:2), "SELECT a.id as `id`, a.source_record_id as `source_record_id`, a.activity_typ...")
#4 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(223): PEAR::_raiseError(Object(DB_mysqli), NULL, -19, 16, (Array:2), "SELECT a.id as `id`, a.source_record_id as `source_record_id`, a.activity_typ...", "DB_Error", TRUE)
#5 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/common.php(1928): PEAR->__call("raiseError", (Array:7))
#6 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/mysqli.php(936): DB_common->raiseError(-19, NULL, NULL, "SELECT a.id as `id`, a.source_record_id as `source_record_id`, a.activity_typ...", "1054 ** Unknown column 'a_to_civicrm_value_reporting_doc_10.resource_2_67' in...")#7 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/mysqli.php(406): DB_mysqli->mysqliRaiseError()
#8 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/common.php(1234): DB_mysqli->simpleQuery("SELECT a.id as `id`, a.source_record_id as `source_record_id`, a.activity_typ...")
#9 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(2696): DB_common->query("SELECT a.id as `id`, a.source_record_id as `source_record_id`, a.activity_typ...")
#10 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(1829): DB_DataObject->_query("SELECT a.id as `id`, a.source_record_id as `source_record_id`, a.activity_typ...")
#11 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(472): DB_DataObject->query("SELECT a.id as `id`, a.source_record_id as `source_record_id`, a.activity_typ...")
#12 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(1637): CRM_Core_DAO->query("SELECT a.id as `id`, a.source_record_id as `source_record_id`, a.activity_typ...", TRUE)
#13 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/Civi/API/SelectQuery.php(133): CRM_Core_DAO::executeQuery("SELECT a.id as `id`, a.source_record_id as `source_record_id`, a.activity_typ...")
#14 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/api/v3/utils.php(1283): Civi\API\SelectQuery->run()
#15 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/api/v3/Activity.php(302): _civicrm_api3_basic_get("CRM_Activity_BAO_Activity", (Array:3), FALSE, "Activity", Object(CRM_Utils_SQL_Select))
#16 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_activity_get((Array:3))
#17 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(149): Civi\API\Provider\MagicFunctionProvider->invoke((Array:8))
#18 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(81): Civi\API\Kernel->runRequest((Array:8))
#19 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/api/api.php(133): Civi\API\Kernel->runSafe("Activity", "Get", (Array:3))
#20 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Activity/BAO/Activity.php(1607): civicrm_api3("Activity", "Get", (Array:3))
#21 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Contribute/Form/Contribution/Confirm.php(1180): CRM_Activity_BAO_Activity::addActivity(Object(CRM_Contribute_BAO_Contribution), "Contribution", "33006", (Array:3))
#22 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Contribute/Form/Contribution/Confirm.php(2758): CRM_Contribute_Form_Contribution_Confirm->processFormContribution((Array:62), NULL, (Array:30), Object(CRM_Financial_DAO_FinancialType), 5, NULL)
#23 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Contribute/Form/Contribution/Confirm.php(1534): CRM_Contribute_Form_Contribution_Confirm->processConfirm((Array:57), "33006", "2", 1, NULL)
#24 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Contribute/Form/Contribution/Confirm.php(1464): CRM_Contribute_Form_Contribution_Confirm->postProcessMembership((Array:57), "33006", (Array:41), (Array:0), (Array:21), (Array:1), TRUE, NULL, FALSE, "2", (Array:1))
#25 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Contribute/Form/Contribution/Confirm.php(2567): CRM_Contribute_Form_Contribution_Confirm->processMembership((Array:48), "33006", (Array:0), (Array:41), (Array:1))
#26 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Contribute/Form/Contribution/Confirm.php(2372): CRM_Contribute_Form_Contribution_Confirm->doMembershipProcessing("33006", (Array:48), (Array:41), (Array:1))
#27 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Contribute/Form/Contribution/Confirm.php(861): CRM_Contribute_Form_Contribution_Confirm->processFormSubmission("33006")
#28 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php(573): CRM_Contribute_Form_Contribution_Confirm->postProcess()
#29 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/StateMachine.php(144): CRM_Core_Form->mainProcess()
#30 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Next.php(43): CRM_Core_StateMachine->perform(Object(CRM_Contribute_Form_Contribution_Confirm), "next", "Next")
#31 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Next->perform(Object(CRM_Contribute_Form_Contribution_Confirm), "next")
#32 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Contribute_Form_Contribution_Confirm), "next")
#33 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php(355): HTML_QuickForm_Page->handle("next")
#34 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(319): CRM_Core_Controller->run((Array:3), NULL)
#35 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(69): CRM_Core_Invoke::runItem((Array:18))
#36 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(36): CRM_Core_Invoke::_invoke((Array:3))
#37 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/civicrm.php(1199): CRM_Core_Invoke::invoke((Array:3))
#38 /var/www/civi.waccglobal.org/wordpress/wp-content/plugins/civicrm/includes/civicrm.basepage.php(380): CiviCRM_For_WordPress->invoke()
#39 /var/www/civi.waccglobal.org/wordpress/wp-includes/class-wp-hook.php(307): CiviCRM_For_WordPress_Basepage->basepage_handler(Object(WP))
#40 /var/www/civi.waccglobal.org/wordpress/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters(NULL, (Array:1))
#41 /var/www/civi.waccglobal.org/wordpress/wp-includes/plugin.php(524): WP_Hook->do_action((Array:1))
#42 /var/www/civi.waccglobal.org/wordpress/wp-includes/class-wp.php(787): do_action_ref_array("wp", (Array:1))
#43 /var/www/civi.waccglobal.org/wordpress/wp-includes/functions.php(1330): WP->main("")
#44 /var/www/civi.waccglobal.org/wordpress/wp-blog-header.php(16): wp()
#45 /var/www/civi.waccglobal.org/wordpress/index.php(17): require("/var/www/civi.waccglobal.org/wordpress/wp-blog-header.php")
#46 {main}

```

Some tasks just won't complete, others are only partial. I attempted to simply delete the offending field, but that failed with an error that says the column doesn't exist. Here's the most relevant line from the log after the failed attempt:

```
ALTER TABLE civicrm_value_reporting_doc_10 DROP COLUMN `resource_2_67`, DROP FOREIGN KEY FK_civicrm_value_reporting_doc_10_resource_2_67 [nativecode=1091 ** Can't DROP COLUMN `resource_2_67`; check that it exists]"

```

In the previous thread it was suggested that ACLs might be an issue. There are none set on that field, but I disabled the only ACL on the system and tried again without success.

I am at a loss as to how to resolve this situation, but it is becoming a serious issue. It likely requires some serious CiviCRM database foo, but I'm not sure what to do.

I'm currently running 5.52.2 on WordPress. I'm more than willing to upgrade to the latest, but it seems unlikely to resolve anything and I'm worried that just pushing further down that trail will make things worse until I resolve this.

I would be fine to even destroy the offending field (or even related ones in CiviCase), but I need the main Contacts, Membership, Mailings and Contributions to work properly and allow me to move ahead.

How can resolve this 'unknown column' error and get back to a good place again?

# Answer
I've had something similar when a custom field wasn't fully created for some reason.

The `resource_2_67` field of `civicrm_value_reporting_doc_10` does not exist but Civi is expecting it to be there because of an inconsistency with other data. You should be able to clear that with:

`DELETE FROM civicrm_custom_field WHERE column_name = 'resource_2_67'`

Take a backup first before doing any direct SQL changes!
> 0 votes

---
Tags: custom-fields, database
---


title: Search by 4 months ago on Membership

text:
# Question
Title: Search by 4 months ago on Membership
We have civi 5.53 and Wordpress.

I am wanting to deal with overdue memberships. We have an end date of the last day of the month. Start date doesn't work for us so using end date.

I can use the option for month before previous month to get all our 30 day overdues. I would like to be able to find all those end dates for membership that are 3 months and 4 months over due.

I'm wanting this to be an automatic search - so whilst I can do this manually does anyone know how I could do this so that I can save a report with the criteria in for 3 months and 4 months ago?

# Answer
> 4 votes
Have you tried using Search Kit?

Code:

```
[
  [
    "SavedSearch",
    "save",
    {
      "records": [
        {
          "name": "Last_4_month",
          "label": "Last 4 month",
          "form_values": null,
          "mapping_id": null,
          "search_custom_id": null,
          "api_entity": "Membership",
          "api_params": {
            "version": 4,
            "select": [
              "id",
              "Membership_Contact_contact_id_01.display_name",
              "end_date"
            ],
            "orderBy": [],
            "where": [
              [
                "end_date",
                "<=",
                "now - 4 month"
              ]
            ],
            "groupBy": [],
            "join": [
              [
                "Contact AS Membership_Contact_contact_id_01",
                "LEFT",
                [
                  "contact_id",
                  "=",
                  "Membership_Contact_contact_id_01.id"
                ]
              ]
            ],
            "having": []
          },
          "expires_date": null,
          "description": null
        }
      ],
      "match": [
        "name"
      ]
    }
  ]
]

```

---
Tags: civimember, search
---


title: Remove campaign from mailing

text:
# Question
Title: Remove campaign from mailing
this may seem like a silly question, but I copied a previous mailing and it copied the campaign from that mailing. Now I can't figure out how to remove that campaign from my new mailing?

# Answer
> 2 votes
You can update the campaign for the mailing id **123** via one of the below method

1. Run SQL code

code:

```
UPDATE civicrm_mailing SET campaign_id = NULL WHERE id=123;

```
2. API 3 explorer - Navigate to CiviCRM \>\> Support \>\> Developer \>\> API Explorer v3

3. API 4 explorer - Navigate to CiviCRM \>\> Support \>\> Developer \>\> API Explorer v4

---
Tags: civimail, civicampaign
---


# Question
Title: Automatically add activity when sending bulk email
I noticed that one of my predecessors added an activity to each user whenever they were sent a bulk email. However, when I send a bulk email it does not create an activity. Is this something that can be done automatically?

# Answer
> 3 votes
There’s an option in the CiviMail Component Settings.

Administer \> CiviMail \> CiviMail Component Settings

Make sure the option ‘Enable CiviMail to create activities on delivery’ is checked.

This will then automatically create a ‘Bulk Email’ activity for each recipient.

---
Tags: civimail, activities
---


# Question
Title: How do I change the label that appears for multi-frequency recurring contributions?
When I activate the "Recurring" option in our Contribution Form, and select both "Monthly" and "Yearly," the generated output is a checkbox input (with id "is\_recur"), followed by a label (for="is\_recur"), and those are followed by a select element with options "month" and "year". It looks like the label is supposed to automatically update wording based on the options chosen, but ours always says the same thing: "I wish to contribute this amount every month as a recurring donation to support (organization name) year round."

I found what appears to be the source of this language in civicrm\civicrm\templates\CRM\Contribute\Form\Contribution\Confirm.tpl ... but no changes I make take effect. Also, all of the settings in that file end at "I want to contribute this amount every month." ... so I don't know where the "... as a recurring donation to support (organization name) year round" bit is coming from. Another developer configured CiviCRM for this client, but is no longer working with the organization, so I'm trying to get up to speed as quickly as I can. It is possible they used a custom template to do this, but I can't even identify what file they would have modified - nor where they would have stored it - if is is a custom template.

Honestly, I'd love to just make this a static label rather than a dynamic one; if anyone can advise how to change the label to simply say, "I want to make this an automatic recurring donation (click for options).", I would GREATLY appreciate it.

# Answer
Welcome to SE!

As @lars-sg points out, that is not standard wording.

It could come from various places:

Go to `Administer > System Settings > Directories` and note the 'Custom Template Directory'. If that uses `[civicrm.files]`, click the help icon in the help text box to show the actual directory on your system. Go look in the template directory and see if you have a template override with that text.

From the same page, note the extensions directory and look in there.

Also check at `Administer > Customize Data and Screens > Word Replacements` for any replacements that have been set up.
> 2 votes

---
Tags: civicontribute
---


title: CiviCRM Dashboard Hangs for 2 minutes

text:
# Question
Title: CiviCRM Dashboard Hangs for 2 minutes
I have installed a site under wordpress with Civicrm. Everytime i log on the site, i have to wait 2 minutes befor i can have access to civicrm. After that, no problem to navigate between the pages. I looked for past messages: CiviCRM Dashboard Hangs for 5+ minutes

CiviCRM Dashboard Hangs for 5+ minutes part 2

https://docs.civicrm.org/sysadmin/en/latest/troubleshooting/

first CiviCRM request of each session takes 4 minutes, afterwards works fine

Here is the results : no errors in wp-content/plugins/files/civicrm/ConfigAndLog/

I changed the value to 1 to const CHECK\_TIMER in plugings/civicrm/civicrm/CRM/Utils/Check.php to see if civicrm check were responsible : no change after that, i can switch between pages et menus with no delay -\> NOK

I replaced th ip value by the site address in civicrm.settings.php -\>NOK

I changed in /etc/hosts 127.0.0.1 address\_of\_my-site -\>NOK

I used the suppresses civicrm checks extension in wordpress -\>NOK

My DNS is ok in /etc/resolv.conf

I don't have any other idea, a clue would be much appreciate :)

# Answer
When you visit CiviCRM's admin page, by default it loads a couple of dashlets that pull content from civicrm.org

If it's you first time in a while visiting that page, it's going to pull it fresh, but if you then go back in the same session, it'll show you a cached version.

Your description tells me either that your server's connection to civicrm.org is extremely slow (and/or your server itself is underprovisioned), or (more likely) it's actually failing to connect to civicrm.org for reasons like a firewall or network topology.

Conclusion: if you do eventually see those dashlets, it's likely to be a network or server type issue. If you don't, then it's probably a firewall or (intentional) network setup that prevents your install from connecting to civicrm.org.

Note: you can test this by removing all the dashlets from your admin page and see what impact it has.
> 1 votes

---
Tags: base-page
---


title: Find Membership query

text:
# Question
Title: Find Membership query
I created 2 smart groups for mailings. One to pull all "current" members, one to pull all lapsed members.

In my lapsed group I set membership status = expired or cancelled, and current membership = no. However, I am getting current/active members showing up in my lapsed group and I don't understand what I did wrong?

Any insight is appreciated!

# Answer
> 2 votes
My guess is that current member = no is finding contacts with a non-current membership (but who might also have a current membership as well), rather than contacts who don't have a current membership at all. Can you verify if that's the case? Do these contacts have two memberships, one expired and one current? We could add a help text to Current member in Advanced Search indicating this is what's actually happening in the background or even look at improving this. I have found that current member gives unexpected results in the past as well.

If you use SearchKit instead, searching for:

* Contacts
* with (required) a Contact Membership with status one of expired or cancelled
* without a Contact Membership with status one of new, pending, current (or using whichever statuses are appropriate)

you should get the results you're looking for.

# Answer
> 1 votes
Finding Members who have a Current Membership and do not also have an Expired Membership, or vice versa, can be done using SearchKit by using a Without' join. (was mentioned here https://chat.civicrm.org/civicrm/pl/hnbkc3f8u7r69q1u1zbf6caozr)

---
Tags: civimember
---


# Question
Title: Create a Template showing pending invoice amounts
I have set up a search that shows all 30 day, 60 day and 90 day outstanding memberships. I can then email those that I want from the list of members.

Is there a way to create a mailing template that will show all their pending contribution payments.

I don't want to set up scheduled reminders because we need an element of control over which of those members we send to but I don't want to manually send to each to give them a summary of what they owe.

Civicrm 3.53 and wordpress

# Answer
Sounds like a custom token may be a possible solution. Fuzion Tokens has some pending contribution tokens that sound close to what you want, but your case seems a little more complicated because it involves multiple pending contributions. You might be able to build on (or hire someone to build on) the next pending contribution token from Fuzion Tokens.
> 4 votes

---
Tags: contributions, invoice, pending
---


# Question
Title: Cron job is run but CRON.PHP not executing job
I'm using DRUPAL 9 CivicCRM 5.54 and running it on CPanel. This is a new install.

The cron job on CPanel runs and doesn't generate errors, however the `cron.php` script doesn't run the `job.execute` API call.

CRON JoB is detailed here:

```
/usr/local/bin/php /home/changin5/public_html/vendor/civicrm/civicrm-core/bin/cron.php name=admin pass=XXXXXXXXX key=XXXXXXXXXX > /home/changin5/public_html/civicrm.log 2>&1

```

The `CRON.php` script has various file paths in it which are not correct as far as I can see. I've commented out the actual ones where files exist and left in the original ones in the script, but it doesn't run the jobs! Adding in the file paths that are commented out still doesn't run the API call.

Script Paths:

* `'/public_html/modules/contrib/civicrm/civicrm.config.php.drupal'` \- this exists
* `require_once '../civicrm.config.php';` doesn't exist except as above!
* `'/home/changin5/public_html/vendor/civicrm/civicrm-core/CRM/Core/Config.php'` \- this exists
* `require_once 'CRM/Core/Config.php';`
* `'/home/changin5/public_html/vendor/civicrm/civicrm-core/CRM/Utils/Request.php'` \- this exists

```
require_once 'CRM/Utils/Request.php';
CRM_Core_Config::singleton();
CRM_Utils_System::authenticateScript(TRUE);

$job = CRM_Utils_Request::retrieve('job', 'String', CRM_Core_DAO::$_nullArray, FALSE, NULL, 'REQUEST');

/*'/home/changin5/public_html/vendor/civicrm/civicrm-core/CRM/Core/JobManager.php'*/
require_once 'CRM/Core/JobManager.php';
$facility = new CRM_Core_JobManager();

if ($job === NULL) {
  $facility->execute();
}
else {
  $ignored = array("name", "pass", "key", "job");
  $params = array();
  foreach ($_REQUEST as $name => $value) {
    if (!in_array($name, $ignored)) {
      $params[$name] = CRM_Utils_Request::retrieve($name, 'String', CRM_Core_DAO::$_nullArray, FALSE, NULL, 'REQUEST');
    }
  }
  $facility->setSingleRunParams('job', $job, $params, 'From cron.php');
  $facility->executeJobByAction('job', $job);
}

```

Having tried to make these file paths accurate the script still doesn't run, it didn't run with the original paths as the `cron.php` sits in `vendors/civicrm/civicrm-core/bin` and calls to file paths in `..CRM/Core` or `..CRM/Utils` or both of which exist but `../civicrm.config.php` doesn't exist!

Any pointers as to what files this script is meant to be referring to and where they are? And have I got it correct that they should be fully relative paths rather than `..CRM` etc?

# Answer
> 0 votes
This method of running cron doesn't work with drupal 9. Try using `cv` instead: see https://docs.civicrm.org/sysadmin/en/latest/setup/jobs/#commands

---
Tags: cron-job, scheduled-job
---


# Question
Title: Update "unsubscribe" information for email addresses
I have a data set downloaded from MailChimp (pre-dating when we used CiviCRM) of people who hit "unsubscribe" for their email address. I've used the "CVS Import Helper" extension to match each of these with their CiviCRM contact ID.

Now I'd like to process these unsubscriptions - but for people who have more than one email address, it seems correct to unsubscribe them from *just* the address they wanted to remove. My assumption is that for some people, they may have been getting multiple messages, and intended to unsubscribe from one so they just get one message now.

Is there a way to do this using the "Import Contacts" or similar functionality?

# Answer
> 1 votes
To make sure I'm on the same page terminology wise: a contact **unsubscribes** from a specific list (allowing them to still get email from other lists still) but if they **opt-out** that means no emails should be sent to that specific email address. (Civi also adds another layer where you can mark a contact 'Do not email' - and no email will be sent to that contact at all.)

You could use the **On Hold - Opt Out** option, per email, on a contact but that will also prevent you from sending any mail to that email address.

You might be able to use the **Bulk Mailings?** checkbox and keep a separate email marked for bulk mailings. We don't use this as often but I'm pretty sure the way it works is: If the checkmark is not used then civi assumes it should send bulk mailings to the email marked primary. But once you use the checkmarks bulk mailings will only go to the email(s) that have been marked for bulk mailings.

---
Tags: email, import, unsubscribe
---


title: 'Extensions' menu item is missing

text:
# Question
Title: 'Extensions' menu item is missing
I run two installations of CiviCRM. Both on Wordpress. Both CiviCRM version 5.54.1, php version 8.1.1. Both on the same server.

Today I noticed that on one of the installations, the 'Extensions' menu item is missing from the Administer/System Settings menu. Where there should be a horizontal line separating Components and Extensions from the rest of the menu items, the line is also missing. Weird. The other installation doesn't have this problem.

Anyone any suggestions for where to start investigating? Thanks.

# Answer
> 1 votes
No idea why it might have disappeared, but you can add it back under Administer - Customize Data and Screens - Navigation Menu (the url is civicrm/admin/extensions?reset=1).

---
Tags: extension, menu, system-settings
---


title: Trying To Get A Full Contact Report

text:
# Question
Title: Trying To Get A Full Contact Report
There’s been a lot of turnover at my job, which means there are tons of duplicate entries in our civi records. I’m trying to do a reconciliation to remove the duplicates by downloading all the contacts and going through the excel by hand, then merging them in civi, but I can only get a report for each GROUP (we have hundreds of groups and they overlap, so that’s not useful.)

Is there a way for me to just get a FULL contact report of every single person/entry in the system? Thanks!

# Answer
You can get all contacts by simply going to Advanced Search and clicking search without entering any criteria at all.

But if you're looking to remove duplicates, it might be less painful to set up appropriate dedupe rules and then use each rule in Find and Merge Duplicate Contacts. Depending what your data looks like, you can do things like first and last Name, just email, last name and email, last name and phone, first name and email, even last name and first four letters of first name, etc.
> 2 votes

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


# Question
Title: How can I combine contributions from multiple event registrations?
Sometimes we have an event registration of multiple participants from a single organisation. This creates an aggregated contribution for those participants. A while later another participant is registered but wants to be included in the invoice for the first group.

Is it possible to combine the two contributions, preferably by just adding the second, single, one to to first one?

# Answer
> 1 votes
Not sure I get all the details of your use case, but you could potentially have the additional participants sign up for free, then update the contribution with the Line Item Editor extension (https://civicrm.org/extensions/line-item-editor). Alternatively, you could set up a price set for the event registration with a price field (e.g. "Additional Amount") that's only visible to admins on the back end - if you edit the contribution, you can enter whatever amount you'd like, and it'll increase the contribution value/balance.

The following might be useful, as well: https://civicrm.org/extensions/edit-event-fee

Again, sharing all these not fully understanding your use case, but hoping one or a combo of the above would help.

---
Tags: civievent, contributions, registration
---


title: large civicrm_activity table

text:
# Question
Title: large civicrm_activity table
Our civicrm\_activity table is large - about 1 GB, but there are only 170,000 rows. Is this normal? I'm surprised that this many rows should need such a large table. Thanks.

# Answer
There's a number of possible reasons:

* Do you regularly delete activity records? The table size on disk won't shrink unless you manually take steps to do this, e.g. OPTIMIZE TABLE. So you might not have many records, but all the original space is still reserved but empty.
* You have some additional indexes. Compare to a fresh install.
* utf8mb4 can be larger than utf8mb3 (aka utf8), if you are using utf8mb4 and comparing to an older database.
* Are the details fields in the records large? i.e. are they typically emails or thank-you letters with lots of text?
    + `select id, length(details) from civicrm_activity order by length(details) desc limit 4;` will show e.g. the top 4 by length.
* You can get the breakdown of data vs index usage with `SHOW TABLE STATUS LIKE 'civicrm_activity'` which might help narrow it down.
> 2 votes

---
Tags: activity
---


# Question
Title: "Failed to locate boot function (bootJoomla)" error when installing with cv
Learning to use cv, and when trying to upgrade CiviCRM with the following command, I get a "Failed to locate boot function (bootJoomla)" error. Any thoughts where I should start digging as to what's wrong?

cv core:install --cms-base-url="\[website/CMS\_root\]" --lang="en\_US" --db="mysql://\[db\_user\]:\[db\_user\_pwd\]@localhost:3306/\[db\_name\]"

# Answer
> 1 votes
Unfortunately it's not implemented yet:

See https://github.com/civicrm/cv/blob/cf4f644da6d007a32f1c583d68e6b0ae4fe6c45b/src/CmsBootstrap.php#L306

```
// TODO public function bootJoomla($cmsRootPath, $cmsUser) { }

```

---
Tags: upgrade, joomla, installation, cv
---


# Question
Title: Contribution imports have stopped working
I have been importing contributions from a .csv file every month for a couple of years. It recently stopped working for me. I get the following error message:

"Please correct the following errors in the form fields below: Missing required contact matching fields. email(weight 10) (Sum of all weights should be greater than or equal to threshold: 10)."

Email is one of the imported fields.

# Answer
> 0 votes
I found this issue here with a workaround: https://lab.civicrm.org/dev/core/-/issues/3939

And there is already a pull request to fix this issue: https://github.com/civicrm/civicrm-core/pull/24838

---
Tags: contributions, import, field-mapping
---


# Question
Title: What's the best practice for creating a cronuser for WordPress CiviCRM installs?
I am working on setting up the cron job using cv on a fresh CiviCRM and WordPress install. The docs are unclear on where to set up the "cronuser" user (WordPress user? CiviCRM contact?) and how to set the permissions needed for the cron to run successfully.

# Answer
> 1 votes
I think it depends on what cron solution you are using.

Since you say cv, I'll assume that you are running anacron or the like from the command line on Linux. I suggest that you run it as the user that owns the website. If you use Apache on Debian for example, the default web user is www-data.

In my case, for security reasons, I make the sites owned by a user I call www-dev and so I run the Civi cron jobs as that user. You can access that user's crontab using sudo even if they aren't allowed to login like the www-data user: `sudo crontab -e -u www-dev`.

You just need to be sure that whatever user you choose has write capabilities on the directory.

As for the WP user, if you're using the command line I don't think it matters as you never provide the password on the command line. I just use my own admin account. For example I use a crontab entry like this:

```
*/5 5-22 * * *  /usr/local/bin/cv api job.execute --user=AdminUser --cwd=/var/www/wordpressroot > /dev/null

```

I suggest you set the `MAILTO=` in the crontab file as well so you get an email if there is an error.

# Answer
> 2 votes
The cronuser is a CMS user, so in your case a WordPress user. I tend to give the cron user a strong password and don't use that user account for anything but cron. As far as permissions, they need a good deal but it depends on the jobs running. CivICRM for WP now has the ability to create a CiviCRM administartor role (in the menu under settings `/wp-admin/admin.php?page=civi_options`) - I'd start with that and remove unneded capabilities based on your cron/scheduled jobs.

---
Tags: wordpress, installation, cron
---


# Question
Title: Upgrade available message - controlled by?
In some of my installs system status shows the message about available upgrades. In others there is no message about upgrades at all. What controls this? I couldn't see any settings in the Misc settings or anywhere else.

# Answer
> 0 votes
* Is it on the hidden tab on the status page? People can manually hide some checks.
* Some servers might not have network access to reach the extension directory.
* Are those sites already up to date on their extensions? (silly question but is a possible cause)

---
Tags: upgrade
---


# Question
Title: Scheduled reminder wants a choice of auto renewal options but auto renewal is off - price set issue?
We don't use auto renewal (Auto Renew Option set to NO for all membership types), but we do use price sets. I am trying to test automated reminders for membership expiration, but I am being prompted to choose from the auto renew options list, which is empty. This is CiviCRM 5.50.2 on Wordpress 6. I see that there have been issues around price sets and auto renew, but we don't want auto renew at all. Am I missing something simple - is there a way to populate the auto renew options with "No"? Thanks for any help you can provide!

# Answer
Yes, the membership type's auto-renewal should be either optional or required if you want to use the reminders for Membership.
> 2 votes

---
Tags: civimember, scheduled-reminders
---


# Question
Title: CiviEvent : Error on event registration Thank-you page
We have a trouble with CiviEvent with **CiviCRM 5.54.1, Wordpress 6.1**

We can do the register, send mail but when the ThankYou page is display a message error is display : **"Could not find valid value for id Return to home page."**

**URL of thank you page**: http://domain.org/fr/civicrm/?civiwp=CiviCRM&q=civicrm%2Fevent%2Fregister&\_qf\_ThankYou\_display=true&qfKey=CRMEventControllerRegistration30...

**From the error log :**

```
nov. 02 19:31:37  [error]
$Fatal Error Details = array:3 [
  "message" => "Aucune donnée valide n'a pu être trouvée pour la variable « id »."
  "code" => null
  "exception" => CRM_Core_Exception {#12638
    -errorData: array:1 [
      "error_code" => 0
    ]
    #cause: null
    -_trace: null
    #message: "Aucune donnée valide n'a pu être trouvée pour la variable « id »."
    #code: 0
    #file: "/home/domaine/www/www/wp-content/plugins/civicrm/civicrm/CRM/Utils/Request.php"
    #line: 98
    trace: {
      /home/domaine/www/www/wp-content/plugins/civicrm/civicrm/CRM/Utils/Request.php:98 {
        › if (!isset($value) && $abort) {
        ›   throw new CRM_Core_Exception(ts('Could not find valid value for %1', [1 => $name]));
        › }
      }
      /home/domaine/www/www/wp-content/plugins/civicrm/civicrm/CRM/Event/StateMachine/Registration.php:27 { …}
      /home/domaine/www/www/wp-content/plugins/civicrm/civicrm/CRM/Event/Controller/Registration.php:27 { …}
      /home/domaine/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:314 { …}
      /home/domaine/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:69 { …}
      /home/domaine/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:36 { …}
      /home/domaine/www/www/wp-content/plugins/civicrm/civicrm.php:1199 { …}
      /home/domaine/www/www/wp-content/plugins/civicrm/includes/civicrm.basepage.php:380 { …}
      /home/domaine/www/www/wp-includes/class-wp-hook.php:308 { …}
      /home/domaine/www/www/wp-includes/class-wp-hook.php:332 { …}
      /home/domaine/www/www/wp-includes/plugin.php:565 { …}
      /home/domaine/www/www/wp-includes/class-wp.php:797 { …}
      /home/domaine/www/www/wp-includes/functions.php:1332 { …}
      /home/domaine/www/www/wp-blog-header.php:16 { …}
      /home/domaine/www/www/index.php:17 { …}
    }
  }
]

nov. 02 19:31:37  [debug] $backTrace = #0 /home/domaine/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(441): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 /home/domaine/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(39): CRM_Core_Error::handleUnhandledException(Object(CRM_Core_Exception))
#2 /home/domaine/www/www/wp-content/plugins/civicrm/civicrm.php(1199): CRM_Core_Invoke::invoke((Array:3))
#3 /home/domaine/www/www/wp-content/plugins/civicrm/includes/civicrm.basepage.php(380): CiviCRM_For_WordPress->invoke()
#4 /home/domaine/www/www/wp-includes/class-wp-hook.php(308): CiviCRM_For_WordPress_Basepage->basepage_handler(Object(WP))
#5 /home/domaine/www/www/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(NULL, (Array:1))
#6 /home/domaine/www/www/wp-includes/plugin.php(565): WP_Hook->do_action((Array:1))
#7 /home/domaine/www/www/wp-includes/class-wp.php(797): do_action_ref_array("wp", (Array:1))
#8 /home/domaine/www/www/wp-includes/functions.php(1332): WP->main("")
#9 /home/domaine/www/www/wp-blog-header.php(16): wp()
#10 /home/domaine/www/www/index.php(17): require("/home/domaine/www/www/wp-blog-header.php")
#11 {main}

```

**Already done :** I already check that a WP page with the 'civicrm' permalink is present and a 'base page' within CiviCRM is configurated in Administer-\>System setting-\>CMS Database Integration

Do you have an idea of the root cause ?

# Answer
> 2 votes
Yes I found :-) the civicrm.settings.php must have this bit of code:

   if ( function_exists('variable_get') && variable_get('clean_url', '0') != '0') {
     define('CIVICRM_CLEANURL', 1 );
   }
   elseif ( function_exists('config_get') && config_get('system.core', 'clean_url') != 0) {
     define('CIVICRM_CLEANURL', 1 );
   }
   elseif( function_exists('get_option') && get_option('permalink_structure') != '' ) {
     define('CIVICRM_CLEANURL', 1 );
   }
   else {
     define('CIVICRM_CLEANURL', 0);
   }
 }```

---
Tags: wordpress, civievent, error, online-registration
---


# Question
Title: Civi error using D9 webform for contribution payments. "Unable to complete payment! Missing paymentIntentID"
Creating a donation page using D9 webform and Civi 5.51.3. Payment processor options are Stripe and Pay Later. In each case when donation is submitted the Civi error is "Unable to complete payment! Missing paymentIntentID" and the user is sent to most recent Civi page.

I can see similar discussions such as https://lab.civicrm.org/extensions/stripe/-/issues/233 and https://lab.civicrm.org/extensions/stripe/-/issues/348

Log error: paymentIntentID not found. $params: Civi\Payment\PropertyBag Object ( \[props:protected\] =\> Array ( \[default\] =\> Array ( \[firstName\] =\> Nubay \[lastName\] =\> Admin \[billingStreetAddress\] =\> 35 Pickwick Road \[billingPostalCode\] =\> 02465 \[billingCity\] =\> Newton \[country\_id\] =\> 1228 \[state\_province\_id\] =\> 1020 \[email\] =\> xxx.org \[enable\_contribution\] =\> 1 \[payment\_processor\_id\] =\> 1 \[is\_test\] =\> 0 \[financial\_type\_id\] =\> 1 \[total\_amount\] =\> 10 \[billing\_address\_first\_name\] =\> Nubay \[billing\_address\_last\_name\] =\> xxx \[billing\_address\_street\_address\] =\> xxx \[billing\_address\_postal\_code\] =\> 02465 \[billing\_address\_city\] =\> Newton \[billing\_address\_country\_id\] =\> 1228 \[billing\_address\_state\_province\_id\] =\> 1020 \[currency\] =\> USD \[skipLineItem\] =\> 1 \[skipRecentView\] =\> 1 \[contactID\] =\> 2 \[invoiceID\] =\> 4e8123456789 \[tax\_amount\] =\> 0 \[description\] =\> Webform Payment: Webform Contributions V2 \[source\] =\> Test New Webform Contributions \[financialType\_name\] =\> Donation \[financialTypeID\] =\> 1 \[non\_deductible\_amount\] =\> 0 \[civicrm\_1\_contribution\_1\_contribution\_billing\_address\_first\_name\] =\> Nubay \[civicrm\_1\_contribution\_1\_contribution\_billing\_address\_last\_name\] =\> xxx \[civicrm\_1\_contribution\_1\_contribution\_billing\_address\_street\_address\] =\> xxx \[civicrm\_1\_contribution\_1\_contribution\_billing\_address\_postal\_code\] =\> 02465 \[civicrm\_1\_contribution\_1\_contribution\_billing\_address\_city\] =\> Newton \[civicrm\_1\_contribution\_1\_contribution\_billing\_address\_country\_id\] =\> 1228 \[civicrm\_1\_contribution\_1\_contribution\_billing\_address\_state\_province\_id\] =\> 1020 \[op\] =\> SUBMIT YOUR DONATION \[form\_build\_id\] =\> form-P1pw\_qZIT\_yOiXUxxxve78C1NevEzhJx550fmRtdRc \[form\_token\] =\> itRvLxCSoVzZCi8xxxXAsPrIEAu5\_rpE48IhD\_glddA \[form\_id\] =\> webform\_submission\_webform\_contributions\_v2\_block\_content\_2\_add\_form \[payment\_instrument\_id\] =\> 1 \[payment\_processor\] =\> 1 \[check\_permissions\] =\> \[contribution\_status\_id\] =\> Pending \[amount\] =\> 10 \[contributionID\] =\> 940 \[version\] =\> 3 \[isRecur\] =\> \[error\_url\] =\> \[setupIntentID\] =\> \[paymentMethodID\] =\> \[paymentIntentID\] =\> ) ) \[suppressLegacyWarnings:protected\] =\> 1 \[lastWarning\] =\> )

# Answer
> 1 votes
Main issue here was that payment method field must be on the same webform page as the actual payment element or it won't work.

---
Tags: webform-civicrm, payment-processor, stripe
---


# Question
Title: Bounce Processing and Process Inbound Emails Failure, Error message: Could not connect to MailStore
We have recently been getting scheduled job failure notices for both Bounce Processing and Process Inbound Emails. This happened out of the blue a week or two ago... it's been fine for a good couple of years. Nothing has changed with the email associated with these jobs. I have changed the password to the email address in case there was an issue there, but it's still not working. I have been in Microsoft settings as well and can't see anything that would have changed. Can anyone help?

We are running CiviCRM version 5.52.2 with Joomla 3.10.11

**Bounce Processing Error Details:**

Parameters parsed (and passed to API method): a:1:{s:7:"version";i:3;}

Full message: Finished execution of Fetch Bounces with result: Failure, Error message: Could not connect to MailStore for xxxxxx@xxxxxxxxxx.org@outlook.office365.com Error message:

An error occured while sending or receiving mail. The IMAP server did not accept the password: -ERR Logon failure: unknown user name or bad password.

**Process Inbound Emails Error Details:**

Parameters parsed (and passed to API method): a:1:{s:7:"version";i:3;}

Full message: Finished execution of Process Inbound Emails with result: Failure, Error message: Could not connect to MailStore for xxxxxx@xxxxxxxxxx.org@outlook.office365.com Error message:

An error occured while sending or receiving mail. The IMAP server did not accept the username and/or password: A0001 NO LOGIN failed..

# Answer
I experienced the same thing!

It seems like Microsoft is depreceating Basic Authentication (at the end of October 2022)

Here is a walkthrough I received on email from our phone company, fixing this:

5 steps to show how to opt-out of disabling Basic Auth for EWS in Microsoft 365 Admin Center interface.

1. Log in to Microsoft 365 Admin Center and click the green Help and support button in the lower right hand corner of the screen.
2. Search for “Diag: Enable Basic Auth in EXO” in the search field
3. Click “Run Tests”
4. Choose “IMAP” in the “Protocol to Opt Out” drop down and select “Update”.
5. Microsoft will run Diagnose for a short while and display the below view if successful.
> 1 votes

---
Tags: civimail, scheduled-job, bounce-processing
---


# Question
Title: How to change the date format for the receipt date in a template
I'm using the "Thank-you letters - print or email" functionality to generate a receipt for contributions. I created a new template with all the information needed. However we have a problem to display the receipt date at the correct format. Actually, when I chose the token "Receipt date" in the combobox, Civi inserts {contribution.receipt\_date} in my template, and when I generate a PDF, it displays the date with the hours : for example, "2019-02-25 16:01:00". We would just like to display the date (without the hours) at this format : dd/mm/YYYY (for example : "25/02/2019"). I tried to add code like "date\_format" in the source of the template to change the date format, but it didn't work. Is there an easy way to change it ?

Thanks !

# Answer
> 6 votes
If you want 28 February 2019 {foreach from=$contributions item=contribution} {assign var="date" value=$contribution.receive\_date|date\_format:"%d %B %Y"}

If you want 28 02 2019 {foreach from=$contributions item=contribution} {assign var="date" value=$contribution.receive\_date|date\_format:"%d %m %Y"}

If you want it to look better (28/02/2019) you can add slashes value=$contribution.receive\_date|date\_format:"%d/%m/%Y"}

# Answer
> 3 votes
As of CiviCRM 5.43, there is a much simpler answer:

```
{contribution.receipt_date|crmDate:"shortdate"}

```

There is full documentation for the `crmDate` filter.

# Answer
> 2 votes
You will need to have Smarty template processing turned on for mailings: make sure `CIVICRM_MAIL_SMARTY` is defined in your civicrm.settings.php file, as described in the CiviCRM User Guide.

Then, replace the `{contribution.receive_date}` token in your message with Smarty code such as this:

* For a date like "26/01/2020" (dd/mm/yyyy):

`{capture assign=formattableDateReceived}{contribution.receive_date}{/capture}{capture assign=formatString}%d/%m/%Y{/capture}{$formattableDateReceived|date_format:$formatString}`
* For a date like "December 7, 2020":

`{capture assign=formattableDateReceived}{contribution.receive_date}{/capture}{capture assign=formatString}%B %e, %Y{/capture}{$formattableDateReceived|date_format:$formatString|strip}`
* For a date like "01/26/2020" (mm/dd/yyyy):

`{capture assign=formattableDateReceived}{contribution.receive_date}{/capture}{capture assign=formatString}%m/%d/%Y{/capture}{$formattableDateReceived|date_format:$formatString}`
* For a date like "1/26/2020" (m/d/yyyy):

`{capture assign=formattableDateReceived}{contribution.receive_date}{/capture}{capture assign=formatString}%m/%d/%Y{/capture}{capture assign=mdyCleanupFind}#(^|/)0#{/capture}{capture assign=mdyCleanupReplace}$1{/capture}{$formattableDateReceived|date_format:$formatString|regex_replace:$mdyCleanupFind:$mdyCleanupReplace}`

These four examples use Smarty's date\_format, strip and regex\_replace modifiers. Due to the way that Civi applies Smarty to thank-you letters (as of Civi 5.32), we have to capture the parameters for each of these modifiers in a variable before using them.

The patterns above should work for other date fields as well (receipt\_date, cancel\_date etc.)

# Answer
> 0 votes
This code helped me to include an European date format into PDF-invoices:

`{$invoice_date|date_format:"%d.%m.%Y"}`

in your case you have to change invoice\_date with the desired contribution.receipt\_date

---
Tags: receipts, dates
---


# Question
Title: GuzzleHttp Error with certain plugins in WordPress
I am getting GuzzleHttp errors when activating or trying to access a couple plugins in conjunction wit CiviCRM. This seems to be with newer versions of CiviCRM (5.52 & higher). I thought initially it was related to the ScormCloud plugin but then it came up with the google analytics plugin. Below are the errors.

```
Fatal error: Uncaught Error: Call to undefined method GuzzleHttp\Utils::chooseHandler() in /home/<<account>>/public_html/wp-content/plugins/scormcloud/vendor/guzzlehttp/guzzle/src/functions.php:61
Stack trace:
#0 /home/<<account>>/public_html/wp-content/plugins/civicrm/civicrm/vendor/guzzlehttp/guzzle/src/HandlerStack.php(42): GuzzleHttp\choose_handler()
#1 /home/<<account>>/public_html/wp-content/plugins/civicrm/civicrm/vendor/guzzlehttp/guzzle/src/Client.php(65): GuzzleHttp\HandlerStack::create()
#2 /home/<<account>>/public_html/wp-content/plugins/scormcloud/vendor/rustici-software/scormcloud-api-v2-client-php/src/Api/CourseApi.php(77): GuzzleHttp\Client->__construct()
#3 /home/<<account>>/public_html/wp-content/plugins/scormcloud/SCORMCloud_PHPLibrary/ScormEngineService2.php(63): RusticiSoftware\Cloud\V2\Api\CourseApi->__construct(NULL, Object(RusticiSoftware\Cloud\V2\Configuration), NULL)
#4 /home/<<account>>/public_html/wp-content/plugins/scormcloud/scormcloudplugin.php(106): ScormEngineService->__construct('https://cloud.s...', 'YJC8NJPV9J', 'Rl in /home/<<account>>/public_html/wp-content/plugins/scormcloud/vendor/guzzlehttp/guzzle/src/functions.php on line 61

An error of type E_ERROR was caused in line 61 of the file /home/<<account>>/public_html/wp-content/plugins/googleanalytics/lib/analytics-admin/vendor/guzzlehttp/guzzle/src/functions.php. Error message: Uncaught Error: Call to undefined method GuzzleHttp\Utils::chooseHandler() in /home/<<account>>/public_html/wp-content/plugins/googleanalytics/lib/analytics-admin/vendor/guzzlehttp/guzzle/src/functions.php:61
Stack trace:
#0 /home/<<account>>/public_html/wp-content/plugins/civicrm/civicrm/vendor/guzzlehttp/guzzle/src/HandlerStack.php(42): GuzzleHttp\choose_handler()
#1 /home/<<account>>/public_html/wp-content/plugins/civicrm/civicrm/vendor/guzzlehttp/guzzle/src/Client.php(65): GuzzleHttp\HandlerStack::create()
#2 /home/<<account>>/public_html/wp-content/plugins/civicrm/civicrm/CRM/Extension/Browser.php(52): GuzzleHttp\Client->__construct()
#3 /home/<<account>>/public_html/wp-content/plugins/civicrm/civicrm/CRM/Extension/Browser.php(252): CRM_Extension_Browser->getGuzzleClient()
#4 /home/<<account>>/public_html/wp-content/plugins/civicrm/civicrm/CRM/Extension/Browser.php(196): CRM_Extension_Browser->grabRemoteJson()
#5 /home/<<account>>/public_html/wp-content/plugins/civicrm/civicrm/CRM/Extension/Browser.php(151): CRM_Extension_Browser->_discoverRemot

```

# Answer
> 2 votes
They are probably using guzzle7. Civi will work with guzzle7 but ships with 6, so you need to manually go into the civicrm folder (the one that has e.g. a CRM folder, a Civi folder, a vendor folder, a composer.json and composer.lock file, etc) and type `composer require guzzlehttp/guzzle:'^7'`.

---
Tags: wordpress, plugin
---


title: Any luck with importing CODA files?

text:
# Question
Title: Any luck with importing CODA files?
We installed CiviBanking 0.80 on a Drupal 9/CiviCRM 5.33. Then tried to import configs from https://github.com/Project60/org.project60.banking/tree/master/configuration\_database/Importer/CODA but it fails with 'Import/update failed: Import failed: Expected one OptionValue but found 0'

Trying to create the plugin in the interface with the code provided in the examples doesn't help either.

I really feel I must be missing something very obvious here but what ...?

# Answer
You also need to install the coda extension: https://github.com/Project60/org.project60.coda (check the installation instruction). Once you have done that you should be able to add a Coda configuration and import a Coda file.

Please note that Coda is a Belgian thing so folks here might not recognize your question :-)
> 2 votes

---
Tags: civibanking
---


# Question
Title: Need help installing CiviCRM on backdrop CMS
I'm starting a social work, family help and education center in Germany (empathus-erziehungshilfen.de). I would love to work with CiviCRM to document cases and spent time for me and my employees. I tried to install backdrop CMS (as well as WP and Drupal) but I couldn't really get it to work properly. Everything within CiviCRM I can do on my own, it's only a proper installation and initial setup for CiviCRM to work as it should. I am searching for a good-hearted CiviCRM pro who would help me install it. I'll provide the SFTP login and everything that's needed. We are a non-profit organization and I don't have much money to spend but I could afford $50 for your help.

# Answer
Welcome to SE!

Have you looked at CiviCRM Spark? Just sign up and start using it.

Alternatively you can find a list of partners in Germany or globally who undertake paid work on CiviCRM.

Also, just checking you have found the installation guide
> 1 votes

---
Tags: install, backdrop, setup
---


# Question
Title: Create a report export with different field name for first and last name - e.g. First Name field would export as FirstName
Need to create an export report where First Name field is shown as FirstName and Last Name field is shown as Last Name.

Is there a simple way to rename the Field Name as part of the Export process? Or perhaps create a Custom Field (e.g. FirstName) that can be automatically filled with the value for "First Name"?

# Answer
> 2 votes
If it is about changing the column header, you can use searchkit,

1. Display the results as a Table
2. Include all the fields as the column you want in the exported file.
3. Rename the column name as per your needs.
4. Refresh the results \>\> Action \>\> Download Spreadsheet.

HTH

Pradeep

---
Tags: custom-fields, field-mapping, autocomplete
---


title: Last contribution tokens

text:
# Question
Title: Last contribution tokens
I am trying to create a rule that will notify our CEO of donations over a certain amount. In the message template I want to include info about the donation. I'm choosing the tokens for "latest contribution amount" and "latest contribution financial type" etc. but they are all blank when pulled into my email?

# Answer
Updating the Fuzion tokens extension to the latest release fixed the issue.
> 1 votes

---
Tags: tokens, civirules
---


# Question
Title: Checksum or hash not pulling up contribution pages for anonymous users in Drupal 7
This documentation https://docs.civicrm.org/user/en/latest/common-workflows/tokens-and-mail-merge/#checksum-contribution-pages shows

```
        Checksum for Contribution Pages¶
To send people to a contribution page use this path where IDNUMBER is the ID of your contribution page:

Drupal: http://example.org/civicrm/contribute/transact?reset=1&id=IDNUMBER&{contact.checksum}&cid={contact.contact_id}

```

It works when I am logged in, because it does not need the hash, but does not work for anonymous users. Other questions on StackExchange indicate Need **&cs=** before the hash, but that also does not work. (Seems really weird to have a query string without a *variablename=* as part of it.)

Examples where the domain is removed for security: Original attempt failed: .../civicrm/contribute/transact?reset=1&id=2&c8950946c952d8cdec67695d0b10cd03&cid=13299

Changed attempt failed (adding the "cs=" also makes it fail when I am logged in as admin): .../civicrm/contribute/transact?reset=1&id=2&cs=c8950946c952d8cdec67695d0b10cd03&cid=13299

Reordering the elements does not work, as I expected it would not.

# Answer
> 2 votes
It looks like you are taking the contact hash directly from the database and sticking it in the URL yourself. That won't work (and for security reasons you don't want to expose the contact hash because that doesn't change).

Instead, you want a contact checksum, which is generated from the hash. You can get a checksum by sending an email or mailing with the {contact.checksum} token in it. If you want to get one manually for whatever reason, you can use the API4 Explorer and do Contact getChecksum.

---
Tags: civicontribute, checksum, anonymous-user, contact-hash
---


# Question
Title: WYSIWYG editor disappeared in CiviCRM 4.7.16
I just upgraded to CiviCRM 4.7.16 (Wordpress 4.7.2) and my WYSIWYG editor has disappeared from the CiviMail editor. The HTML email only allows me to enter raw HTML.

Any idea what happened and how I can restore the WYSIWYG editor?

# Answer
Well, it works again through magic and voodoo. All I did was go to the Wordpress Access Control page as Christia recommended and clicked "Save". I didn't modify any settings. Just clicking "Save" seems to have reconnected everything.

http://www.YOUR-ORG.com/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fadmin%2Faccess%2Fwp-permissions&reset=1
> 3 votes

# Answer
What WYSIWYG editor are you using? IF CKEditor, reestablish roles and permissions for the CKEditor by going into the configuration settings for text editors on your CMS side and make sure it's still set as the default editor. This is what I had to do after updating to 4.7.15.

Here is a screenshot on Drupal to give you an idea of what I mean. If someone can post/edit this post with the WP version, that would be great.

For Wordpress, check this:

Also, you could check the Wordpress user roles and permission from CiviCRM under Administer \> Users and Permissions \> Permissions (Access Control). It might be different in WordPress, but I would check that first.

I know Wordpress is really different so I'm not sure how helpful this would be for you but the bottom line is to find the settings for making sure it's still default and can still be used by the intended users.
> 2 votes

# Answer
Please double-check that you don't have the (Civi-)extension CKEditor4 disabled. This was my fault, because i tried to work with CKEditor5 instead. Both activated at the same time is working fine, only CKEditor5 without 4 won't.
> 0 votes

---
Tags: civimail, ckeditor, wysiwyg
---


title: Default Contact Search Profile

text:
# Question
Title: Default Contact Search Profile
Why I cant see created profile in **Default Contact Search Profile**?

**My created profile:**

**Settings:**

# Answer
> 0 votes
Most likely your profile includes Contact sub type fields. Adding these seems to make the profile you created unavailable in the Search preference options. /civicrm/admin/setting/search?reset=1

---
Tags: search
---


# Question
Title: Stripe Payment error in multiple event registration when price amounts are different
I am finding an error in a **multiple event registration** when the fee amounts to pay are different for the different participants to the event. The Strip Payment Processor is raising the following error:

"***Stripe Payment Error**: This PaymentIntent's amount could not be updated because it has a status of requires capture. You may only update the amount of a PaymentIntent with one of the following statuses: requires\_payment\_method, requires\_confirmation, requires\_action*."

Is there anyone who can help me to fix this error?

Any help would be very much appreciated.

# Answer
> 2 votes
There has been a draft to fix issue for Multiple event registration

https://github.com/civicrm/civicrm-core/pull/24781

---
Tags: payment-processor, stripe
---


title: Where are headers stored for civimail

text:
# Question
Title: Where are headers stored for civimail
We're using Mosaico Templates for our newsletter. When the newsletter is published it comes with a legacy header that was not visible when composing the newsletter. How do I get rid of that header? I'm guessing the header is a remnant of a pre-Mosaico template that we used. I disabled a similar looking header in Administer\>Communicatons\>MessageTemplates but test versions of the Mosaico newsletter still contain the legacy header. We're using CiviCRM 5.50.3 on Joomla! 3.10.9

# Answer
> 0 votes
Have you checked under Mailings - Headers, Footer and Automated Messages? Is that the header you're seeing?

---
Tags: civimail, mosaico, header-footer
---


# Question
Title: Installing CiviCRM on a Drupal 9 site with Drush 11 conflict due to symfony/filesystem ~4.4 requirement
Currently if you install Drupal 9, Drush then CiviCRM you end up with a Composer "Problem" due to Drush requiring consolidation/site-alias (^3.1.6 || ^4) and composer picking the v4 version which then requires consolidation/site-alias 4.0.0 requires symfony/filesystem (^5.4 || ^6)

# Answer
> 2 votes
The solution here is to either install CiviCRM before drush - or if installing on an existing site or if that fails you can help composer pick the right version

via composer require civicrm/civicrm-{core,packages,drupal-8}:"5.55.1" "consolidation/site-alias:^3.1.6" -W

---
Tags: drupal-9, composer
---


# Question
Title: How to change the page title for the "Review Your Contribution" page in the WP version?
I've seen a lot of similar questions to this one, but not exactly this question. When one is directed to https://www.example.com/civicrm/contribute/transact/?\_qf\_Confirm\_display=true&qfKey=CRMContributeControllerContributionabclongstringherexyz, the page title in the shows as "CIVICRM". I tried to change this via functions.php with the\_title hook, but it replaces every title in the menu as well. Any suggestions appreciated.

# Answer
> 1 votes
Short of figuring out where the "CiviCRM" page title was coming from in the auto-generated output, I was able to set the name of the Contribution \> Confirmation page by adding a script in the footer (using the "wp\_footer" hook in the child theme's functions.php) that checks the URL for a query string value associated with the Confirmation page ("\_qf\_Confirm\_display") when the page ID is that of the Contribute / Donate page, and if that value is "true," overwrites the h1 and the document title with what I want:

```
add_action( 'wp_footer', 'change_donate_conf_title');
function change_donate_conf_title() {
    if (is_page(10911)) {
        $checkConf = $_GET['_qf_Confirm_display'];
        if ($checkConf === 'true') {
            echo "<script type='text/javascript'>
                document.title = 'Review Your Contribution';
                document.querySelector('h1').innerHTML = 'Review Your Contribution';
            </script>";
        }
    }
}

```

I hope this helps someone else down the road.

---
Tags: wordpress, contributions
---


title: Using CiviRule to delay tax receipts

text:
# Question
Title: Using CiviRule to delay tax receipts
Does anyone have any suggestions on how I could use a CiviRule to delay sending the tax receipts by email? For our gala, we need to wait until we know the exact non-deductible portion of each ticket before we send the receipt so I'd like to set up a rule to delay the automatic tax receipt email.

My alternative was to set the financial type to non-deductible for now, then go back after the event and set it to deductible and then process the receipts.

TIA!

# Answer
> 1 votes
Are you using CDN Tax Receipts extension? You can turn off automatic sending of tax receipts in Admin - CiviContribute - CDN Tax Receipts with the Attach receipts to automated workflow messages? option. Then you can process them manually whenever you like (note this applies to all contributions, so you'll need to process the tax receipts manually for all donations until you turn it back on).

If you do the non-deductible to deductible switcheroo, watch out because the non-deductible amount will be set to the full amount of the donation, so you need to make sure you set each one manually.

# Answer
> 0 votes
Do I understand correctly that the non-deductible amount of the related contribution is not filled in initially but is filled once the percentage is known?

If that is the case you could create a rule with "contribution changed" as trigger and use the "field value comparison" condition to check if the non-deductible amount is filled in?

And probably also add the contact to a group (temporary until the whole process is done) so you can check if the contact is not in the group yet (to avoid sending more times). Does that make sense?

---
Tags: civirules, cdn-tax-receipts
---


# Question
Title: Microsoft 365 depreciation of legacy authentication, emails not now coming through
Our processing inbound emails is failing as Microsoft have stopped using IMAP due to authentication security issues, (I don't understand the technicalities just that it isn't working), has anyone found a solution to this issue? I think it was on the cards for a while but we weren't aware of the implications so are now stuck. We are on 5.52.2 .

# Answer
> 0 votes
It's not that they've stopped IMAP exactly, it's that the login method can't just be username/password. You'll need to turn on OAUTH and recreate the mail account: https://docs.civicrm.org/sysadmin/en/latest/setup/oauth/#enable-the-module

---
Tags: inbound-email
---


# Question
Title: With Worpress and theme Divi some field types of profile can't work
I worked to build a form with two Autocomplete-Select fields, the one in which the description Search by name / email or id appears ..., but unfortunately now it does not work in public pages, but only in the WP dashboard. On the public side there is a theme made with Divi. Is it possible that there is incompatibility between the javascript of Divi and Civicrm? What could I try to make the profile work? I can't change the field format, they are a reference contact lists with the names of two groups

# Answer
> 2 votes
Problem solved turning off some javascripts in the Divi options. This is switch is a very good thing.

---
Tags: wordpress, profile, autocomplete
---


title: adding registrations to an event

text:
# Question
Title: adding registrations to an event
Why can't I add additional registrations and payments for a given event to a contact whose email address has already been used for that event? If someone wishes to buy more tickets for the same performance, the system will not allow it and I can't do it in the back-end either. It just says that email contact is already assigned to the event.

# Answer
> 1 votes
This is confusing in CiviCRM! If you check the same email address option on the Online Registration tab of the event configuration, it will allow multiple registrations per contact or email address.

Here are details in the User Guide. The option is confusingly named and I have made a change request to make it more clearly named (and have a little help text that you can pop up that explains it) in future versions of CiviCRM.

---
Tags: civievent, registration
---


# Question
Title: Multilanguages Support - capture name in both local language and English
I have installed CiviCRM on WordPress. What I try to do is to have different fields to store both Chinese and English names of donors, and another field to store their preference on which language to use in communications.

Following the Sys Admin Guide, I was able to install Chinese support on top of US English and activate the Multiple Languages Support option. I can switch between Chinese and English in the UI, but I couldn't find how custom fields can be created to store Chinese names and language preferences.

Can anybody shed some light?

# Answer
> 2 votes
You can set preferred language for a contact under Communications Preferences on the main tab on the contact page.

You can create custom fields to store Chinese or English names and use the regular name fields for the other language (Administer - Customize Data and Screens - Custom Fields). But it's going to be more complicated if you want to use those names in mailings depending on language setting or otherwise choose the names to use in a specific situation based on the language setting. It might help to provide some more detail on what you want to do with the names specifically.

---
Tags: custom-fields, multilingual
---


title: How do I set up an API key for a user?

text:
# Question
Title: How do I set up an API key for a user?
The current documentation for creating an API key for user is on the wiki at https://wiki.civicrm.org/confluence/display/CRMDOC/REST+interface#RESTinterface-CreatingAPIkeysforusers. Unfortunately there is not a release for the user friendly API Key extension for CiviCRM 4.5, 4.6 or 4.7. And the manual method is not very user friendly for those who are not programmers. How can a relatively non-technical user set up an API key that is needed for an extension, for example?

# Answer
Hopefully a new release will be made for the API Key extension soon. Here are detailed instructions for creating one manually without needing to get access to your database through phpMyAdmin, mysql on the command line or some similar MySQL database administration tool.

Usually it is a good idea to create a special separate contact for each service that needs to use CiviCRM's REST API. Do this at Contact \> New Individual, enter a name like Attentive.ly Service, and click Save. At the bottom of your page in small faint type and in the url you can get the Contact ID of the new contact.

Create a 16 character random value for the API Key, eg at http://passwordsgenerator.net/ with settings that exclude special characters, eg

Now use your CiviCRM installation's API explorer to set the API key for your user. Navigate to Support \> Developer \> Api Explorer v4. Enter the following and click Execute:

For those wanting to use APIv3, navigate to Support \> Developer \> Api v3 (/civicrm/api3#explorer), and enter the following values then click on the Execute button. Note that the image shows Internal Contact ID as the fieldname. This is true CiviCRM up to version 4.6, but you'll need to select the Contact ID for versions 4.7 and above since it was relabeled in the API Explorer.

You will need to ensure that the contact is given a role that has the appropriate permissions required for the relevant Extension. At a minimum this will include 'Access AJAX API', and unless otherwise specified, 'Administer CiviCRM'.
> 20 votes

# Answer
You need to use the extension which creates an 'API Key' tab on the contact record.

https://github.com/cividesk/com.cividesk.apikey/archive/v1.0.zip

JMC
> 3 votes

# Answer
To add an API key to an existing contact in API Explorer v4:

1. navigate to Support \> Developer \> API Explorer v4.
2. In the "entity" drop-down menu select "contact", in the "action" drop-down select "update".
3. In the "where" section select "id" from the "add clause" drop-down and make that equal to the contact id of the contact that you wish to add the API key to.
4. In the "values" section select api\_key from the "add value" drop-down and add your desired API key to the box that appears next to it.
5. click the execute button.
> 2 votes

---
Tags: api, extension, security, rest
---


# Question
Title: Extensions require database update, Not able to use Mailing,
I'm on the latest versions of Drupal (9.4.8) and CiviCRM (5.55.1) and I'm using Composer to install/update.

Although consulting data from CiviCRM is working fine, I do have a couple of issues:

* extensions require database update
* not able to use Mailings (traditional nor Mosaico)
* displaying status (civicrm/a#/status)
* event registration

They all result in 'unexpected error, try again later' (in Dutch)

I enabled debugging and get this:

Message DB Error: no such field Mode 16 UserInfo UPDATE civicrm\_queue SET status = NULL WHERE name = 'ext-upgrade' \[nativecode=1054 \** Unknown column 'status' in 'field list'\] DebugInfo UPDATE civicrm\_queue SET status = NULL WHERE name = 'ext-upgrade' \[nativecode=1054 \** Unknown column 'status' in 'field list'\] PEAR\_Exception: DB Error: no such field in /data/sites/web/instituutvlaamsevolkskunstbe/cms-install/4466-instituut-voor-vlaamse-volkskunst/production/vendor/pear/pear-core-minimal/src/PEAR.php on line 944

* DB\_Error: DB Error: no such field in unknown on line unknown

I have been looking for ConfigAndLogs, but I cannot find it in the location where it should be.

Any help would be greatly appreciated. Let me know what information is needed (and where to find it) to get this diagnosed and solved.

Thanks, Stefaan

# Answer
> 4 votes
Can you run CiviCRM upgrade to check if there are any updates required? You can do

```
cv upgrade:db

or

drush civicrm-upgrade-db

or

from UI  http://example.org/civicrm/upgrade?reset=1

```

If there isn't any updates needed probably running below mysql queries may help

```
ALTER TABLE civicrm_queue
 ADD COLUMN `status` varchar(16) NULL DEFAULT 'active' COMMENT 'Execution status',
 ADD COLUMN `error` varchar(16) NULL COMMENT 'Fallback behavior for unhandled errors',
 ADD COLUMN `is_template` tinyint NOT NULL DEFAULT 0 COMMENT 'Is this a template configuration (for use by other/future queues)?';

```

---
Tags: drupal, extension, database
---


# Question
Title: Is it possible to suppress email notifications when transferring an event registration as an administrator?
I noticed that is possible to transfer an event registration from one participant to another - perfect for what I needed at that moment as an administrator.

And it worked perfectly, apart from the fact that - with no warning and certainly no apparent option for me as an admin to affect the behaviour - Civi appeared to fire off two email notifications, one to the old participant and one to the new, alerting them to the change.

As a consequence of this seemingly uncontrollable, and despite the fact that this transfer tool would be really useful for me, I can't use it because I don't want it spitting out email to my participants. How can I turn off the email notifications?

# Answer
> 2 votes
Civi will send emails to both participants notifying them about the changes. I believe the user should be notified as it would be against their consent if the registration is moved. But in some use cases if the registrations are added by a staff member without sending a notification about the registration then it is okay to not send an email notification. Since Civi won't understand the difference unless there is a flag that would differentiate and restrict allow users from sending.

You may need to implement altermailparams hook and abort sending. Alternatively, you can cancel the current registration manually by updating the participant and creating a new registration with some reference in the source or participant notes field.

HTH

Pradeep

---
Tags: civievent
---


title: prevent / ban a member from renewing

text:
# Question
Title: prevent / ban a member from renewing
Is it possible to flag a contact who has been banned from renewing their membership?

This is on a wordpress site that uses the Members Sync to automatically assign users to roles. I thought about creating using a "banned" role but they would also be in an Alumni group automatically which I suspect would trump this if trying to use the ACL.

# Answer
> 1 votes
Set their existing membership type with a status of cancelled and use a permanent override.

# Answer
> 1 votes
I, too, thought what Andy suggested should work, but if it doesn't on your end, you could try this extension: https://civicrm.org/extensions/membership-extra-restrict-signup-and-renewal-membership-include-exclude-search

Full disclosure: I've never used this extension, but have been eyeing it as we think we might have a good use for it. In your case, you could use the group option for restricting.

---
Tags: civimember
---


# Question
Title: Issue with Permissions inside cache folder
I am having problems with the permissions of the cache folder. Once I reset the permissions to Nobody everything works just fine but when a new cache file is created it uses the root user and certain CiviCRM pages do not load because of that (ex. the contact search). Is there a way to define or force the user to be "nobody"?

Thank you in advance.

# Answer
Is your webserver running as user 'nobody'? You have something running as root that is causing the cache to be rebuilt - like using `cv` as root. Are your cron scheduled jobs running as root?

You have two basic approaches: either get everything that causes a rebuild to run as the webserver user ('nobody'), or arrange for all the users to have access to the cache directory.

One option for doing that is using Linux file ACL's with setfacl. You can look at how `buildkit` uses `setfacl` for an example, but there's nothing Civi-specific.

Something like this should ensure your webserver user has access to the cache files:

```
$ setfacl -R -m d:u:nobody:rwX,u:nobody:rwX cache_dir

```
> 0 votes

---
Tags: wordpress
---


# Question
Title: continue button missing for free event registration
If I configure a free event the online registration page has a "continue" button after the registration fields.

However if I have a paid event with a free (ie $0.00) price, when the $0.00 price is selected the payment (paypal) block disappears but no "continue" button displays?

civi 4.7.10 wordpress 4.6

# Answer
> 1 votes
This is definitely an issue with how PayPal express - payment processor works in civicrm, if you have multiple options on the event and the customer chooses to pay nothing and only opts for free part of the event. the continue button disappears as well paypal express button goes away, I've been using paypal standard instead to get around the issue.

# Answer
> 0 votes
I am answering this because the problem remains at least up to 5.48.2.

I have worked around the problem by adding the following code as an HTML block in the profile used on that page. It runs a function every three seconds that checks to see if the page value is $ 0.00 and if it is unsets the "display: none" value that has been given to the continue button.

```
<script>
      function myFunction () {
        var node = document.getElementById('pricevalue');
        var nodetext = node.innerText;
        if (nodetext == "$ 0.00") {
            document.getElementById("_qf_Register_upload-bottom").style.display = ""
        }
      }
      setInterval(myFunction, 3000);
</script>

```

---
Tags: wordpress, civievent
---


# Question
Title: Event registration's 'Continue' button disappears when Payment Processor is changed
I have an online registration with a donation-based registration fee (zero to any amount is accepted).

Everything works great until I change the Payment Processor of the event registration. When I change it, the continue button of the registration form disappears as long as there is no donation amount entered, which then does not allow the user to register without donating anything.

I've set up 2 completely identical events, besides their Payment Processor to demonstrate the issue:

The good one: https://terranova.tamera.org/en/civicrm/event/register?reset=1&id=1945

The missing button one: https://terranova.tamera.org/en/civicrm/event/register?reset=1&id=1946

Another thing to mention, is that the 2 Payment Processors are completely identical except for the PayPal's 'Pay' button image url, and their name.

My question is, what makes the continue button disappear in the 2nd one?

# Answer
> 1 votes
The missing button is there - it just has display set to none. It looks like there is a bunch of javascript on the page that hides various things, then reshows them - but I'm guessing behaves differently for different payment processors.

The issue looks to be the javascript is using .prop to reshow the element.

```
      $('.crm-submit-buttons input').prop('disabled', false);

```

This function was added to jQuery in 1.6 but it looks like you are using jQuery 1.4.4. If you are able to use a more recent version of jQuery you should hopefully see the missing button load. There are a number of solutions documented here:

To easily update your jquery you can use this module to check if it resolves the issue. https://www.drupal.org/project/jquery\_update

# Answer
> 0 votes
This is still an issue, im sure subject matter experts at Civi would know how to solve the issue: more information in post continue button missing for free event registration

continue button missing for free event registration

# Answer
> 0 votes
I am answering this because the problem remains at least up to 5.48.2.

I have worked around the problem by adding the following code as an HTML block in the profile used on that page. It runs a function every three seconds that checks to see if the page value is $ 0.00, and if it is, unsets the "display: none" value that has been given to the continue button.

```
<script>
      function myFunction () {
        var node = document.getElementById('pricevalue');
        var nodetext = node.innerText;
        if (nodetext == "$ 0.00") {
            document.getElementById("_qf_Register_upload-bottom").style.display = ""
        }
      }
      setInterval(myFunction, 3000);
</script>

```

---
Tags: civievent, online-registration
---


title: Extend CiviCRM template in Extension

text:
# Question
Title: Extend CiviCRM template in Extension
I am trying to extend the MembershipView.tpl which look like the image below. I have created an extension and added a MembershipView.extra.tpl file to my extension folder and placed it in Template\>CRM\>Membership\>Form but the contents I have placed inside wont show in the membership view template.

Contents of my MembershipView.extra.tpl

```
{literal}
<script type='text/javascript'>
alert(5);
</script>
{/literal}
testing this text here

```

Thanking you

Imran

# Answer
Not sure if it's a path problem or anything else, but in case of, it seems that CiviCRM manages only one `.extra.tpl` file per template. If another extension adds an extra template, it can override yours.

In this case, this answer works fine: https://civicrm.stackexchange.com/a/33603/5794
> 1 votes

---
Tags: civimember, extension, templates, custom-templates
---


title: Composer install civicrm/cv

text:
# Question
Title: Composer install civicrm/cv
Dears,

I installed CV using composer require civicrm/cv but when I run a command SSH says 'cv: command not found'.

What did I forget ?

Stefaan

# Answer
http://www.linfo.org/path\_env\_var.html. If that doesn't help then search the internet for more explanations about what the unix PATH variable is, e.g. https://www.google.com/search?q=what+is+the+PATH+in+unix

But I'd also consider just downloading cv and then putting it somewhere that's already in your PATH, possibly /usr/local/bin.

You can also just specify the full path, e.g. /path/to/your/site/vendor/civicrm/cv/bin/cv (or whereever it ended up getting installed).
> 0 votes

---
Tags: cv
---


# Question
Title: Cleaning up legacy contributions so that renewals happen as expected
We have a site that has some legacy membership records with associated contributions that were imported manually (before our time, with a previous provider). We are experiencing problems where these legacy memberships do not renew as expected (new memberships that were set up since that time are working fine).

We went through a round of clean up fixes about two years ago and memberships started to renew as expected but they recently stopped working again after an upgrade.

Our assumption is that CiviCRM has changed the way that it does membership processing again and that it is now relying on a characteristic of the membership and its associated records that we did not address in our initial round of fixes.

We have come across different flavours of this problem on different sites in the past and I am sure lots of you have too. I am aware that there have been different ways of doing the processing and that it might change again in the future. We are keen to do a comprehensive clean up this time and I thought it would be worth getting some thoughts on how to proceed.

Our strategy is to compare DB records for succesful renewals with unsuccessful ones and to all identify differences, and then write scripts to bring them into line as appropriate.

So my first question is **What tables should we be looking in?**

* `civicrm_membership`
* `civicrm_membership_payment`
* `civicrm_contribution`
* `civicrm_contribution_recur`

Seem like obvious candidates. So does `civicrm_line_item` though I am less clear about what we should be looking at in that table and how it connects to memberships and contributions. **Are there relevant columns in `civicrm_line_item`?**

**Are there other tables I should be looking in?**

The following tables seem unlikely to be relevant but I add them here just in case and am happy to be corrected.

* `civicrm_financial_item`
* `civicrm_financial_trxn`
* `civicrm_entity_financial_trxn`

Once we know all of the tables,

**Are there specific ways I should be joining tables when doing the comparison?** e.g. the first or last in a set of contributions related to a contribution recur?

What about template contributions? I am not sure if they are relevant in this case as there are no contributions with `is_template = 1` but feel free to address this point in your answer :)

**Any thoughts on the approach we are taking, and your experiences with / suggestions for alternative approaches are very welcome**.

Finally, and in case it is relevant, the payment processor we are dealing with here is GoCardless.

Thanks all!

# Answer
> 4 votes
This is not a fun task, but at least I made a tool to make it pretty.

If you install Uh-Oh troubleshooting extension it includes a diagnosis page at **Support » Map Contributions** which lets you specify contacts, contributions, recurs, and memberships, and it will graph the links as shown here. It's not GoCardless specific. It's helped me identify a problem with non-renewing memberships.

It shows how all the tables (*yes, line items are vital to membership*) that are related to a recurring membership, and you can check that they're wired up correctly.

## Example

Here is a wrong un':

We can see here that most of the contributions' line items relate to the contribution table, not to the membership table. This means they're not right.

After some fixing of the SQL data, it looks like this:

Note how now the line items all know they're for memberships, and have a direct yellow arrow to the membership. This is now correct.

The tool is very useful for (a) documenting before and after fixes with the table IDs, and (b) learning how everything joins up.

On a job I had, I used SQL like the following to fix one category of tangles, but I only include this as an example: **Don't run this SQL on your data!** It contains hard coded IDs that won't be right for your use case. Here I correct the line items that belong to membership contributions, but are themselves linked directly to `civicrm_contribution` instead of `civicrm_membership`. I have to change the table, the `entity_id` and the `price_field_value_id` and `price_field_id` \- the price field ones must be for the membership type in question.

Without those all correct, membership renewal won't work.

```

UPDATE civicrm_contribution cn
   INNER JOIN civicrm_contribution_recur cr ON cn.contribution_recur_id = cr.id
   INNER JOIN civicrm_membership m ON m.contribution_recur_id = cr.id
   INNER JOIN civicrm_line_item li ON li.contribution_id = cn.id
SET li.entity_table = 'civicrm_membership',
li.entity_id = m.id,
li.price_field_value_id = CASE m.membership_type_id WHEN 1 THEN 2 WHEN 2 THEN 17 WHEN 3 ThEN 8 WHEN 4 THEN 9 else null END,
li.price_field_id = CASE m.membership_type_id WHEN 1 THEN 2 WHEN 2 THEN 10 WHEN 3 ThEN 5 WHEN 4 THEN 5 else null END,
li.membership_num_terms = 1                                                                                WHERE li.entity_table = 'civicrm_contribution'
;

```

A final tip, one that's caught me out before is: A membership has a field that points to the (singular) *current* ContributionRecur record. Over time, it's possible that multiple recurs have paid for a membership, and this can lead to trouble when the membership points to the completed recur, not the current recur.

I couldn't fix everything by SQL, as I recall, I think I ended up writing some PHP scripts to do the more tricky things.

Backing up all the tables you're going to touch before and after each programmatic change is highly recommended.

## Edit: what's the correct wiring up for a membership?

I think this:

* Contributions (CN) that are part of a recurring contribution (CR) need to point to them: `cn.contribution_recur_id = cr.id`
* A Membership (M) should be linked to a recurring contribution (CR) : `m.contribution_recur_id = cr.id`
    + Note: if a membership has been paid my more than one CR, e.g. because one CR completed/failed/finished and was replaced by a new one, then the old CR will not be referred to by the membership as it will be pointing at the new CR (via the `M.contribution_recur_id` field)
* A Contribution that pays for a membership should have
    + a Line Item (LI): `li.entity_id = m.id with li.entity_table = 'civicrm_membership'`
        - The Line Item must point to a Price field `price_field_id` and value `price_field_value_id` *for the correct Membership type*
    + an entry in the memberships-payments link table (this is slated for deprecation but is still used as of 5.49 at least). This is shown by the dashed line in the 2nd diagram.
* M, CR, CN records all point to a contact via `contact_id`, obvs.

---
Tags: civimember, recurring-contributions, auto-renew, renewals
---