# Question
Title: Trying to update versions - DB Upgrade error at 5.48.x
I have been trying to update versions, and have been hitting errors

I have stepped back and step through versions and the issue appears at 5.48.x update

UPDATE civicrm\_queue SET runner = "task" WHERE is\_autorun = 1 \[nativecode=1054 \** Unknown column 'is\_autorun' in 'where clause'\]

I have searched but not found a similar issue. How can I get past this?

```
Error: Convert "is_autorun" to "runner"]

```

Error Field Error Value Type DB\_Error Code -19 Message DB Error: no such field Mode 16 UserInfo UPDATE civicrm\_queue SET runner = "task" WHERE is\_autorun = 1 \[nativecode=1054 \** Unknown column 'is\_autorun' in 'where clause'\] DebugInfo UPDATE civicrm\_queue SET runner = "task" WHERE is\_autorun = 1 \[nativecode=1054 \** Unknown column 'is\_autorun' in 'where clause'\] PEAR\_Exception: DB Error: no such field in /var/www/html/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php on line 922

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

# Function Location

0 CRM\_Core\_Error::exceptionHandler(Object(DB\_Error)) /var/www/html/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php:922 1 PEAR\_Error-\>\__construct('DB Error: no suc…', -19, 16, Array, 'UPDATE civicrm\_q…') /var/www/html/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB.php:997 2 DB\_Error-\>\__construct(-19, 16, Array, 'UPDATE civicrm\_q…') /var/www/html/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php:575 3 PEAR::\_raiseError(Object(DB\_mysqli), null, -19, 16, Array, 'UPDATE civicrm\_q…', 'DB\_Error', true) /var/www/html/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php:223 4 PEAR-\>\__call('raiseError', Array) /var/www/html/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/common.php:1928 5 DB\_common-\>raiseError(-19, null, null, 'UPDATE civicrm\_q…', '1054 \** Unknown …') /var/www/html/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/mysqli.php:936 6 DB\_mysqli-\>mysqliRaiseError() /var/www/html/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/mysqli.php:406 7 DB\_mysqli-\>simpleQuery('UPDATE civicrm\_q…') /var/www/html/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/common.php:1234 8 DB\_common-\>query('UPDATE civicrm\_q…') /var/www/html/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php:2696 9 DB\_DataObject-\>\_query('UPDATE civicrm\_q…') /var/www/html/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php:1829 10 DB\_DataObject-\>query('UPDATE civicrm\_q…') /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php:468 11 CRM\_Core\_DAO-\>query('UPDATE civicrm\_q…', true) /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php:1633 12 CRM\_Core\_DAO::executeQuery('UPDATE civicrm\_q…') /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Upgrade/Incremental/php/FiveFortyEight.php:107 13 CRM\_Upgrade\_Incremental\_php\_FiveFortyEight::convertAutorun(Object(CRM\_Queue\_TaskContext)) /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Queue/Task.php:73 14 CRM\_Queue\_Task-\>run(Object(CRM\_Queue\_TaskContext)) /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Queue/Runner.php:215 15 CRM\_Queue\_Runner-\>runNext(true) /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Queue/Page/AJAX.php:36 16 CRM\_Queue\_Page\_AJAX::{closure}() /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Queue/ErrorPolicy.php:89 17 CRM\_Queue\_ErrorPolicy-\>call(Object(Closure)) /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Queue/Page/AJAX.php:38 18 CRM\_Queue\_Page\_AJAX::runNext() /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:285 19 CRM\_Core\_Invoke::runItem(Array) /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:69 20 CRM\_Core\_Invoke::\_invoke(Array) /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:36 21 CRM\_Core\_Invoke::invoke(Array) /var/www/html/wp-content/plugins/civicrm/civicrm.php:1199 22 CiviCRM\_For\_WordPress-\>invoke('') /var/www/html/wp-includes/class-wp-hook.php:307 23 WP\_Hook-\>apply\_filters('', Array) /var/www/html/wp-includes/class-wp-hook.php:331 24 WP\_Hook-\>do\_action(Array) /var/www/html/wp-includes/plugin.php:476 25 do\_action('toplevel\_page\_Ci…') /var/www/html/wp-admin/admin.php:259

# Answer
This can happen if you try to re-run through the 5.48 part of the import and didn't do a **complete drop** of the database before restoring from backup.

This might be the same as Error updating to civicrm 5.50.3 / Drupal 7.9

See also https://lab.civicrm.org/dev/core/-/issues/3504
> 0 votes

---
Tags: upgrade
---


# Question
Title: Installation failed: DB Error:connect failed
I'd appreciate any hint on how to fix this: wordpress installed, civicrm installation fails with Initialization Error code 24 DB Error: connect failed. Access denied for user 'user'@'localhost'

wordpress successfully uses the same database and user, therefore i can't figure out why access is denied for civicrm installer at some point (database has entries for civicrm, but installation is not completed. thanks

# Answer
I'm wondering if this is due to the authentication method that is not set to native password. See https://mariadb.com/kb/en/authentication-plugin-unix-socket/

Try this:

```
ALTER USER 'YOUR_CIVI_DB_USER_NAME'@'localhost' IDENTIFIED WITH mysql_native_password BY 'PASSWORD_OF_THE_CIVI_DB_USER';

```
> 2 votes

---
Tags: installation
---


# Question
Title: I want to hide the Price Set on the Event Information Page. I want it to display only on the Registration Page
We use CiviEvent to promote our on-line lectures. The lectures are free but we encourage donations. I created a Price Set with suggested donation amounts. CiviCRM has automatically added the Price Set to the bottom of the Event information page. I don't want the suggested donation amounts to show on the main Event information page. It should be visible only after the user clicks Register Now. (CiviCRM 5.48.0. on Wordpress Version 6.0.1)

# Answer
You can hide them using custom styling in wordpress

```
div.crm-event-info-form-block .event_fees-section {
  display: none;
}

```
> 1 votes

---
Tags: civievent, price-sets, donations
---


title: Where can I get 5.45.7 security release

text:
# Question
Title: Where can I get 5.45.7 security release
5.45.0 was released on 2022-01-05. The latest patch revision is 5.45.7 (2022-06-02).

Where can I get 5.45.7 I cant find it anywhere

# Answer
Isn't it an ESR after 5.45.3? See also this
> 1 votes

---
Tags: lts
---


# Question
Title: Event Error - civi_flexmailer_required_tokens
Everytime I try to make an event, or access any page with event information, I get the following error:

`You have requested a non-existent service "civi_flexmailer_required_tokens".`

Using latest Civi 5, Wordpress 4.9

# Answer
I had this problem after upgrading from Drupal 8 to 9 and upgrading Civi to 5.51.1. Thanks to @seamuslee on Mattermost for solving this issue for me. These are the steps I followed on a Drupal installation to fix it:

1. Disable Mosaico in Extensions
2. Disable Flexmailer in Extensions
3. Delete the Flexmailer extension directory (`/sites/default/files/civicrm/ext/org.civicrm.flexmailer`)
4. Clear Civi caches and rebuild paths/menus at `/civicrm/admin/setting/updateConfigBackend?reset=1`
5. Enable Flexmailer in Extensions
6. Enable Mosaico in Extensions

This issue is also answered at CiviCRM core now includes Flexmailer: how to remove old flexmailer extension?
> 5 votes

# Answer
we have similar issue but after clearing civicrm cache using menu/rebuild it started working.
> 6 votes

# Answer
We were seeing the same problem after upgrade to CiviCRM 5.0.2. This is a detail follow-up on Sunil's answer above (*sorry, didn't have enough reputation points to comment on his directly and thought this would be useful.*)...

The URL to clear the CiviCRM Cache is:

http://example.org/wp-admin/admin.php?page=CiviCRM&q=civicrm/menu/rebuild&reset=1
> 2 votes

# Answer
Still figuring this out - but disabling Event Calendar (com.osseed.eventcalendar) fixed the issue.

Update: Cleaned up Cache - error persisted, Cleaned up cache and rebuilt CiviCRM menu - re-enabled com.oosseed.eventcalendar - all good to go.
> 0 votes

---
Tags: civievent, civimail
---


# Question
Title: Error "Incorrect datetime value" during upgrade to version 5.5.1
I recently updated from a 2011 installation of CiviCRM 3.4.2 and Drupal 6, to Drupal 7 with CiviCRM 4.6.34.

Today I tried to upgrade from CiviCRM 4.6.34 to 5.5.1, and everything went well until 4.7.19, when I get the error inserted below.

My PHP and MySQL versions:

```
$ php --version
PHP 7.0.18-0ubuntu0.16.04.1 (cli) ( NTS )
$ mysql --version
mysql  Ver 14.14 Distrib 5.7.18, for Linux (x86_64) using  EditLine wrapper

```

I found this article which might have some clues I am just not sure how to interpret it. Maybe someone else has experienced the same error?

---

## Error message

```
CiviCRM Upgrade Tasks
[Error: Upgrade DB to 4.7.19: SQL]
Error Field Error Value
Type  DB_Error
Code  -1
Message DB Error: unknown error
Mode  16
UserInfo  UPDATE civicrm_financial_trxn SET trxn_date = NULL WHERE trxn_date = '0000-00-00 00:00:00' [nativecode=1292 ** Incorrect datetime value: '0000-00-00 00:00:00' for column 'trxn_date' at row 1]
DebugInfo UPDATE civicrm_financial_trxn SET trxn_date = NULL WHERE trxn_date = '0000-00-00 00:00:00' [nativecode=1292 ** Incorrect datetime value: '0000-00-00 00:00:00' for column 'trxn_date' at row 1]

PEAR_Exception: DB Error: unknown error in /var/www/public/drupal7/sites/all/modules/civicrm/packages/PEAR.php on line 921
- DB_Error: DB Error: unknown error in unknown on line unknown
Exception trace
# Function  Location
0 CRM_Core_Error::exceptionHandler(Object(DB_Error))  /var/www/public/drupal7/sites/all/modules/civicrm/packages/PEAR.php:921
1 PEAR_Error->__construct('DB Error: unknow…', -1, 16, Array, 'UPDATE civicrm_f…')  /var/www/public/drupal7/sites/all/modules/civicrm/packages/DB.php:984
2 DB_Error->__construct(-1, 16, Array, 'UPDATE civicrm_f…') /var/www/public/drupal7/sites/all/modules/civicrm/packages/PEAR.php:575
3 PEAR->_raiseError(Object(DB_mysqli), null, -1, 16, Array, 'UPDATE civicrm_f…', 'DB_Error', true)  /var/www/public/drupal7/sites/all/modules/civicrm/packages/PEAR.php:223
4 PEAR->__call('raiseError', Array) /var/www/public/drupal7/sites/all/modules/civicrm/packages/DB/common.php:1907
5 DB_common->raiseError(-1, null, null, 'UPDATE civicrm_f…', '1292 ** Incorrec…') /var/www/public/drupal7/sites/all/modules/civicrm/packages/DB/mysqli.php:933
6 DB_mysqli->mysqliRaiseError() /var/www/public/drupal7/sites/all/modules/civicrm/packages/DB/mysqli.php:403
7 DB_mysqli->simpleQuery('UPDATE civicrm_f…') /var/www/public/drupal7/sites/all/modules/civicrm/packages/DB/common.php:1216
8 DB_common->query('UPDATE civicrm_f…') /var/www/public/drupal7/sites/all/modules/civicrm/CRM/Utils/File.php:366
9 CRM_Utils_File::runSqlQuery('mysql://root:roo…', '-- CRM-19715 SEL…', null) /var/www/public/drupal7/sites/all/modules/civicrm/CRM/Upgrade/Form.php:177
10  CRM_Upgrade_Form->source('-- CRM-19715 SEL…', true) /var/www/public/drupal7/sites/all/modules/civicrm/CRM/Upgrade/Form.php:372
11  CRM_Upgrade_Form->processLocales('/var/www/public/…', '4.7.19') /var/www/public/drupal7/sites/all/modules/civicrm/CRM/Upgrade/Form.php:406
12  CRM_Upgrade_Form->processSQL('4.7.19')  /var/www/public/drupal7/sites/all/modules/civicrm/CRM/Upgrade/Incremental/Base.php:80
13  CRM_Upgrade_Incremental_Base::runSql(Object(CRM_Queue_TaskContext), '4.7.19') /var/www/public/drupal7/sites/all/modules/civicrm/CRM/Queue/Task.php:88
14  CRM_Queue_Task->run(Object(CRM_Queue_TaskContext))  /var/www/public/drupal7/sites/all/modules/civicrm/CRM/Queue/Runner.php:214
15  CRM_Queue_Runner->runNext(true) /var/www/public/drupal7/sites/all/modules/civicrm/CRM/Queue/Page/AJAX.php:52
16  CRM_Queue_Page_AJAX::{closure}()  /var/www/public/drupal7/sites/all/modules/civicrm/CRM/Queue/ErrorPolicy.php:106
17  CRM_Queue_ErrorPolicy->call(Object(Closure))  /var/www/public/drupal7/sites/all/modules/civicrm/CRM/Queue/Page/AJAX.php:54
18  CRM_Queue_Page_AJAX::runNext()  /var/www/public/drupal7/sites/all/modules/civicrm/CRM/Core/Invoke.php:275
19  CRM_Core_Invoke::runItem(Array) /var/www/public/drupal7/sites/all/modules/civicrm/CRM/Core/Invoke.php:84
20  CRM_Core_Invoke::_invoke(Array) /var/www/public/drupal7/sites/all/modules/civicrm/CRM/Core/Invoke.php:52
21  CRM_Core_Invoke::invoke(Array)  /var/www/public/drupal7/sites/all/modules/civicrm/drupal/civicrm.module:445
22  civicrm_invoke('upgrade', 'queue', 'ajax', 'runNext') /var/www/public/drupal7/includes/menu.inc:527
23  menu_execute_active_handler() /var/www/public/drupal7/index.php:21
24  {main}

```

# Answer
Yes that link you posted has the answer in #4. The easiest thing to do would be to remove those values from the sql\_mode setting, i.e. in mysql run this command

SELECT @@GLOBAL.sql\_mode;

Then it will output some string. Remove any reference to STRICT\_TRANS\_TABLES, NO\_ZERO\_DATE, and NO\_ZERO\_IN\_DATE from that string. Then whatever is left you would assign that to sql\_mode in your my.cnf file:

sql\_mode="whatever is left from the string"

Then restart mysql.

FYI this would change the behavior of other databases on your server too, if you have any.
> 3 votes

# Answer
I came across a similar issue during an upgrade from CiviCRM 5.29 to 5.51.

I took the approach of fixing the incorrect datetime values rather than changing the MySQL configuration to ignore incorrect dates.

The following SQL query should set the incorrect dates to `NULL`:

```
UPDATE civicrm_financial_trxn SET created_date=NULL WHERE created_date=0;

```

Note that you have to use `WHERE created_date=0` not `WHERE created_date='0000-00-00 00:00:00'`.
> 1 votes

---
Tags: mysql-5.7
---


# Question
Title: Get or generate a contact checksum via API?
Is there a way to view or generate a Contact's checksum via the REST API?

I'm looking to use the checksum to provide relevant form links, etc., but need to get it programmatically on a Contact basis. Any and all insight is appreciated. Thanks!

# Answer
> 11 votes
I have never seen the checksum available in the API.

I have successfully obtained it programmatically though with code similar to:

```
$cs = CRM_Contact_BAO_Contact_Utils::generateChecksum($contact_id);

```

(This snippet is adapted from core code in CRM/Utils/Token.php)

# Answer
> 9 votes
I'm pretty certain you can't get a checksum from the standard API. However, you should write (or commission) an extension to provide a checksum API. The API would basically be a wrapper around the code that DaveD suggested, and you can read documentation here on how to use Civix to generate an API in your extension.

# Answer
> 5 votes
I needed this exact functionality, so I wrote the extension that provides it, com.megaphonetech.checksums. I used Coleman's comment above as my spec :)

# Answer
> 1 votes
Now with API4 there is `\Civi\Api4\Contact::getChecksum()` and `\Civi\Api4\Contact::validateChecksum()` available.

---
Tags: api, contacts, rest, checksum
---


# Question
Title: Which Extension Adds: Event terms and conditions
I installed an extension at some point that apparently adds a section called Event terms and conditions - I am not sure what extension that is.

It might be the GDPR extension, but I have that disabled, can someone confirm?

# Answer
It is GDPR - look in uk.co.vedaconsulting.gdpr/xml/CustomGroupData.xml.

Not all extensions disable their custom fields when the extension is disabled. Whether they should or not needs to be looked at on a case-by-base basis, but generally yes they do. I can see in the code this one doesn't - don't know if it's intentional.
> 3 votes

---
Tags: civievent, extension
---


# Question
Title: Is CiviCRM 5.51.1 compatable with Joomla 4.1.5?
Joomla is now requiring an upgrade from Joomla 3x to Joomla 4x. 3x will no longer be supported. I'm trying to gather all the infomation possible before I attempt this upgrade. I am currently running CiviCRM 5.51.1.

# Answer
According to https://lab.civicrm.org/dev/joomla/-/milestones/1#tab-issues it looks like most issues have been dealt with.

You might also get more info in the joomla channel at https://chat.civicrm.org
> 1 votes

---
Tags: joomla
---


# Question
Title: How to send an email using a template from within extension (from code)
How can I send an email using an email template that is already saved (id=68) from within the extension I am working on?

# Answer
```
civicrm_api3('MessageTemplate', 'send', array(
  'id' => 68,
  ... other params - see api explorer ...
));

```
> 0 votes

---
Tags: wordpress, extension, email
---


# Question
Title: How to show by default Contributions Tab in Contact Summary Page?
If I want to access to a Contact Summary Page, I go to url:

```
http://<my_site>/civicrm/contact/view?reset=1&cid=<contact_id>

```

Is there any parameter I can add to url (or other way) where I can access to this Contact Summary Page but showing the Contributions Tab by default?

# Answer
I've found the parameter to set to url to show Contributions Tab by default (**force=1** & **selectedChild=contribute**):

```
http://<my_site>/civicrm/contact/view?reset=1&cid=<contact_id>&force=1&selectedChild=contribute

```
> 3 votes

# Answer
With the most recent changes it's actually a lot easier. None of the solutions above worked for my situation (when someone clicks on a Contact they wanted Contributions tab to just appear).

With a little custom extension you can do this fairly easy

```
function wecancustom_civicrm_pageRun(&$page) {
  $pageName = get_class($page);

  // Switch the tab to Contributions
  if ($pageName == 'CRM_Contact_Page_View_Summary') {
    CRM_Core_Resources::singleton()
    ->addSetting([
      'tabSettings' => ['active' => CRM_Utils_Request::retrieve('selectedChild', 'contribute')],
    ]);
  }
}

```

This overrides the default. In our case, I did a bit more processing to determine if it was the proper Contact type we wanted with Apiv4.
> 2 votes

# Answer
I don't think CiviCRM allows this out of the box, but you can achieve this by following the below steps using JavaScript:

1. Using JavaScript check to see if the page url have '/civicrm/contact/view?reset=1&cid='
2. Then set below two attributes in
3. to true:

`aria-selected="true"
 aria-expanded="true"` Where `id = tab_contribute`

Example:

`<li id="tab_contribute" class="crm-tab-button ui-corner-all livePage ui-tabs-tab ui-corner-top ui-state-default ui-tab ui-tabs-active ui-state-active crm-count-1" role="tab" tabindex="0" aria-controls="ui-id-23" aria-labelledby="ui-id-22" aria-selected="true" aria-expanded="true">`

If your CMS is drupal, you can use JS Injector module to include javascript which provides functionality to run JS on specific pages.

Let me know if you need more help.
> 1 votes

---
Tags: civicontribute, contacts
---


# Question
Title: Event Confirmation Window - Formatting Issue: Text not wrapping
In our current event confirmation page, there is a text formatting issue (does not wrap) that I've not been able to resolve. Is there a simple fix for this?

# Answer
I'm no Joomla expert, but part of the problem is that you have some very long names for your custom fields. One way round this would be to use much shorter names for the fields and add more detail about the information you are asking for in the field pre help in the profile you are using for the event registration.
> 1 votes

# Answer
I'm guessing the CSS property `white-space` is set to "nowrap" on the label. If not that, some other CSS class or property is messing that up. If you can share the URL, I can take a look at your site, and give you a more precise answer :) As Mick Kahn pointed out, you could consider shortening the labels, and placing the longer text into field pre or post help.
> 1 votes

---
Tags: civievent, joomla, confirmation, textarea
---


# Question
Title: Guzzle conflict between CiviCRM and Community Builder (Joomla)?
my Community Builder registration process seems to have started failing since I updated CiviCRM recently.

Fatal error: Cannot redeclare GuzzleHttp\describe\_type() (previously declared in \[DOCROOT\]/libraries/CBLib/GuzzleHttp/functions.php:14) in \[DOCROOT\]/administrator/components/com\_civicrm/civicrm/vendor/guzzlehttp/guzzle/src/functions.php on line 41

I guess there are two versions of GuzzleHttp conflicting but I'm not sure how I go about resolving this. This maybe isn't specifically a CiviCRM problem, but I'd very much appreciate some guidance on how to troubleshoot this!

Joomla 3.10.10 CiviCRM 5.50.2 Community Builder 2.7.3

Thanks!

# Answer
> 1 votes
These links are for drupal and wordpress but it's the same type of problem. There isn't a good solution available though.

In this specific case, my guess is that community builder is using guzzle 7 (the source code for community builder doesn't seem available online to check???). If that's true, then since civi supports guzzle 7 but just ships with guzzle 6, what you can try is go into the civicrm plugin folder and run `composer require guzzlehttp/guzzle:'^7'` so that they end up with the same version. If something goes wrong just `composer require guzzlehttp/guzzle:'^6.3'` to restore the old guzzle for civi.

---
Tags: joomla, registration
---


# Question
Title: Cannot add new contributions anymore - DB Error: no such field
We are running CiviCRM 5.42.1 on Wordpress. We had no issues with adding contributions up until a week ago. We've not updated Civi recently - last update was more than 5 or 6 months ago. I get an error when adding a contribution for any contact on the system. I select contribution -\> New Contribution. Fill in the form, click on Save and get this error (first part of the error shown before the full exception trace). As such, we cannot record donations to our org anymore. Urgently need some help/suggestions on to resolve.

Type DB\_Error Code -19 Message DB Error: no such field Mode 16 UserInfo INSERT INTO `civicrm_contact_push_notification_messages` (`contact_id` , `data` , `entity_table` , `entity_id` , `invoke_contact_id` ) VALUES ( 6287 , '{"entity":"Activity","id":20448,"body":"%display\_name has created activity."}' , 'Activity' , 20448 , 203 ) \[nativecode=1054 \** Unknown column 'message' in 'NEW'\] DebugInfo INSERT INTO `civicrm_contact_push_notification_messages` (`contact_id` , `data` , `entity_table` , `entity_id` , `invoke_contact_id` ) VALUES ( 6287 , '{"entity":"Activity","id":20448,"body":"%display\_name has created activity."}' , 'Activity' , 20448 , 203 ) \[nativecode=1054 \** Unknown column 'message' in 'NEW'\] PEAR\_Exception: DB Error: no such field in /home/iskcon/www/www/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php on line 922

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

# Answer
Civimobile just had a release where the message column was removed. I suspect the extension on your site was updated. Are you using advanced logging (administer - system settings - misc - logging)? If so, then the logging tables/triggers might be out of date. You can fix by running `cv flush -T` or if you can get into the UI then `civicrm/menu/rebuild?reset=1&triggerRebuild=1`
> 1 votes

---
Tags: civicontribute, database
---


title: Isssues upgrading to civiCRM 5.52

text:
# Question
Title: Isssues upgrading to civiCRM 5.52
I am ready to upgrade to version 5.52. Has anyone run into any problems upgrading to version 5.52?

# Answer
> 1 votes
5.53 hasn't been released yet and is beta right now, but it's available and you're welcome to test it: https://download.civicrm.org/latest.

If you're looking for how many people are running a version, there are some stats here: http://stats.civicrm.org/?tab=technology. They aren't perfect, and don't show test sites, but give you some idea.

---
Tags: upgrade
---


# Question
Title: Sending an Email Invoice and have client pay directly via invoice email
I am wondering whether it is possible for CIVICRM to send an email 'pending invoice' to contributors and have them pay directly through the invoice. Is this possible?

# Answer
I'd use a schedule reminder under 'Parameter \>\> Communication', you can choose 'Contribution' as a trigger.

For the payment this will depend on your choice, but in both cases you can send a message with a custom link (with cid & checksum) to your front-end form or your contribution page that would we have connected to a payment gateway such as Stripe or Paypal.
> 1 votes

# Answer
Assuming you have invoicing enabled, you can find your pending contributions (**Contributions menu » Find Contributions**), select them all, then choose **Invoices - print or email** from the **Actions** menu.

You may want to check out my altinvoice extension - I don't actively develop it but it will allow linking directly to the user's dashboard to facilitate payment.
> 1 votes

# Answer
I have found this little module to be quite helpful: https://civicrm.org/extensions/invoice-helper

It will generate a payment link that you can add to each email that you're sending out. Yes, it's manual, but it saves you some time.
> 1 votes

---
Tags: civicontribute, payment, invoice
---


# Question
Title: Network Error - TypeError: Argument 1 passed to CRM_Financial_BAO_Order::setPriceSetID() must be of the type integer, null given
we're on Drupal 7.x and CiviCRM 5.52.2. We recently did a rather large upgrade and also upgraded to the iATS 1.7.4 CiviCRM Extension.

On certain contribution tabs on contact records, we're getting a "Network Error". Upon further investigation we're seeing the PHP error in Drupal log:

```
TypeError: Argument 1 passed to CRM_Financial_BAO_Order::setPriceSetID() must be of the type integer, null given, called in sites/all/modules/civicrm/CRM/Financial/BAO/Order.php on line 910 in CRM_Financial_BAO_Order->setPriceSetID() (line 471 of /sites/all/modules/civicrm/CRM/Financial/BAO/Order.php)

```

Any clue what might be missing/incorrect in the records in the table? Appreciate the help. Can post more info if needed.

Edit, looks like this might be a duplicate of https://lab.civicrm.org/dev/core/-/issues/3150

Edit2: Looks like this patch resolved my issue https://patch-diff.githubusercontent.com/raw/civicrm/civicrm-core/pull/23087.patch

from here: https://github.com/civicrm/civicrm-core/pull/23087

# Answer
> 0 votes
Looks like this patch resolved my issue https://patch-diff.githubusercontent.com/raw/civicrm/civicrm-core/pull/23087.patch

from here: https://github.com/civicrm/civicrm-core/pull/23087

---
Tags: civicontribute
---


# Question
Title: is it possible to use composer with a Joomla-installed CiviCRM instance?
I have an extension version conflict problem on my Joomla site, for which the recommended solution is to change the civicrm dependencies via composer (Guzzle conflict between CiviCRM and Community Builder (Joomla)?).

However, this CiviCRM was installed via the Joomla plugin system, and has never been managed by composer. So essentially, I don't know how to implement the solution :-)

Composer is installed on the server where CiviCRM resides. Is it possible to set up composer to manage the Civicrm instance after-the-fact, so I can change these dependencies? I can't find any documentation on how to do this (all the documentation I'm finding re: CiviCRM and composer are for Drupal).

Help appreciated, thanks.

# Answer
> 0 votes
There's no documentation because it's not really something you would normally do. I admit I don't know how joomla works - in the download file it looks like it might end up in com\_civicrm/admin/civicrm? You're looking for a file named `composer.json`. Then using the command line in that same folder, you'd type `composer require guzzlehttp/guzzle:'^7'`

---
Tags: joomla, composer
---


# Question
Title: Finished execution of Membership status processor with result: Failure, Error message: Invalid data value given
Drupal 7.x and CiviCRM 5.52.2

Full error:

> Aug 09 10:19:30 \[debug\] $Query = INSERT INTO `civicrm_job_log` (`domain_id` , `job_id` , `name` , `command` , `description` , `data` ) VALUES ( 1 , 11 , 'Membership status processor' , 'Entity: Job Action: process\_membership' , 'Finished execution of Membership status processor with result: Failure, Error message: Invalid data value given. Be sure it matches the required data type and format. Value at civicrm\_line\_item(): .' , '\n\nParameters parsed (and passed to API method): \na:1:{s:7:"version";i:3;}\n\nFull message: \nFinished execution of Membership status processor with result: Failure, Error message: Invalid data value given. Be sure it matches the required data type and format. Value at civicrm\_line\_item(): .' )

When looking at the CiviCRM.sql\_log this was the full error. Any tips about how I could continue to debug?

ConfigAndLog has warnings such as the following when the job is attempted

```
127409  Aug 09 12:05:32 [warning] hook_civicrm_alter_drupal_entities should be updated to pass an array of parameter names to CRM_Utils_Hook::invoke(). Caller: ::_civicrm_enabled_entity_alter_whitelist
127402  Aug 09 12:05:32 [warning] hook_civicrm_entity_supported_info should be updated to pass an array of parameter names to CRM_Utils_Hook::invoke(). Caller: ::civicrm_entity_get_supported_entity_info
127395  Aug 09 12:05:32 [warning] hook_civicrm_alter_drupal_entities should be updated to pass an array of parameter names to CRM_Utils_Hook::invoke(). Caller: ::_civicrm_enabled_entity_alter_whitelist
127388  Aug 09 12:05:32 [warning] hook_civicrm_entity_supported_info should be updated to pass an array of parameter names to CRM_Utils_Hook::invoke(). Caller: ::civicrm_entity_get_supported_entity_info
127381  Aug 09 12:05:32 [warning] hook_civicrm_alter_drupal_entities should be updated to pass an array of parameter names to CRM_Utils_Hook::invoke(). Caller: ::_civicrm_enabled_entity_alter_whitelist
127374  Aug 09 12:05:32 [warning] hook_civicrm_entity_supported_info should be updated to pass an array of parameter names to CRM_Utils_Hook::invoke(). Caller: ::civicrm_entity_get_supported_entity_info
127367  Aug 09 12:05:32 [warning] hook_civicrm_alter_drupal_entities should be updated to pass an array of parameter names to CRM_Utils_Hook::invoke(). Caller: ::_civicrm_enabled_entity_alter_whitelist
127360  Aug 09 12:05:32 [warning] hook_civicrm_entity_supported_info should be updated to pass an array of parameter names to CRM_Utils_Hook::invoke(). Caller: ::civicrm_entity_get_supported_entity_info
127353  Aug 09 12:05:32 [warning] hook_civicrm_alter_drupal_entities should be updated to pass an array of parameter names to CRM_Utils_Hook::invoke(). Caller: ::_civicrm_enabled_entity_alter_whitelist
127346  Aug 09 12:05:32 [warning] hook_civicrm_entity_supported_info should be updated to pass an array of parameter names to CRM_Utils_Hook::invoke(). Caller: ::civicrm_entity_get_supported_entity_info
127339  Aug 09 12:05:31 [warning] hook_civicrm_alter_drupal_entities should be updated to pass an array of parameter names to CRM_Utils_Hook::invoke(). Caller: ::_civicrm_enabled_entity_alter_whitelist
127332  Aug 09 12:05:31 [warning] hook_civicrm_entity_supported_info should be updated to pass an array of parameter names to CRM_Utils_Hook::invoke(). Caller: ::civicrm_entity_get_supported_entity_info
127325  Aug 09 12:05:31 [warning] hook_civicrm_alter_drupal_entities should be updated to pass an array of parameter names to CRM_Utils_Hook::invoke(). Caller: ::_civicrm_enabled_entity_alter_whitelist
127318  Aug 09 12:05:31 [warning] hook_civicrm_entity_supported_info should be updated to pass an array of parameter names to CRM_Utils_Hook::invoke(). Caller: ::civicrm_entity_get_supported_entity_info
127311  Aug 09 12:05:31 [warning] hook_civicrm_alter_drupal_entities should be updated to pass an array of parameter names to CRM_Utils_Hook::invoke(). Caller: ::_civicrm_enabled_entity_alter_whitelist
127304  Aug 09 12:05:31 [warning] hook_civicrm_entity_supported_info should be updated to pass an array of parameter names to CRM_Utils_Hook::invoke(). Caller: ::civicrm_entity_get_supported_entity_info
127297  Aug 09 12:05:31 [warning] hook_civicrm_alter_drupal_entities should be updated to pass an array of parameter names to CRM_Utils_Hook::invoke(). Caller: ::_civicrm_enabled_entity_alter_whitelist
127290  Aug 09 12:05:31 [warning] hook_civicrm_entity_supported_info should be updated to pass an array of parameter names to CRM_Utils_Hook::invoke(). Caller: ::civicrm_entity_get_supported_entity_info

```

# Answer
> 1 votes
The installed version of https://www.drupal.org/project/civicrm\_entity was out of date. I solved the issue by upgrading the module to civicrm\_entity 7.x-2.4

---
Tags: civimember, scheduled-job
---


# Question
Title: Is it easy to upgrade CiviCRM using drush?
The standard upgrade process for CiviCRM is quite a complex process according to the instructions in the wiki.

Is it easier to use drush to upgrade CiviCRM? If so, how do you do this? I couldn't find any up to date documentation on this, so if you are able to point me in the right direction that would be greatly appreciated.

Thanks for your help.

# Answer
To answer my own question, it is possible to update CiviCRM with drush but this isn't completely straightforward either. For the benefit of others I post the steps I took below.

These steps must be executed in the root directory of Drupal:

1. put the site into maintenance mode: `drush vset maintenance_mode 1`
2. clear all caches: `drush cc all`
3. take a full backup of site and test that this works on a development server
4. upgrade CiviCRM: `drush cvup --tarfile=<path to tarfile> --backup-dir=<path to backup dir>`
5. upload the latest version of the localisation files and extract to `sites/all/modules/civicrm/l10n`
6. delete contents of `sites/default/files/civicrm/templates_c/`
7. take the site out of maintenance mode:`drush vset maintenance_mode 0`
8. clear all caches: `drush cc all`

Notes:

* I was upgrading from CiviCRM 4.6.6 to 4.6.7. If you are upgrading from an older version you may find that there are more steps.
* The first time I tried to upgrade at step 4 this resulted in an error `'Your database has already been upgraded to CiviCRM 4.6.6'` (note that I was trying to upgrade to 4.6.7). Repeating this step resulted in success. This bug appears to have been fixed.
* It may be easier to manually delete and replace the `civicrm` folder as Laryn suggests.
* I'm not sure if step 6 is really necessary.
> 17 votes

# Answer
You can get a list of Civi-related Drush commands simply by typing `drush` on the command line. Excerpt:

```
All commands in civicrm: (civicrm)
civicrm-api (cvapi)         CLI access to CiviCRM APIs. It can return pretty-printor json formatted data.
civicrm-enable-debug        Enable CiviCRM Debugging.
civicrm-ext-disable (ced)   Disable a CiviCRM extension.
civicrm-ext-install (cei)   Install a CiviCRM extension.
civicrm-ext-list (cel)      List of CiviCRM extensions enabled.
civicrm-ext-uninstall (ceui)Uninstall a CiviCRM extension.
civicrm-install             Install a new instance of CiviCRM.
civicrm-member-records      Run the CiviMember UpdateMembershipRecord cron (civicrm-member-records).
civicrm-process-mail-queue  Process pending CiviMail mailing jobs.
civicrm-rest (cvr)          Rest interface for accessing CiviCRM APIs. It can return xml or json formatted data.
civicrm-restore             Restore CiviCRM codebase and database back from the specified backup directory.
civicrm-sql-cli (cvsqlc)    Open a SQL command-line interface using CiviCRM's credentials.
civicrm-sql-conf            Print CiviCRM database connection details.
civicrm-sql-connect         A string for connecting to the CiviCRM DB.
civicrm-sql-dump            Exports the CiviCRM DB as SQL using mysqldump.
civicrm-sql-query           Execute a query against the CiviCRM database.
civicrm-update-cfg (cvupcfg)Update config_backend to correct config settings, especially when the CiviCRM site has been cloned / migrated.
civicrm-upgrade (cvup)      Replace CiviCRM codebase with new specified tarfile and upgrade database by executing the CiviCRM upgrade process - civicrm/upgrade?reset=1.
civicrm-upgrade-db (cvupdb) Execute the civicrm/upgrade?reset=1 process from the command line.

```

Personally I usually download the tarfile manually, replace the `civicrm` directory in the modules folder (backing up as needed, e.g. `drush civicrm-sql-dump > ~/filename.sql`) and then use `drush cvupdb` to run the database upgrade.

Practice on a dev server first, though! :)
> 9 votes

# Answer
another helpful thing that I do when using drush for civi upgrades: since drush does not give you any information about where in the process the upgrade is (the GUI has the progress bar that says what version it is at) I open another ssh session to the server and use `drush civicrm-sql-cli` to get into the sql console with the right database. Then as the upgrade runs in one terminal I repeatedly run the following query to follow the progress -- especially in upgrades that span multiple versions:

```
select version from civicrm_domain;

```
> 2 votes

# Answer
I use the following for Drupal 7 which I find a straightforward process:

(I do this on a development copy of the site first to check for issues)

1. cd public\_html/sites/all/modules // go to modules folder for site
2. wget https://download.civicrm.org/latest/civicrm-STABLE-drupal.tar.gz //get latest
3. drush vset maintenance\_mode 1 //put site into maintenance\_mode
4. rm -rf civicrm //delete civi (make sure you are logged in!)
5. tar -xvzf civicrm-STABLE-drupal.tar.gz //extract Civi
6. rm civicrm-STABLE-drupal.tar.gz //delete tarball
7. cv upgrade:db //upgrade civi db or use drush civicrm-upgrade-db
8. cv flush //flush system files
9. drush vset maintenance\_mode 0 //put site online

I know you asked for Drush commands but I thought I would add my process as it may be helpful to others. It uses a mixture of drush and cv. cv is a Civi command line utility like drush and is easy to install. If you can install drush you can certainly install cv. Get it from https://github.com/civicrm/cv.
> 2 votes

# Answer
we have our own shell script for both Drupal and Wordpress that automatize everything and takes less than 10" to upgrade CiviCRM. It was inspired amongst other sources by this post.

The script has been developed for Plesk but it's easy to modify: see on our Github
> 1 votes

---
Tags: drupal, upgrade, drush
---


# Question
Title: Update CiviCRM with composer fails during patching: "Cannot apply patch Allow single quotes to be used in return path"
Currently on CiviCRM 5.51.1 with Drupal 9.4.3 and PHP 8.0. I wanted to update CiviCRM but no matter if I try to update to 5.51.3 or 5.52 - I get the composer error:

```
 Applying patches for zetacomponents/mail
    https://raw.githubusercontent.com/civicrm/civicrm-core/9d93748a36c7c5d44422911db1c98fb2f7067b34/tools/scripts/composer/patches/civicrm-custom-patches-zetacompoents-mail.patch (CiviCRM Custom Patches for ZetaCompoents mail)
    https://github.com/zetacomponents/Mail/pull/86.patch (Allow single quotes to be used in return path)
   Could not apply patch! Skipping. The error was: Cannot apply patch https://github.com/zetacomponents/Mail/pull/86.patch

In Patches.php line 326:

  Cannot apply patch Allow single quotes to be used in return path (https://g
  ithub.com/zetacomponents/Mail/pull/86.patch)!

```

This is the composer.json with which I run composer update:

```
{
    "name": "abgeordnetenwatch/civicrm",
    "description": "This composer.json is based on the composer.json of drupal-composer/drupal-project and meets the needs of our CiviCRM installaion",
    "type": "project",
    "license": "GPL-2.0-or-later",
    "authors": [
        {
            "name": "Tobias Krause",
            "role": "Lead developer",
            "email": "krause@abgeordnetenwatch.de"
        }
    ],
    "repositories": [
        {
            "type": "composer",
            "url": "https://packages.drupal.org/8"
        }
    ],
    "require": {
        "php": ">=7.3",
        "civicrm/civicrm-asset-plugin": "~1.0",
        "civicrm/civicrm-core": "^5.50.0",
        "civicrm/civicrm-drupal-8": "^5.50.0",
        "civicrm/civicrm-packages": "^5.50.0",
        "civicrm/cv": "^0.3.20",
        "composer/installers": "^1.9",
        "cweagans/composer-patches": "^1.7",
        "drupal/admin_toolbar": "^3.0",
        "drupal/civicrm_drush": "^1.2",
        "drupal/config_split": "^2.0",
        "drupal/core-composer-scaffold": "^9.4",
        "drupal/core-recommended": "^9.4",
        "drupal/smtp": "^1.0",
        "drush/drush": "^10.6",
        "vlucas/phpdotenv": "^5.1",
        "webflo/drupal-finder": "^1.2"
    },
    "require-dev": {
        "drupal/core-dev": "^9.4",
        "drupal/devel": "^4.0"
    },
    "conflict": {
        "drupal/drupal": "*"
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "config": {
        "discard-changes": true,
        "sort-packages": true,
        "allow-plugins": {
            "composer/installers": true,
            "cweagans/composer-patches": true,
            "drupal/core-composer-scaffold": true,
            "dealerdirect/phpcodesniffer-composer-installer": true,
            "civicrm/composer-compile-plugin": true,
            "civicrm/composer-downloads-plugin": true,
            "civicrm/civicrm-asset-plugin": true
        }
    },
    "autoload": {
        "classmap": [
            "scripts/composer/ScriptHandler.php"
        ],
        "files": ["httpdocs/load.environment.php"]
    },
    "scripts": {
        "pre-install-cmd": [
            "DrupalProject\\composer\\ScriptHandler::checkComposerVersion"
        ],
        "pre-update-cmd": [
            "DrupalProject\\composer\\ScriptHandler::checkComposerVersion"
        ],
        "post-install-cmd": [
            "DrupalProject\\composer\\ScriptHandler::createRequiredFiles"
        ],
        "post-update-cmd": [
            "DrupalProject\\composer\\ScriptHandler::createRequiredFiles"
        ]
    },
    "extra": {
        "composer-exit-on-patch-failure": true,
        "patchLevel": {
            "drupal/core": "-p2"
        },
        "drupal-scaffold": {
            "locations": {
                "web-root": "httpdocs/"
            },
            "file-mapping": {
                "[web-root]/robots.txt": false,
                "[web-root]/sites/development.services.yml": false,
                "[web-root]/INSTALL.txt": false,
                "[web-root]/README.txt": false,
                "[web-root]/example.gitignore": false,
                "[web-root]/.htaccess": false,
                "[web-root]/sites/default/settings.php": false
            }
        },
        "installer-paths": {
            "httpdocs/core": ["type:drupal-core"],
            "httpdocs/libraries/{$name}": ["type:drupal-library"],
            "httpdocs/modules/contrib/{$name}": ["type:drupal-module"],
            "httpdocs/profiles/contrib/{$name}": ["type:drupal-profile"],
            "httpdocs/themes/contrib/{$name}": ["type:drupal-theme"],
            "drush/Commands/{$name}": ["type:drupal-drush"]
        },
        "patches": {
        },
        "civicrm-asset": {
            "path": "httpdocs/libraries/civicrm",
            "url": "/libraries/civicrm",
            "assets:core": {
                "include": ["js/**", "css/**", "ang/**", "templates/**.png", "templates/**.jpg", "ext/ckeditor4/js/ck-options.json"],
                "exclude-dir": [".git", "/CRM"]
            }
        },
        "enable-patching": "true",
        "compile-whitelist": ["civicrm/civicrm-core", "civicrm/composer-compile-lib"]
    }
}

```

One week ago I just used the same composer.json with composer update without any problems.

# Answer
> 2 votes
Yes there were patches being applied for php 8.1 compatibility but they are now in the original package so the patches aren't needed anymore.

See https://github.com/civicrm/civicrm-core/pull/24198

---
Tags: upgrade, composer
---


# Question
Title: CiviMail SendGrid with Airmail Extension
I've had to switch away from CiviSMTP as they've gone under and I'm trying to set up an alternative. SparkPost failed as reported by others as well. I'm now trying to get SendGrid to work. I'm using it in conjunction with the Airmail Extension.

On the SMTP setup page (/civicrm/admin/setting/smtp?reset=1) test emails work fine. But neither CiviMail nor sending email via contact action are working.

With CiviMail it completes the mailing and reports 0 deliveries. All the recipients bounce with "syntax" error.

At SendGrid I've set up the webhook and tested it and it passes the test.

Any ideas.

I'm having a vague recollection that I need to allow email headers somewhere but I can't find the setting (if that is even the issue). My client needs to send out a 13K email soon so any help would be much appreciated.

I'm using:

* CiviCRM 5.51.2
* Airmail 2.1
* Drupal 7.91
* php 7.4.3
* Mysql 8.0.30-0ubuntu0.20.04.2

# Answer
If it's a mail-header issue, it might be about adding the Message-ID header, which you can configure at the "CiviMail Component Settings"

/civicrm/admin/setting/preferences/mailing?reset=1

That checkbox is off by default but should probably be on at this point. The box is labelled "Enable CiviMail to generate Message-ID header".

Does gmail/google now demand a messageId?
> 1 votes

# Answer
I was a dummy and installed https://lab.civicrm.org/extensions/sendgrid and it works. I am also considering switching to SparkPost (assuming I can get it to work) or AWS.
> 0 votes

---
Tags: civimail, smtp
---


# Question
Title: Error on membership fee token when using Print/Merge Document
I did a short test on the demo sandbox.

Selected "Find Membership" and selected one record. I then choose Print/Merge Document and added 2 tokens, {membership.id} and {membership.fee} Then clicked "Preview" to see the pdf outcome.

If I use only the token {membership.id} I do not get any error message and the preview is created.

Adding {membership.fee} I get the following error message below.

Is this effectively a bug or am I doing something wrong? Thanks for your feedback.

The website encountered an unexpected error. Please try again later. TypeError: Return value of CRM\_Utils\_Money::formatUSLocaleNumericRounded() must be of the type string, null returned in CRM\_Utils\_Money::formatUSLocaleNumericRounded() (line 207 of /srv/buildkit/build/d9-master/vendor/civicrm/civicrm-core/CRM/Utils/Money.php).

CRM\_Utils\_Money::formatUSLocaleNumericRounded() (Line: 249) CRM\_Utils\_Money::formatLocaleNumericRoundedByPrecision() (Line: 234) CRM\_Utils\_Money::formatLocaleNumericRoundedByCurrency() (Line: 281) CRM\_Utils\_Money::formatLocaleNumericRoundedForDefaultCurrency() (Line: 65) CRM\_Member\_Tokens-\>evaluateToken() (Line: 146) Civi\Token\AbstractTokenSubscriber-\>evaluateTokens() (Line: 264) Symfony\Component\EventDispatcher\EventDispatcher-\>doDispatch() (Line: 239) Symfony\Component\EventDispatcher\EventDispatcher-\>callListeners() (Line: 73) Symfony\Component\EventDispatcher\EventDispatcher-\>dispatch() (Line: 209) Civi\Core\CiviEventDispatcher-\>dispatch() (Line: 354) Civi\Token\TokenProcessor-\>evaluate() (Line: 64) CRM\_Core\_TokenSmarty::render() (Line: 349) CRM\_Core\_BAO\_MessageTemplate::renderTemplateRaw() (Line: 271) CRM\_Core\_BAO\_MessageTemplate::renderTemplate() (Line: 131) CRM\_Member\_Form\_Task\_PDFLetter-\>generateHTML() (Line: 98) CRM\_Member\_Form\_Task\_PDFLetter-\>postProcessMembers() (Line: 75) CRM\_Member\_Form\_Task\_PDFLetter-\>postProcess() (Line: 573) CRM\_Core\_Form-\>mainProcess() (Line: 56) CRM\_Core\_QuickForm\_Action\_Submit-\>perform() (Line: 203) HTML\_QuickForm\_Controller-\>handle() (Line: 103) HTML\_QuickForm\_Page-\>handle() (Line: 355) CRM\_Core\_Controller-\>run() (Line: 319) CRM\_Core\_Invoke::runItem() (Line: 69) CRM\_Core\_Invoke::\_invoke() (Line: 36) CRM\_Core\_Invoke::invoke() (Line: 88) Drupal\civicrm\Civicrm-\>invoke() (Line: 80) Drupal\civicrm\Controller\CivicrmController-\>main() call\_user\_func\_array() (Line: 123) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-\>Drupal\Core\EventSubscriber{closure}() (Line: 564) Drupal\Core\Render\Renderer-\>executeInRenderContext() (Line: 124) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-\>wrapControllerExecutionInRenderContext() (Line: 97) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-\>Drupal\Core\EventSubscriber{closure}() (Line: 158) Symfony\Component\HttpKernel\HttpKernel-\>handleRaw() (Line: 80) Symfony\Component\HttpKernel\HttpKernel-\>handle() (Line: 58) Drupal\Core\StackMiddleware\Session-\>handle() (Line: 48) Drupal\Core\StackMiddleware\KernelPreHandle-\>handle() (Line: 106) Drupal\page\_cache\StackMiddleware\PageCache-\>pass() (Line: 85) Drupal\page\_cache\StackMiddleware\PageCache-\>handle() (Line: 48) Drupal\Core\StackMiddleware\ReverseProxyMiddleware-\>handle() (Line: 51) Drupal\Core\StackMiddleware\NegotiationMiddleware-\>handle() (Line: 23) Stack\StackedHttpKernel-\>handle() (Line: 709) Drupal\Core\DrupalKernel-\>handle() (Line: 19)

# Answer
> 0 votes
This seems like a bug and I can reproduce it on https://dmaster.demo.civicrm.org. Can you file a bug report at https://lab.civicrm.org/groups/dev/-/issues?

It looks like the problem is here, where it can't find the type: https://github.com/civicrm/civicrm-core/blob/639e58b05319f32a29b09eace7d00e9609cb86e4/CRM/Member/Tokens.php#L64

---
Tags: core
---


# Question
Title: How to use G Suite / GMail as your CiviMail Provider
After receiving some clarity on CiviMail settings and using a ton of guides - we were able to setup GSuite / GMail as our email provider. The answer to how we implemented it is below. If others have feedback - please chime in.

# Answer
**Setting up GSuite/Gmail as your CiviMail Provider.**

**Decide if Gmail/G Suite is right for you.** The limits for GSuite users is 2000 sent messages sent per rolling 24 hour period. Regular @gmail.com users are limited to 500 sent messages per rolling 24 hour period. If you are an organization with less than 1000 email list contacts and you have Gsuite - this may be a good option for you - assuming you only send 1 email blast every 24 hours - to not exceed limits. If you are a regular Gmail user - this would only be a good option if you have less than 400 contacts that receive emails - and I would stagger your email blasts to maybe 100/hour. This would still leave you with 100 emails for regular communication and activity emails. Using the SMTP relay service - limits expand significantly - however - I have not tested the reported 10,000 emails per rolling 24 hours limit for SMTP-Relay.

**Create two accounts in Gsuite/GMail**, one that will be used as a bounce account and another that will be an email to activity account.

**Follow these instructions** on how to setup gmail as your email provider in CiviCRM. Same instructions apply for the bounce account except you will use the bounce email and select Used For Bounce Processing. You will need to allow access to less secure apps - if you use 2FA - you will need to setup an app password.

**Setup your from email.** If you are not using SMTP Relay - it must match the same email address you have in Gmail - or the Gmail server may reject your email. If you are using SMTP Relay - you should be able to add multiple from addresses as long as they are real email addresses that share your same domain. Meaning if your smtp relay is selma@wonky.org, the only other emails you can use as from are @wonky.org. You would not be able to use a @gmail.com address.

**Follow these instructions on how to configure your outbound email service.** While the doc recommends using mail() - I found the best experience to be using the IMAP settings in your GSuite/GMail account - however - if you are a GSuite user - I highly recommend you use the SMTP-Relay service. Follow these instructions to setup your GSuite account for SMTP Relay \- Comprehensive email storage is recommended for best deliverability - but we have not noticed much of a difference. Then use the following settings for your outbound mail settings.

* Server: ssl://smtp-relay.gmail.com
* Port: 465
* Authentication: Yes
* SMTP Username: complete email
* SMTP Password: password

**Setup Cron & Mailer Settings**

* We setup our mail cron to send batches every 15 minutes - we also limited batches to 250 contacts (Mailer Batch Limit). (Administer - CiviMail - Mailer Settings) We have also sent email without the mailer batch limit with success. We will be testing limits further and will update this answer.

I hope you found this guide useful - let me know if I should clear anything up or add anything else.

Do you use Gsuite as your outbound email in CiviCRM? If so - chime in with your thoughts!
> 4 votes

# Answer
## A) question about "reply-to" field

To those who successfully use smtp-relay.gmail.com in civicrm : when you send a Civimail mailing, what "reply-to" field do you get ? I would expect it to be something like `myReplyAdress+r.XXXXXX@mydomain.org` so that when a user replies to the email, civicrm can figure it out. After a lot of tests, the "reply-to" is always the same as the "From" address, which is not the expected behaviour I guess. I have of course ticked the "VERP" box in civimail config.

Below are details about my issue with smtp-relay.gmail.com I think I have configured everything as described above (sadly, I found this post after a lot of try & fail error)

## B) SMTP relay service configuration on Google workspace

allowed senders : only addresses in my domain authentication : only accept mail from one specific email address require smtp authentication : yes require TLS encryption : yes

## C) Civicrm SMTP configuration

Serveur : ssl://smtp-relay.gmail.com Port : 465 Authentication : yes user and password : those of a Google Workspace user (let's call it `postmaster@mydomain.org`) Clicking on the "save and test" button works fine, I receive the test email

## D) Civimail results :

I have prepared a mailing. "From" address : `sender_1@mydomain.org` (which is also an existing account in google workspace).

I have also tried using `sender_2@mydomain.org` (which is **NOT** and existing account in google workspace.

Before launching the mailing, I try to send a test email, let's say `someone@outlook.com` (of course, to a real email I own)

It does not work.

Pop up message in civicrm (translating from French) says :

*Unable to identify recipients. Maybe your test group is empty or you tried to send to contacts that don't exist and you don't have permission to add contacts.* Of course, launching the mailing fails completly also : result is 100% bounce

## E) Workaround

I have found a workaround, which is bad from my point of view, and don't want to use : in Google Workspace SMTP relay configuration, configure "allowed senders = any address (not recommanded)" By doing this, almost everything works fine : various recipients receive the mailing (still need to fix DMARC configuration to pass through spam filters)

## F) Can you help ?

I'm stuck with no more idea to explore. What about you who successfully made this work?

Are there any logs somewhere (in civicrm or google workspace) that I can rely on to understand the problem ?

The only probable difference with your setup is that the MX of my domain points to Microsoft 365, NOT to google workspace (we use microsoft 365 for "user" email, and here I am trying to use Google workspace mainly for the SMTP relay feature). I think this should not matter : the incoming email configuration (MX) has nothing to do with outgoing SMTP configuration.
> 1 votes

# Answer
Allow me to reactivate this very usefull post. I am trying to use smtp-relay.gmail.com for outbound emails, without success.

Before explaining the problem, let me share a solution I found to an issue I read above : when using smtp.gmail.com (**not** the relay), it seems that the "From" address must be the same as the account used for smtp authentication. In fact I found a workaround : in the gmail settings of that user, `add another email adresses` allowed to send emails from that account. If in civicrm you have 2 **"From"** adress (sender1@domain.org and sender2@domain.org) then simply add them in gmail settings. Once done, emails sent by civimail have a "From" address corresponding the civimail parameters, instead of the smtp account used for authentication
> 0 votes

---
Tags: civimail, email, mailing, mailserver, g-suite
---


# Question
Title: How to re-process failed recurring contributions after updating card info?
With the current "fast" expiration of credit cards, and the rampant infiltration of card number theft in the US, card information is constantly being updated. Unfortunately, it generally happens only after a recurring gift has failed. We've got the new card info entered using the process as posted here:

Editing Recurring Contributions without user login

However, this does not re-process the current month's transaction that just failed and triggered the, currently manual, process of getting the card info updated. How are others updating the card information and then re-attempting to process the current month's giving?

It seems like a simple "if the card has been updated and is recurring and has failed in the past 30 days, then rerun the contribution attempt." However, simple logic and actual programming are worlds apart.

CiviCRM 4.7, Wordpress, Authorize.net

# Answer
> 1 votes
Payment processors handle failed installments differently - currently, Authorize.net will not attempt to re-process a failed installment, but other payment processors might. Also, updates to credit card information can occur proactively without having missed an installment, so the re-process action should be user driven and separate from the card update action (the latest version of the iATS extension allows for the ability to process a contribution for the card on file specifically for this scenario). We have a bit of custom code that allows you to to link a one-time credit card transaction to the recurring contribution ID - it works exactly the same way as linking a contribution to an online contribution page under the "Additional Details" section of the record contribution screen (i.e. there is a select box that will show the recurring contributions based on the contact for whom the contribution is being recorded, by selecting an option from the list, it includes the recurring contribution ID in the values inserted into civicrm\_contribution upon clicking "Save").

Hope this helps, Tamar

# Answer
> 2 votes
This option may be what you're looking for:

https://account.authorize.net/help/Tools/Automated\_Recurring\_Billing/Automatic\_Retry.htm

---
Tags: wordpress, civicontribute, 4.7, recurring-contributions, authorize.net
---


# Question
Title: How can I stop blank invoices being sent out with confirmation emails for non-paid events?
Currently running Civi 5.49.1 but I've been seeing this behaviour for a little while now. I've got Civi set up to apply VAT (sales tax) and issue invoices, which go out with event registration confirmation emails. All good.

What used to happen as far as I can recall is that if the event was free, then no invoice was created or sent. Ideal.

However what I'm seeing is that participants are being sent confirmation emails with an attached file called 'invoice.pdf' which is blank. Not good.

Before I log this as an issue in Gitlab, is there a recent change in the settings/config around invoicing that I'm missing, or is this a bug that others are seeing?

# Answer
This has been fixed now with this https://github.com/civicrm/civicrm-core/pull/24065
> 0 votes

---
Tags: civicontribute, invoice
---


# Question
Title: Dangerous to force a binary collation on civicrm_contact.external_identifier?
We're trying to get External Identifier working for an external system that uses case-sensitive IDs (such that external contact "abc123" John Smith is distinct from external contact "ABC123" Alice Brown).

By design, CiviCRM treats External Identifier as case-insensitive, and then it requires that External Identifier be unique across contacts; it also uses External Identifier as an identifying key on contact import; and probably other things I'm not thinking of at the moment.

We could, in mysql, alter the external\_identifier column to use a case-sensitive collation such as `utf8mb4_unicode_bin` in order to achieve case-sensitivity in the unique index, and to provide case-sensitive matching in `WHERE` clauses on that column.

What kind of a can of worms would we be opening here? Are there likely to be pathways in CiviCRM's PHP execution that would break outright on such changes?

# Answer
My experiments with setting external\_identifier column to *bin* were not successful. It crashed basic functions of Civi for reasons unclear.

Better is to add a hash to the data itself, thanks for the idea Demerit. I found this VBA script that does so through Excel: https://codedocu.com/Office-365/Excel/Templates/Excel-\_colon\_-Encoding-values-with-HASH-functions-SHA256?2482 Note that installing the .NET framework in Windows and enabling .NET as Windows Feature is required.

Also note that the external\_identifier varchar(64) table is limited to 64 characters. Either you can truncate the hash or alter the Civi table.
> 2 votes

# Answer
You'd want to rebuild triggers if using trigger logging. If you have code that does a SQL join or compare on this field with another you might want to check that still works, but if it did before it still should. However I'd lean towards \_bin rather than one of the \_cs collations, since that should automatically cast mismatches, whereas \_cs might error.

The main danger isn't bin it's if you have an extension with utf8 and core with utf8mb4 and there's some comparison or join made on the field.

---

An alternate idea if you're ok with editing input files before every import: Use a hash of the external id as the external id. This could be simple or complicated, i.e.

* Add an import file column that's the output of md5 or sha256 of the external id. Use that for import. I think md5 would be sufficient here unless you have a ton of rows.
* Add an import file column that's the first, say, 10 chars of the sha256 of the external id plus the actual external id. This would be unique and then also have the real external id visible if that's a need.
> 2 votes

---
Tags: mysql, external-id, datatablescollation
---


# Question
Title: "Find Contribution" has stopped functioning
Drupal 7.91 CiviCRM 5.51.1

We have lost the ability to use Find Contributions. It just shows the header & footer on that page. Everything else seems to be fine. We can see reports, contacts, events, etc. Even within Contributions we can access reports, etc. We just cannot do anything with Find Contributions.

We did an update to Civi July 15, but we have used Find Contribution since then.

I do not have any errors in the Civi or Drupal logs that seem related to when we try to access Find Contribution.

Is it safe for me to uncheck Contributions in Admin \> System Settings \> Components save and then re enable it? Or any other ideas of what to look for?

Additional Info This may or may not be the cause. Yesterday we ran out of file space on our webhost due to too many stored backups. When we ran out of allotted space, our civi scheduled jobs stopped running. I deleted the extra backups and manually triggered the scheduled jobs. It was after this was the first that we noticed we cannot access Find Contributions. But I am not sure if the Find Contributions was an issue earlier or since this.

# Answer
> 2 votes
I checked on Extensions and saw that there was an update for Extended Reports. This was not showing a message as it normally does that there are extensions to update. But once I ran the update, Find Contributions is back. Likely no connection between Extended Reports and Find Contributions. But doing the update reset something.

Maybe if you run into a similar situation, try disabling, uninstall, and reinstall an extension and see if it fixes the issue.

---
Tags: civicontribute
---


# Question
Title: Change the language of the CiviVolunteer component
I have a clean installation of CiviCRM on Wordpress on a Bitnami AWS installation. Later I was able to change the language to Spanish MX of all CiviCRM but it has not changed the language of the CiviVolunteer component.

I installed the l10n and SQL Translation files but this doesn't work for CiviVolunteer. How can **I change the language of this component to Spanish MX**?

# Answer
Looking at the source code (e.g. the settings part), CiviVolunteer is not translated, nor easily translatable (the text is hard coded).

In order to make it translatable, some programmer needs to add the translation strings.
> 2 votes

# Answer
There might not be a translation for it, but check out l10nupdate which helps you download translations for extensions.

By the way the core translations you linked to in your question are very old. The newer ones are at https://civicrm.org/download \- in the dropdown is a choice for the localization files.
> 1 votes

---
Tags: civivolunteer, language
---


# Question
Title: Why might Mosaico emails with links with backgrounds sometimes not show in gmail (and possibly other providers)
Bit obscure but client had this issue and while it showed in my Mac Mail, in gmail itself the links did not show at all - not just a case of white on white, but absolutely nothing to click on

# Answer
> 1 votes
Purely due to a typo the background colour was ##4f81bd (yes doubled down on the hash)

so clearly some email readers go 'doh, you put two and you only need one so i will ignore one of them and show what you meant to show', and others go 'two hashes, are you nuts! this will NOT be shown'

so now we know!

---
Tags: mosaico
---


# Question
Title: Thank-You page not displaying for Pay-Later contributions
Recently while testing a new contribution page I noticed that CiviCRM is no longer displaying a thank-you page when a donor selects the ‘Pay later’ option. Instead of a Thank-You page, CiviCRM goes directly to a fresh (unpopulated) contribution page. All contribution pages on two WordPress sites I manage now act this way. The Thank-You page displays as usual if a payment portal such as PayPal is selected.

Pending donations are properly recorded in the database, and CiviCRM sends a Thank-You email, but the missing Thank-You page can confuse donors into thinking there was a glitch, some of who immediately make a second donation. Also, the Thank-You page normally shows the Pay-later instructions, which is important given that Thank-You emails often end up in junk folders.

I don’t know when the Thank-You page ceased to appear for Pay-later donors, but I see duplicate Pay-later donations back as far as Nov.30, 2021, a day after updating sites to CiviCRM version 5.43.2, though we are currently running 5.50.2. The last time I tested a contribution page on either site the Thank-You page worked normally, but that has probably been over a year ago.

Before I report an issue, I wonder if anyone else has noticed this problem, or if the Pay-later Thank-You page is working normally for anyone running a fairly current version of CiviCRM for WordPress (if so, what version)?

# Answer
I found the problem causing the thank-you page to misbehave on pay-later - while updating a few months ago I missed adding a couple definitions to the settings file (CRM\_CRED\_KEYS and CIVICRM\_SIGN\_KEYS). After adding the php code to set these keys the thank-you page displays properly.
> 2 votes

---
Tags: wordpress, civicontribute
---


# Question
Title: Display thank you page for Pay Later (ed: was offline) contributions (civicontribute)
How do you enable a thank you page for any Pay Later membership? We'd like to redirect them to a page that tells them how to get us their contribution. Are thank you pages only displayed when using a payment processor? How do we display something as reinforcement that we got their submission?

# Answer
> 1 votes
"Offline" in civi can be a misleading term - it means a staff member has entered it in the backend, e.g. using the Memberships - New Membership menu choice. So you can't redirect to a thank-you page there since it's a staff member doing the entry.

If you mean pay-later, then when you configure the contribution page there's a checkbox for "Use a confirmation page?" at the bottom of the Title tab, e.g. at `civicrm/admin/contribute/settings?reset=1&action=update&id=1` (replace id=1 with the id of the appropriate contribution page). Pay later is an option on the Amounts tab.

# Answer
> 1 votes
I found the problem causing the thank-you page to misbehave on pay-later on my sites - while updating a few months ago I missed adding a couple definitions to the settings file (CRM\_CRED\_KEYS and CIVICRM\_SIGN\_KEYS). After adding the php code to set these keys the thank-you page displays properly.

---
Tags: civicontribute, contributions
---


# Question
Title: Change size of event title on wordpress front end info page
I found this

and tried this #crm-container .crm-title h1 { font-size: 8px; margin: 0; padding: 4px; font-weight: bold; color: #fff; } into \[civicrm.files\]/css/extra.css but I dont really know what I'm doing!

# Answer
If as per comments you just want it to disappear: `#crm-container .crm-title h2 { display: none; }`

But note extras.css was removed years ago. You'll need to add that css in an extension or you can add a custom css file at administer - system settings - resource urls, or you can add it in your front-end theme.
> 1 votes

# Answer
Thanks demerit! - it was a res. Url issue. I changed to absolute path https://xxxx.org.au/wp-content/plugins/civicrm/civicrm/css/extras.css

and it worked.
> 0 votes

---
Tags: css
---


title: Can you disable or hide reports?

text:
# Question
Title: Can you disable or hide reports?
We have a ton of reports, we would like to keep them but disable or hide them like we do with groups. Is that a functionality that I am just not seeing? Can you nest reports?

# Answer
> 2 votes
You can disable all the reports that derive from a certain template, but that's not exactly what you want. But for the record go to Admin - system settings - option groups and then scroll down to report template and click on Edit Options.

The civicrm\_report\_instance table does have an is\_active field but it doesn't seem to be used. It would probably be medium effort to write an extension to customize some of the screens to allow setting that in the UI and then using it on the listing page. I assume that's the page you're talking about (from the menu under Reports), not individual report instance menu entries which can be disabled under Admin - customize - navigation menu.

---
Tags: civireport
---


# Question
Title: Why would the CiviCRM menu or theme css appear on frontend pages on Wordpress?
When I am logged in as a civicrm admin, or anyone with civicrm privs, the menubar is showing up on event registration pages when linked to directly. In addition, backend theme css loads on the frontend too.

This does not happen when i embed an event registration shortcode on a page. Only when going directly to the event registration page in CiviCRM.

https://example.org/civicrm/event/register/?id=10&reset=1

When not logged in, the menu does not appear, but the backend theme css still seems to load on front facing pages. This happens with any civicrm theme I use.

If I select a different front end theme in civicrm settings, it makes no difference.

# Answer
If you're on a CiviCRM page as a user with CiviCRM privileges, you will see the CiviCRM menu, including on public facing pages. This is the default behavior that I have observed across Drupal and WordPress.

WordPress does not have an administration theme the way that Drupal does, so public facing CiviCRM pages are going to pull in CiviCRM stylesheets when rendering that container. I would suggest installing the WordPress "CiviCRM Admin Utilities" plugin, and with that you can set it to prevent CiviCRM stylesheets from loading. This way your theme should take over all of the styling on these pages. You will most likely need to define some additional css in your theme to get things looking good.
> 2 votes

# Answer
The menu shows because the direct registration pages are in Civi. As such, you're going to see the Civi menu because you have permission to see it when inside Civi.

When you use the shortcode and put it on a WP page, you're no longer in Civi, so the menu doesn't show.

I can't answer the part about the theme, as I use Drupal. But in Drupal, I have two settings - one is for the Admin part of Civi and the other is for the public pages for Civi. The public pages part is what shows for me on registration pages regardless of whether I am logged in or not.
> 0 votes

---
Tags: civievent, menu, theme
---


# Question
Title: CiviEvent Widget: Link to register is broken
CiviEvent Widget shortcode will list event like this:

However the "Register Now" link for the event is not correct. The url the widget provides is: mysite.com/&civiwp=CiviCRM&q=civicrm%2Fevent%2Fregister&reset=1&id=6

The correct url should be: mysite.com/?page\_id=5&civiwp=CiviCRM&q=civicrm%2Fevent%2Fregister&reset=1&id=6

Any suggestions on why this is happening? Running: WP 5.9.1, CiviCRM 5.42.1

# Answer
I have the exact same problem. Did you find a solution? In outbound emailing, I found a workaround : I insert manually the missing "?page\_id=5" in the URL, in civimail. But once a user register to an event online, or fill a profile form, the URL after completion is wrong and leads to HTTP 404 error because of the missing "?page\_id=5":

https://www.mydomain.org/&civiwp=CiviCRM&q=civicrm%2Fevent%2Finfo&reset=1&id=1
> 0 votes

---
Tags: civievent
---


title: Setting up Cron jobs with wp cli

text:
# Question
Title: Setting up Cron jobs with wp cli
I am running civiCRM 5.39.0 on WordPress 5.8 I am attempting to set up the Cron jobs, using the Cli method. I am running the command from the root folder of the Wordpress install `/www/parlemonde_330/public`

`wp --user=root --url=https://www.parlemonde.org --path=/www/parlemonde_330/public civicrm api job.execute auth=0`

It does output:

```
(
    [is_error] => 0
    [version] => 3
    [count] => 1
    [values] => 1
)

```

And when I check in civiCRM admin panel, all the scheduled jobs are being triggered :-)

BUT. Then, they do not run on the perodic schedule there are supposed to :-( What am I missing? For exemple, Send Scheduled Mailings is set to "Always"... yet, when I'm sending a mass mailing, it stays as "planned". Maybe related to this issue, when I browse the job logs, the "date" column is always empty.

For the record, running `wp option get home` triggers `https://www.parlemonde.org`

# Answer
Maybe a silly question but are you just manually running that from the command line or did you set this up as an actual cron task? Meaning, depending on your hosting setup the control panel might have a section for cron tasks where you would enter the `wp` command and can configure the timing. Or if there's no control panel, then this is a good article: https://www.cyberciti.biz/faq/how-do-i-add-jobs-to-cron-under-linux-or-unix-oses/

Also is "root" an actual wordpress user? The `--user` option is referring to a wordpress admin user. But that's separate from the timing issue.
> 0 votes

# Answer
I think it either cannot find `wp` or it cannot find `php`. Have you tried specifying the path to `wp` and setting `env` as follow:

```
/usr/bin/env PATH=<php path>:$PATH <wp path>/wp --user ....

```
> 0 votes

---
Tags: cron-job
---


# Question
Title: Best way to fix the 'Dear [display_name} problem
When supporters are emailed it would be more personal to start 'Dear Joanna Smith' rather than 'Dear Supporter'. Of course, sometimes we don't have a first name, and sometimes only an initial so using the tokens is tricky. How do people handle this in a) traditional bulk emails and b) Mosaico? Some examples would be useful

# Answer
Greeting tokens can use smarty. You can set your default email greeting token at `civicrm/admin/options/email_greeting?reset=1`, and then in your mail use the greeting token `{contact.email_greeting_display}`.

So then you can make the greeting token something like `Dear {if "{contact.first_name}" != ""}{contact.first_name}{else}Supporter{/if}`

To update existing contacts you'd need to first change their pref to the new one you've created, using something like `UPDATE civicrm_contact SET email_greeting_id=5 where contact_type='Individual'`, where 5 is the id of the new greeting, then run the scheduled job "Update Greetings" to update the greeting.
> 4 votes

---
Tags: email, tokens, mosaico
---


# Question
Title: How to search for or avoid duplicate contributions for the same membership
Imagine this scenario:

1. a person signs up in public membership sign up page
2. a membership and a contribution is created
3. the same person, a while later, forgets that they have sign up and sign up again in the same public membership page.
4. the current membership does not change (it's ok!) and a new contribution is created (mmmhh)

How can I inform the person that the membership has already been made?

Or, how do I search in CiviCRM for duplicate contributions for the same membership?

### Update after Jay answer

When a contact pay twice the membership with the same email and in same period (year, fixed membership type plan in my own case) the membership is extended by a further 12 months. It would be optimal that the contact should be informed of the new end date and type of membership. How to do it?

To notify him and the organisation we could use CiviRules to send an email when "Membership is changed" trigger and "Membership End Date is changed". The problem is that the message template does not know which membership has changed, because it only has the 'latest membership' tokens...

# Answer
> 0 votes
Normally the membership gets extended by the membership period. Unless the user enters info that doesn't get caught by the duplicate contact check (typically configured as name and email). I occasionally get a problem where this happens when they use a different name or email (Bob/Robert is common!) and two contacts are created each with a separate membership. The contact merge (done manually) sometimes isn't able to correctly merge the two memberships (by adding together the remaining periods of each. I don't think it even tries). If its done automatically it always work properly for me.

Is this what you mean, i.e. there are two separate contacts with separate memberships? Are they using different contact info each time? You may want to review your settings for unsupervised duplicate contact (or is it one contact with two memberships?)

> How can I inform the person that the membership has already been made?

If it is the issue above I have no idea. I just go and check and manually clean these up on occasion using other duplicate contact rules.

> how do I search in CiviCRM for duplicate contributions for the same membership?

Not sure how to answer this. I tend to review recent contributions so always catch them. If I had to find them after perhaps running a report over a specific time period and then review those contacts that have multiple contributions?

---
Tags: civimember
---


# Question
Title: Membership contributions for existing organisations
Our client wants to preload several thousand organisations, then have a user be able to search for an organisation when signing up for a membership. The user won't exist in Civi yet, so won't have a relationship to an organisation, so we need them to be able to select the organisation, have a membership created for that organisation, and an individual user account created, linked to that organisation.

We're using WordPress if that makes any difference to what is possible.

# Answer
This extension allows you to set the 'organisation' field as an autocomplete

https://civicrm.org/extensions/public-autocomplete-of-organisation-names
> 0 votes

---
Tags: wordpress, civimember, contributions
---


# Question
Title: Editing custom field creates multiple entries in reports and exports with same contact ID
Civi 5.51.0 wordpress 6.01

Best explained with an image I reckon. Each time I edited this contacts country of birth another entry appears in reports (same with exports from search - multiple rows created). Doesn't happen if I edit standard fields, only custom fields of any type ie text, date, option,Y/N etc Making reports and export unuseable HELP

# Answer
> 1 votes
Solved it. Missing primary key & messed up ID's in civicrm\_value table

---
Tags: custom-fields, multiple-records
---


# Question
Title: No CiviCRM pages on completely new install
* New Server: Intel Xeon-E2388G 3.2, with 64GB RAM and 2 1TB nvme on soft raid running ubuntu server
* Database Server: 10.4.24-MariaDB-1:10.4.24+maria~focal
* PHP 7.4.30, Memory Limit 512MB
* Drupal 9.4.5, Standard Install
* CiviCRM 5.52.2 Separate database with all permissions on Drupal and CiviCRM DBs and SUPER
* en\_GB localisation files installed after cli installation
* No warnings at all on Drupal Status Report

Installed clean installation on the above, composer Drupal, composer CiviCRM as per CLI installer guide. Visiting the /civicrm page for the first time, seen permissions problem but fixed this on /sites/default/files/civicrm/... Refreshed with the problem text gone. Nothing displaying, other than the civicrm footer. No CiviCRM pages at all.

Followed the troubleshooting steps - caches, menu etc. Log file contains the following:

```
Aug 19 03:12:28  [error] $Fatal Error Details = Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => exceptionHandler
        )

[code] => -18
[message] => DB Error: no such table
[mode] => 16
[debug_info] => SELECT `a`.`id` AS `id`, `a`.`name` AS `name`, `a`.`label` AS `label`,

`a`.`description` AS `description`, `a`.`entity_name` AS `entity_name`, `a`.`items` AS `items`
FROM  a
ORDER BY `label` ASC
 [nativecode=1146 ** Table 'civicrmdb.a' doesn't exist]
    [type] => DB_Error
    [user_info] => SELECT `a`.`id` AS `id`, `a`.`name` AS `name`, `a`.`label` AS `label`, `a`.`description` AS `description`, `a`.`entity_name` AS `entity_name`, `a`.`items` AS `items`
FROM  a
ORDER BY `label` ASC
 [nativecode=1146 ** Table 'civicrmdb.a' doesn't exist].....

```

Any ideas? Stuck! Thanks in advance.

Edit after further research: CLI install command used:

```
cv core:install --cms-base-url="https://example.com" --lang="en_GB" --db="mysql://civicrmuser:password@localhost:3306/civicrmdb" -v

```

Result of cv:

```
{
    "srcPath": "/var/www/vhosts/example.com/httpdocs/vendor/civicrm/civicrm-core",
    "setupPath": "/var/www/vhosts/example.com/httpdocs/vendor/civicrm/civicrm-core/setup",
    "settingsPath": "/var/www/vhosts/example.com/httpdocs/web/sites/default/civicrm.settings.php",
    "templateCompilePath": "/var/www/vhosts/example.com/httpdocs/web/sites/default/files/civicrm/templates_c",
    "cms": "Drupal8",
    "cmsBaseUrl": "https://example.com",
    "db": {
        "server": "localhost:3306",
        "username": "civicrmuser",
        "password": "password",
        "database": "civicrmdb",
        "ssl_params": []
    },
    "cmsDb": {
        "server": "localhost:3306",
        "username": "drupaluser",
        "password": "password",
        "database": "drupaldb",
        "ssl_params": null
    },
    "siteKey": "mySiteKey",
    "credKeys": [
        "aes-cbc:hkdf-sha256:myCreds"
    ],
    "signKeys": [
        "jwt-hs256:hkdf-sha256:mySign"
    ],
    "loadGenerated": null,
    "lang": "en_GB",
    "components": [
        "CiviEvent",
        "CiviContribute",
        "CiviMember",
        "CiviMail",
        "CiviReport"
    ],
    "extensions": [
        "org.civicrm.search_kit"
    ],
    "paths": {
        "civicrm.files": {
            "url": "https://example.com/sites/default/files/civicrm",
            "path": "/var/www/vhosts/example.com/httpdocs/web/sites/default/files/civicrm"
        }
    },
    "settings": [],
    "mandatorySettings": [],
    "extras": []
}

```

Output from cv vars:show -

```
{
    "CIVI_CORE": "/var/www/vhosts/example.com/httpdocs/vendor/civicrm/civicrm-core/",
    "CIVI_DB_ARGS": "-h localhost -u civicrmdb -pcivicrmdb -P 3306 civicrmdb",
    "CIVI_DB_DSN": "mysql://civicrmuser:pass@localhost:3306/civicrmdb?new_link=true",
    "CIVI_DB_HOST": "localhost",
    "CIVI_DB_NAME": "civicrmdb",
    "CIVI_DB_PASS": "password",
    "CIVI_DB_PORT": 3306,
    "CIVI_DB_USER": "civicrmuser",
    "CIVI_FILES": "/var/www/vhosts/example.com/httpdocs/web/sites/default/files/civicrm/",
    "CIVI_LOG": "/var/www/vhosts/example.com/httpdocs/web/sites/default/files/civicrm/ConfigAndLog/CiviCRM.random.log",
    "CIVI_SETTINGS": "/var/www/vhosts/example.com/httpdocs/web/sites/default/civicrm.settings.php",
    "CIVI_SITE_KEY": "mySiteKey",
    "CIVI_TEMPLATEC": "/var/www/vhosts/example.com/httpdocs/web/sites/default/files/civicrm/templates_c/",
    "CIVI_UF": "Drupal8",
    "CIVI_URL": "https://example.com/libraries/civicrm/core/",
    "CIVI_VERSION": "5.52.2",
    "CMS_DB_ARGS": "-h localhost -u drupaluser -pdrupaldb -P 3306 drupaldb",
    "CMS_DB_DSN": "mysql://drupaluser:password@localhost:3306/drupaldb?new_link=true",
    "CMS_DB_HOST": "localhost",
    "CMS_DB_NAME": "drupaldb",
    "CMS_DB_PASS": "password",
    "CMS_DB_PORT": 3306,
    "CMS_DB_USER": "drupaluser",
    "CMS_ROOT": "/var/www/vhosts/example.com/httpdocs/web/",
    "CMS_URL": "https://example.com/",
    "CMS_VERSION": "9.4.5",
    "IS_INSTALLED": "1",
    "SITE_TYPE": "cv-auto"
}

```

Contents of vendor/civicrm... appears complete. Contents of web/libraries/civicrm... is definitely incomplete with hundreds of files missing including jquery etc which is obviously why it's no working.

Is the full core and packages required at /libraries/ or should CIVI\_URL in cv be something else?

# Answer
Did something fail during one of the composer commands at one point? You may need to run `composer civicrm:publish` manually then to copy files into web/libraries. For the DB Error, that error has come up before but shouldn't on a brand new install. Usually `cv ext:upgrade` will fix that.
> 0 votes

---
Tags: installation
---


# Question
Title: Php Standalone Skript doesnt Query Database, APIv4 Simple Example
I tried to write a Standalone PHP-Skript for CiviCRM and looked after the Simple Example, but unfortunately it doesnt return something.

```
<?php
require_once '/var/www/html/wp-content/plugins/civicrm/civicrm/civicrm.config.php';
require_once $civicrm_root . '/CRM/Core/Config.php';

$config = CRM_Core_Config::singleton();

$contacts = \Civi\Api4\Contact::get()
  ->addSelect('first_name')
  ->addWhere('contact_type', '=', 'Individual')
  ->setLimit(25)
  ->execute();

foreach ($contacts as $contact) {
    echo $contact;
}

```

The variable $civicrm\_root is loaded by the *civicrm.config.php* and is the absolute path to my civiCRM root: */var/www/html/wp-content/plugins/civicrm/civicrm/*. I looked up both config files, they exist and I crosschecked the querycode against the APIv4 Explorer, and it works, I dont know what the problem is.

System:

* Debian 11 VM
* Apache 2.4.54
* PHP 7.4.30
* MariaDB: 10.5.15
* Wordpress: 6.0.1
* CiviCRM: 5.52.0 I hope there is a Idea for a solution. Thanks in advance!

**Edit I**

I applied the suggestions and invoke it with ~/buildkit/bin/cv scr myscript.php but no return value either.

```
<?php
$config = CRM_Core_Config::singleton();

$contacts = \Civi\Api4\Contact::get()
  ->addWhere('contact_type', '=', 'Individual')
  ->setLimit(25)
  ->execute();

foreach ($contacts as $contact) {
    echo $contact['first_name'];
}

```

**EDIT II**

I tried `cv api4 Contact.get +w 'contact_type = "Individual"' +l 25` and it works, still: whats wrong with the script?

**EDIT III**

I insert the line  `echo count($contacts);`, and this return 0.

# Answer
> 1 votes
I wouldn't do it that way. I'd remove those first two lines and install cv \- if you are using buildkit you already have it - and then run it with `cv scr myscript.php`.

That way it runs on all cmses, and you can do other neat stuff like `cv scr --user=demo myscript.php` to run it as the user named demo to test different permissions, run it with `-vvv` to get some debugging, etc...

Separate note: $contact is not a string so you can't `echo` it. You can do something like `var_export($contact)`.

# Answer
> 1 votes
In Combination out of Demerits posts i can solve the problem via

`cv scr --user=some_wordpress_username skriptname.php`

Thanks for the support.

---
Tags: mysql, php, apiv4
---


# Question
Title: How is Civi::lockManager supposed to be used?
I'm confused about how Civi::lockManager is supposed to be used in handling sql-level locks on certain processes.

I'm looking at a few existing code usages (as in Omnipay here and in civicrm core here). These are all using essentially this logic:

**Listing 1:**

```
  $lock = Civi::lockManager()->acquire($PROPERLY_FORMATTED_LOCK_NAME);
  if (!$lock->isAcquired()) {
    // This entity is locked, so don't do anything
  }
  else {
    // This entity is not locked, so go ahead and do that thing.
  }

```

However, my rather naive testing shows that `$lock>isAcquired($ANYTHING)` will always return TRUE. Consider this simple test script and its output:

**Listing 2:**

```
$ cat /tmp/locktest.php
<?php
$lockName = 'data.contribute.contribution.1';

$lock = Civi::lockManager()->acquire($lockName);
echo("lock is acquired:" . $lock->isAcquired()) . "\n";

$lock = Civi::lockManager()->acquire($lockName);
echo("lock is acquired:" . $lock->isAcquired()) . "\n";

$ cv scr /tmp/locktest.php
lock is acquired:1
lock is acquired:1

```

(From my reading, this seems reasonable, considering that mysql `GET_LOCK()` (which is always called by `acquire()`) is designed to allow multiple simultaneous locks of the same name. (Reference mysql docs). I.e., if you ask to acquire a lock of name 'x', mysql will always give it to you. The important step would be using `IS_FREE_LOCK()` to test whether the lock is actually free.)

Given the output in Listing 2, how is it possible that the code in Listing 1 is actually testing for the pre-existence of a named lock and avoiding repeat action if that lock is in place?

# Answer
> 2 votes
To answer my own question:

Civi::lockManager is expected to be used in a way that will allow one process to acquire a lock (with `Civi::lockManager()->acquire()`) such that any other process will be made to wait until the first process has released the lock (either explicitly with `Civi::lockManager()->release()`, or simply by completing script execution and ending the mysql connection).

To demonstrate this, we can run this script in two separate sessions (i.e., two separate cli terminals):

```
<?php

$connection_id = CRM_Core_DAO::singleValueQuery('SELECT connection_id()');
echo "connection id:                  {$connection_id}\n";

$startTime = time();
echo "Attempting to acquire lock at:  ". date('c', $startTime) . "\n";
$lock = Civi::lockManager()->acquire('data.contribute.contribution.1', 100);

$lockAcquireTime = time();
echo "Lock acquired at:               ". date('c', $lockAcquireTime) . "\n";
echo "Time elapsed waiting for lock:  ". ($lockAcquireTime - $startTime) . " seconds\n";
echo "Lock is acquired:               ". $lock->isAcquired() . "\n";

$timeout = 10;
echo "Sleeping $timeout...\n";
sleep($timeout);
echo "Script ended at:                " . date('c') ."\n";

```

Run this script in terminal 1 and observe this output:

```
$ cv scr /tmp/locktest.php
connection id:                  23757
Attempting to acquire lock at:  2021-11-03T10:41:01-05:00
Lock acquired at:               2021-11-03T10:41:01-05:00
Time elapsed waiting for lock:  0 seconds
Lock is acquired:               1
Sleeping 10...
Script ended at:                2021-11-03T10:41:11-05:00

```

Before that script completes, run it separately in terminal 2, and observe this output:

```
$ cv scr /tmp/locktest.php
connection id:                  23759
Attempting to acquire lock at:  2021-11-03T10:41:05-05:00
Lock acquired at:               2021-11-03T10:41:11-05:00
Time elapsed waiting for lock:  6 seconds
Lock is acquired:               1
Sleeping 10...
Script ended at:                2021-11-03T10:41:21-05:00

```

Specifically, compare the output lines labeled "Time elapsed waiting for lock". In Terminal 1, the lock was acquired instantly. Meanwhile in Terminal 2, execution paused for 6 seconds waiting for `Civi::lockManager()->acquire()` to acquire the lock. This demonstrates that lock acquisition will wait (up to the timeout value of 100 seconds, as defined in the second parameter to `Civi::lockManager()->acquire()`) until the named lock is free; it then acquires that named lock, which will cause any other processes to pause similarly when they try to acquire a lock of the same name.

Thanks to @eileen and @Tim Otten for the helpful comments.

# Answer
> 1 votes
The missing piece of info here is when the lock is released

```
$lock = Civi::lockManager()->acquire('data.contribute.contribution.1', 100);
unset($lock);

```

instantly releases the lock cos it is part of the classes \__destruct

---
Tags: developer, mysql, core
---


title: Cron Job not working

text:
# Question
Title: Cron Job not working
i use WP und civicrm. For Cron-Jobs i use www.cron-jobs.org.

I insert the following informations:

```
URL: http://www.myurl.de/wp-content/plugins/civicrm/civicrm/bin/cron.php

POST: name=username&pass=password&key=myOwnSite-Key&job=process_mailing

```

The Job say successfully.

Request:

```
POST /wp-content/plugins/civicrm/civicrm/bin/cron.php HTTP/1.1
Host: www.myurl.de
User-Agent: Mozilla/4.0 (compatible; cron-job.org; http://cron-job.org/abuse/)
Accept: */*
X-Forwarded-For: ip.ip.ip.ip (my IP)
Content-Length: 91
Content-Type: application/x-www-form-urlencoded
name=user&pass=pass&key=myOwnSite-Key&job=process_mailing

```

Result:

```
HTTP/1.1 200 OK
Date: Wed, 06 Jul 2022 16:18:58 GMT
Server: Apache/2.4.54 (Unix)
X-Powered-By: PHP/8.1.7
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Content-Type: text/html; charset=UTF-8
Set-Cookie: PHPSESSID=someFunnyIDCode; path=/
Content-Length: 0

```

But civicrm tell me that no cron job was running :-(

```
Set-Up Cron
Es wurde kein Cron Lauf aufgezeichnet.
Ein Cron Job ist notwendig für die automatische Ausführung von Geplanten Aufgaben.
(Weiterlesen...)

```

# Answer
> 3 votes
I don't know about your specific problem, but it may be interesting to try running the same call manually (using curl or postman), to see if that works again. If that works with curl or postman, you can try using another service, like https://cronit.app for instance and see if the result is the same.

---
Tags: wordpress
---


# Question
Title: Search Kit not working in Civicrm 5.52.0
Civicrm 5.52.0 Wordpress 6.0.1 PHP version 7.4.30

Last week I upgraded to 5.52.0 which has been working fine, that is until today when I tried to take a look at Search Kit and Form Builder which are both installed and had been working OK. When selecting SearchKit from Search/Search Kit, I'm getting a message " Sorry, due to an error, we are unable to fulfill your request at the moment. You may want to contact your administrator or service provider with more details about what action you were performing when this occurred.Entity not loadedSearchSegment" and also "Error: Entity not loadedSearchSegment".

Can anyone please tell me if there have been any regressions and should I update to 5.52.2?

# Answer
> 3 votes
I'm pleased to say that upgrading to CiviCRM 5.52.2 seems to have cured my problem and SearchKit has reappeared.

# Answer
> 1 votes
Can you check if you need to perform database upgrade upon visiting the extension page?

---
Tags: wordpress, searchkit, formbuilder
---


title: Delete Table in Searchkit

text:
# Question
Title: Delete Table in Searchkit
When I create a table in Searchkit and choose the delete button the table isn't being deleted. Any thoughts on how I can solve this coz I'm getting a list of obsolete ones. It puts a line through the table, but it isn't actually deleted and still there when I come back to it.  e.g. in this instance it looks like it's deleted but it isn't and when I come back it's still there.

# Answer
> 1 votes
Welcome to SE!

After doing the delete, have you hit 'Save'?

---
Tags: searchkit
---


# Question
Title: Clickatell 2 way messaging- not receiving inbound sms
I'm reviving our organisations clickatell account

was set up years ago, so the api managment is in their developer central platform rather than the main portal

I can send SMS's out from Civi And as a recipient I can text back *yay*

But, although the recieved messages are showing in my clickatell account, they are not showing as inbound sms in Civi *boo*

2 way settings for the long number are

I can't find further instructions on this, and can't figure which step I've missed.

Do I need to add a target username and password into these settings? The current civi documentation doesn't mention them, so initially left these fields blank. Have tried with the API user name and password, and with a civicrm username and password. All send fine, and all reply texts show as recieved in the clickatell reports  Nothing showing in Civi.

Cheers

Craig

# Answer
> 2 votes
Are the replies showing up as new contacts? - this happens if Civi can't match the reply to a contact. For Twilio you have to use the full international number when sending the SMS, because that's what Twilio will use in the reply. If you use the 07xx format when sending the replies create new contacts because there is no match

---
Tags: clickatell
---