# Question
Title: Configuration page for newly installed SparkPost extension error: Cannot decrypt token. Invalid format
> 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. Cannot decrypt token. Invalid format. Return to home page.

I have installed the SparkPost extension for CiviCRM 5.39.0 on Drupal 7.82. I have ensured that the installation steps 1, 2 and 3 here are complete. When attempting to follow step four, going to Administer \> System Settings \> Outgoing mail (SparkPost) I receive the above error on the screen.

I have cleared caches and double-checked paths.

Google search shows exactly one post with this verbiage but I am not able to figure out the relationship between that one issue and this: https://lab.civicrm.org/dev/core/-/issues/2563. It only comes up here as part of the exceptions thrown verbiage in the codebase.

Note: I am working on getting CiviCRM updated, but since CiviSMTP is kaput by Aug 1, 2022, I was hoping that updating CiviCRM was not the solution.

Please let me know what else I can try, thank you!

```
    Jul 31 22:09:44  [error]
$Fatal Error Details = array:3 [
  "message" => "Cannot decrypt token. Invalid format."
  "code" => null
  "exception" => Civi\Crypto\Exception\CryptoException {#1368
    -errorData: array:1 [
      "error_code" => 0
    ]
    #cause: null
    -_trace: null
    #message: "Cannot decrypt token. Invalid format."
    #code: 0
    #file: "/var/www/html/fosterclub/docroot/sites/all/modules/contrib/civicrm/Civi/Crypto/CryptoToken.php"
    #line: 206
    trace: {
      /var/www/html/fosterclub/docroot/sites/all/modules/contrib/civicrm/Civi/Crypto/CryptoToken.php:206 {
        ›   default:
        ›     throw new CryptoException("Cannot decrypt token. Invalid format.");
        › }
      }
      /var/www/html/fosterclub/docroot/sites/all/modules/contrib/civicrm/Civi/Crypto/CryptoToken.php:141 { …}
      /var/www/html/fosterclub/docroot/sites/default/files/civicrm/ext/com.cividesk.email.sparkpost/CRM/Sparkpost.php:54 { …}
      /var/www/html/fosterclub/docroot/sites/default/files/civicrm/ext/com.cividesk.email.sparkpost/CRM/Admin/Form/Setting/Sparkpost.php:64 { …}
      /var/www/html/fosterclub/docroot/sites/all/modules/contrib/civicrm/CRM/Core/Form.php:644 { …}
      /var/www/html/fosterclub/docroot/sites/all/modules/contrib/civicrm/CRM/Core/QuickForm/Action/Display.php:76 { …}
      /var/www/html/fosterclub/docroot/sites/all/modules/contrib/civicrm/packages/HTML/QuickForm/Controller.php:203 { …}
      /var/www/html/fosterclub/docroot/sites/all/modules/contrib/civicrm/packages/HTML/QuickForm/Page.php:103 { …}
      /var/www/html/fosterclub/docroot/sites/all/modules/contrib/civicrm/CRM/Core/Controller.php:352 { …}
      /var/www/html/fosterclub/docroot/sites/all/modules/contrib/civicrm/CRM/Utils/Wrapper.php:98 { …}
      /var/www/html/fosterclub/docroot/sites/all/modules/contrib/civicrm/CRM/Core/Invoke.php:286 { …}
      /var/www/html/fosterclub/docroot/sites/all/modules/contrib/civicrm/CRM/Core/Invoke.php:69 { …}
      /var/www/html/fosterclub/docroot/sites/all/modules/contrib/civicrm/CRM/Core/Invoke.php:36 { …}
      /var/www/html/fosterclub/docroot/sites/all/modules/contrib/civicrm/drupal/civicrm.module:458 { …}
      /var/www/html/fosterclub/docroot/includes/menu.inc:527 { …}
      /var/www/html/fosterclub/docroot/index.php:21 { …}
    }
  }
]

```

# Answer
> 2 votes
Install from git. The sparkpost-1.5.tar.gz was released after fixes for this were committed in July, but for some reason aren't in the release.

# Answer
> 1 votes
It might also be that your crypto keys in civicrm.settings.php aren't using a valid format. The docs are a bit difficult to follow to figure out how to generate a proper key. You can use this tool: https://civisettings.symbiotic.coop

Note you need to REPLACE the existing lines for CRED\_KEYS and SIGN\_KEYS in civicrm.settings.php with the output, not add more lines to the file at the end, since then the existing lines will still get used.

You may also need to clear out any existing api key and re-enter it on the admin page to get it re-encrypted. You can delete it in mysql directly with `delete from civicrm_setting where name='sparkpost_apiKey';`

Also make sure you are using the latest version of sparkpost - note there were some changes added last week related to crypto.

# Answer
> 0 votes
Seems the fix for this is in git, but is not in the zip even though v1.5 was tagged after fixes were applied for some reason isn't in the sparkpost-1.5.tar.gz

Suggest "git clone git@lab.civicrm.org:extensions/sparkpost.git". Then delete the .git folder in the sparkpost extension directory as you probably don't want to keep that.

---
Tags: drupal, extension, sparkpost
---


# Question
Title: Finished execution of Mail Reports with result: Failure, Error message: is not of type String
I have just worked through upgrading from 5.44 to 5.52 on WordPress. It took a few tries, and I had to do it in stages, but seemed to work in the end except that I have an error in my scheduled jobs now. The full text is this:

```
Parameters raw (from db settings):
instanceId=[ID of report instance] required
format=[csv or print] optional-output CSV or print-friendly HTML, else PDF

Parameters parsed (and passed to API method):
a:3:{s:7:"version";i:3;s:10:"instanceId";s:32:"[ID of report instance] required";s:6:"format";s:67:"[csv or print] optional-output CSV or print-friendly HTML, else PDF";}

Full message:
Finished execution of Mail Reports with result: Failure, Error message:  is not of type String

```

I haven't added any reports to be mailed in a long time. Not even sure there are any. There is, surprisingly, nothing in the CiviCRM log. Any thoughts? It seems almost like placeholder info is being passed, but I'm not sure why or where I would find that happening.

# Answer
You've probably always had that scheduled job running with invalid parameters, it's just now showing in the logs because of a change in civi in logging. I would just turn off that job unless you really think there are reports being mailed, but I doubt it was working.

Normally when you enable that job you replace the placeholders in the parameters section with actual values.
> 1 votes

---
Tags: scheduled-job
---


title: Automatically Send Invoice

text:
# Question
Title: Automatically Send Invoice
I am wanting to send a VAT receipt invoice when a contribution is added. To include all the invoice details that show in contribution invoice that's available for printing or emailing. Is there any way I can do this?

# Answer
> 2 votes
At administer - civicontribute - civicontribute component settings, there's a checkbox down in the invoicing section to include it automatically.

---
Tags: civievent, civimember, contributions, invoice
---


# Question
Title: Reusing Price Sets and changing their values
We have events running regularly. Each year the prices change but often the price set structure is the same. If I change the amount of a price field - e.g. Member ticket £10 last year and go to the same price field and change to £12 this year Will this in any way affect previously logged event contributions or event ticket prices as they have already been logged?

We use sagepay payment processor and take online payments.

Just wanting to not create a new price set every time I run the same event if it's just for a price change.

Thanks

# Answer
> 3 votes
It will not change contribution records, but will change any of the forms if they get reloaded. So, if you are not needing to change those past transactions, then you don't have anything to worry about. I have confirmed it, but you can ease your mind by doing a quick test to confirm for yourself. Find a transaction that uses the price set. Make the price set change and then view the transaction again. No change.

---
Tags: civievent, price-sets, repeating-events, percentage-price-field
---


title: Importing Multi-value Custom Data

text:
# Question
Title: Importing Multi-value Custom Data
I'm trying to import custom fields from one civiCRM installation (on Drupal 7x) to another (WordPress, civi 5.52) using the "Import Multi-value Custom Data" tool. All my column names in the downloaded cvs file line up with custom fields in the new installation. Multi-Value Custom Data appears as a drop down list but the list is empty (there is nothing to select). When I try to import the data an error claims "Multi-Value Custom Data is a required field". What am I doing wrong?

# Answer
> 2 votes
You will need to select Multi-value custom data field to import. If the field is not populated then check the custom group if it is multi-value.

---
Tags: wordpress, custom-fields, data-import
---


title: Send an email to an entire subgroup

text:
# Question
Title: Send an email to an entire subgroup
I want to send an email to an entire subcategory of individuals (WordPress, civiCRM 5.52) but the Recipients line only accepts GROUPS.

Do I have to assign a group to this subcategory just to send an email?

# Answer
> 1 votes
You an also start a mailing from the Advanced Search screen. There is some information here: https://docs.civicrm.org/user/en/latest/email/mass-mailings-using-civimail/#the-mailing-set-up-screens

But basically, if you run an advanced search for contacts, one of the options in the Action menu is **Email - schedule/send via CiviMail**

---
Tags: wordpress, civimail
---


# Question
Title: How does Civimail reply tracking and forwarding work?
Track replies and forward replies are ticked for a particular mailing. When someone replies, exactly how does CiviCRM determine the address to forward the mail to. The reply is using VERP. Is this clearly documented somewhere? I have looked at the documentatin on civicrm.org (book, wiki) and cannot find any details.

# Answer
At Administer \> CiviMail \> Mail Accounts you can configure one or two email inboxes to be automatically processed by CiviCRM. The Bounce Processing inbox handles the processing of replies to emails along with soft and hard bounces, unsubscribe emails and opt out emails.

The VERP information on the return message is used to correlate the incoming email to CiviCRM with the outgoing one from CiviMail.

When Track Replies is enabled for a mailing, and a.reply is received, a copy of the reply is stored as an Activity for the person who had been sent the CiviMail.

If Forward Replies is enabled and CiviCRM receives a reply, it sends a copy of the email to the From address used in the Mailing. The possible From addresses for CiviMail can be configured at Administer \> CiviMail \> From Addresses.

If you don't want to track replies using VERP, navigate to Administer \> CiviMail \> Component Settings and disable 'Track replies using VERP in Reply-To header'.
> 5 votes

# Answer
CiviCRM uses Variable Envelope Return Path (VERP for short) to track *bounces* and optionally *replies*.

This technique assigns a unique, coded address to two aspects of a CiviMail email. Viewing the mail headers, you might see something like

```
Return-Path:      <civimail+b.1234.1234567.aabbccddeeff1122@example.org>
X-Civimail-Bounce: civimail+b.1234.1234567.aabbccddeeff1122@example.org
Reply-to:          civimail+r.1234.1234567.aabbccddeeff1122@example.org

```

Here's a breakdown of what you're seeing -

```
civimail         - the mailbox name of civimail@example.org
+                - VERP separator
b                - action - (b|bounce|c|confirm|o|optout|r|reply|s|subscribe) etc
1234             - mailing job id
1234567          - mailing queue id
aabbccddeeff1122 - validation hash

```

SMTP systems understand these headers, so if the message is undeliverable they should return the bounce to the `Return-Path` address, and if the person hits reply their mail client *should* use the `Reply-To` address. This depends on correct behaviour in the MTA and MUA, both of which are outside of control of CiviCRM.

The main place this is used is in the email processor at CRM/Utils/Mail/EmailProcessor.php, where CiviCRM checks for these strings either in the message headers this bounce/reply was delivered to, or in the body of the message (some mail systems don't permit VERP delivery; expect less ideal results without full VERP support).

... That's how it works under the hood! Joe's answer explains this well from the other side of the dashboard :)
> 6 votes

# Answer
Joe wrote above :

> When Track Replies is enabled for a mailing, and a.reply is received, a copy of the reply is stored as an Activity for the person who had been sent the CiviMail.

I performed a lot of tests, and I came to the conclusion that this is not so simple. I haven't been able to store easily as an activity the replies sent to the Reply-to address (civimail+r.1234.1234567.aabbccddeeff1122@example.org in the above example)

After running the "fetch bounces" scheduled task, Civimail report correctly displays that a response has been received, and that answer is moved under the IMAP subfolder "civimail/processed" of the bounce email account.

BUT NO copy of that email is attached as an activity to the civimail recipient (who sent an answer to the mass mailing).

I had to use the following trick :

1. in the imap mailbox, create a rule to copy all emails sent to "civimail+r." to a subfolder called "civicrm-answers". All those emails are now duplicated : they appear both in "civimail/processed" (bounce processing) and in "civicrm-answers"
2. in civicrm, create an additional "email to activity" account, monitoring "civicrm-answers" IMAP folder
3. after the execution of the task "Process Inbound emails", the reply is now correctly stored as an Activity for the person who had been sent the CiviMail

This is quite complex, and it would be so simpler if the "fetch bounce" task could at the same time store the reply as an activity (and not only increment the amount of replies in the civimail report). Am I doing something wrong ?
> 0 votes

---
Tags: civimail
---


# Question
Title: profile submission has no confirmation message
civi 5.52 wordpress 6 I'm not getting message "Thank you. Your information has been saved." after profile submitted. It just shows completed profile. Data is successfully saved

this previous query suggests javascript error so I include image below

# Answer
> 1 votes
There is a javascript problem - the question is what is causing it. It could be caused by CiviCRM but unless others are reporting the same thing, that's unlikely. Otherwise, it might be a conflict with another plugin on your site. If you're not using a default WP theme, try switching to that and see if the problem continues. Failing that, see what other plugins are adding javascript on your site and disable those to isolate the problem.

---
Tags: profile
---


# Question
Title: Recurring Contributions count not match: "Find Contributions" vs API4 Contribution::get
Api call below returns **1078** contributions

```
$contributions = civicrm_api4('Contribution', 'get', [
  'select' => [
'row_count',
    ],
 'where' => [
['contribution_recur_id', 'IS NOT NULL'],
['is_test', '=', FALSE],
['contribution_recur_id.start_date', '>=', '2016-01-01'],
   ],
  'checkPermissions' => FALSE,
  ]);

```

...while Find Contributions search below

```
Is a Template Contribution = '0' ...AND...
Recurring Contribution Start Date - greater than or equal to "January 1st, 2016 12:00 am" ...AND...
Contribution Status In Completed ...AND...
All recurring contributions regardless of payments

```

returns only **629** records.

Why?

# Answer
> 3 votes
Can you also add same filters in api4 as Find Contribution

1. is\_template = 0
2. contribution\_status\_id = Completed

---
Tags: recurring-contributions, apiv4
---


# Question
Title: Does CiviCRM work with WP Engine after August's update?
I work at WP Engine and we have a customer who was running CiviCRM with us. They recently ran an update for the 5.52 release and the plugin is no longer working with us. Is there a way to offload cache files to another directory or handle temporary files? Thank you for the help!

# Answer
> 2 votes
You should be able to 'move' the template directory following the convention here - https://github.com/civicrm/civicrm-core/blob/master/templates/CRM/common/civicrm.settings.php.template#L166 in the `civicrm.settings.php` file that is by default located in the wp upload directory and subdirectory civicrm.

---
Tags: wordpress
---


# Question
Title: Is it possible to permanently block/blacklist a contact?
There's a spam account in my system that I need to delete and permanently prevent from accessing our server. I see CiviCRM has a concept of deleting a contact, but I don't see a way to "block" or "blacklist" a contact. Is there a way to do this?

# Answer
Blocking would be done through your CMS. For Drupal I use: https://www.drupal.org/project/autoban which allows you to set rules to block IPs and you can manually add IPs. https://www.drupal.org/project/path2ban Allows you to block user registration/access by domain. https://www.drupal.org/docs/7/managing-users/ban-an-ip-address Also allows you to block by manual input of IPs.

I am sure the other CMS options have similar plugins/modules that will allow to keep out the spammers.
> 3 votes

---
Tags: delete, spam, billingblock
---


title: Contribution Invoice - renamed Title

text:
# Question
Title: Contribution Invoice - renamed Title
I renamed the Message Title of my Contribution-invoice message template. It's no longer in my list of system workflow templates. Does anyone know how I can find it in order to put the message title back to what it should be?

Any help gratefully received.

# Answer
All solved - I had changed the Title to VAT Invoice so it was down at the bottom of the list Doh! thank you anyway
> 2 votes

---
Tags: message-templates, system
---


# Question
Title: If we sent out a mailing with an incorrect URL what can we do to fix things up
A CiviMailing has just gone out. A link in it was wrong. Is there anything that can be done to rectify the issue so people clicking the link get sent to the right place.

I do have Trackable URL 'on'.

# Answer
> 1 votes
If you have Trackable URL on, and access to DB (or happy using API Explorer) you can probably get yourself out of trouble.

In the db, look for the offending url in the civicrm\_mailing\_trackable\_url table.

Once you find it, update it with the correct url.

Anyone who now clicks on the trackable url link in the mailer should get sent to the updated link

---
Tags: civimail
---


# Question
Title: SearchKit is not displaying contacts with a specific membership type
I am looking for a way to build a SearchKit report that displays all contacts with a specific membership type. My initial search was based on the Contacts table with (optional) Contact Membership Types. This didn't work because that table seems to only look at the organization associated with the membership. The results only rendered the organization, not the individuals holding the membership.

My next thought was to add contacts with those memberships to a static group and then have my SearchKit report query on group members. This got me the list of contacts that I wanted. However, I added a column to the SearchKit to display a list of Membership Types for each contact and that remains empty since SearchKit seems to only be looking at the related organization.

We are on D7 CiviCRM 5.41.2. Is this something that is corrected with a later update?

# Answer
> 2 votes
Just set up a quick searchkit search on the dmaster.demo.civicrm.org

with these parameters

And got these results

So I think searchkit will do what you want

But it does change between versions of civi

the demo site is now running 5.54- so yeah upgrade before you give up on searchkit

---
Tags: civimember, searchkit
---


# Question
Title: API error: 'afform_type' is not a valid option for field option_group_id on OptionValue.create( entity name form)"
Getting this error out of sudden: apparently the only thing changed was "CRM/Core/Payment.php" file moved to the custom php directory and a "City" field attribute changed to "not required"

> API error: 'afform\_type' is not a valid option for field option\_group\_id on OptionValue.create( entity name form)"

Indeed, 'option\_group\_id' in the civicrm\_option\_value table is of type INT, while new record creation API call looks like this:

> \[id\] =\> 1303

> \[is\_active\] =\> 1

> \[option\_group\_id\] =\> **afform\_type**

> \[name\] =\> form

> \[value\] =\> form

> \[label\] =\> Submission Form

> \[weight\] =\> 0

> \[icon\] =\> fa-list-alt

> \[version\] =\> 3

This is clearly broken but I have not a slightest clue why: nothing has been changed since yesterday.

# Answer
I found the same issue with two extensions on my site: Form core (aka afform) and Search kit.

I checked my database and in the civicrm\_managed table there were references to the option group, but the option group did not exist with the specified ID in the civicrm\_option\_group table.

To fix this issue I:

* Disabled and uninstalled Form core (ignoring any error messages about the missing option group)
* Manually removed the broken entries from civicrm\_managed, using:

`DELETE FROM civicrm_managed WHERE module = 'org.civicrm.afform';`

* Re-installed Form core

And the managed entities were then installed correctly.

The same process worked for a similar problem with the Searchkit extension.
> 4 votes

---
Tags: api, drupal-7
---


# Question
Title: Upgrade to 5.52.0 - database won't reset
I upgraded to 5.52.0. The last step was to reset the database. I got an error 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. DB Error: syntax error"

I contacted the admin and he could find nothing wrong.

Now on

../wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fa%2F#/status

it says " New codebase version detected. You must visit upgrade screen to upgrade the database."

but at the bottom of each page that usually shows red if there is a problem it now shows: Powered by CiviCRM 5.52.0. System Status: Ok CiviCRM is openly available under the GNU AGPL License.

I retried resetting the database and got the same results.

I have not been able to find any civicrm features that I use that do not work.

Any suggestions?

# Answer
I would suggest checking the CiviCRM logs for the error to get a more detailed explanation of what happened. I would also suggest the 5.52.2 patch update, in case there were any regressions.

I am assuming that you made a backup of your CiviCRM database before running this update (though this was 6 days ago), it may be worth restoring the backup and running the update again if that is possible.
> 0 votes

# Answer
I compared the mysql tables on a site that had 5.52.0 running without having a message to upgrade the database with the tables on the site that said that the database needed upgrade. I found 5 tables that had zero records on the good site that were not in the other site. I added the missing tables and now the site no longer says the database needs to be undated. Here are the tables that were missing: civicrm\_queue civicrm\_search\_display civicrm\_search\_segment civicrm\_translation civicrm\_user\_job
> 0 votes

---
Tags: upgrade, database
---


# Question
Title: Record a contribution manually over the phone?
Pretty rare situation, I would think, but I've had a few people contact us by phone to ask us to manually process a donation for them. I would have thought I could do this under "New Contribution", but it doesn't appear there is a way for me to input their payment details -- just the last 4 digits of their card... Is there a way to complete a payment in the backend admin on behalf of someone else, or do I just use the front-end form for this?

# Answer
> 1 votes
I see now that when I create a contact record, and then go to their Contribution tab there is an option for "Submit Credit Card Contribution"... Seems this should be available on the "New Contribution" page as well, but hey, at least it exists!

---
Tags: contributions
---


# Question
Title: Network Error while trying to view a contribution payment
While trying to view payment information for a contribution I get an error message popup window that says "Unable to reach the server. Please refresh this page in your browser and try again".

The url for the view payment link I am trying to access is: https://ourdomain.com/civicrm/payment?view=transaction&component=contribution&action=browse&cid=2832&id=3225&selector=1&snippet=json

If I try to go to this url directly, I get the error message:

"One of parameters (value: ) is not of the type Integer"

I tried to replicate the call using API Explorer v4 but was unable to find a browse action for the entity "Contribution".

I am still somewhat new to CiviCRM and am not sure where to go next with regards to troubleshooting this issue.

Detailed error info from ConfigAndLog:

```
Sep 01 17:38:05  [error]
$Fatal Error Details = array:3 [
  "message" => "One of parameters  (value: ) is not of the type Integer"
  "code" => null
  "exception" => CRM_Core_Exception {#2835
    -errorData: array:1 [
      "error_code" => 0
    ]
    #cause: null
    -_trace: null
    #message: "One of parameters  (value: ) is not of the type Integer"
    #code: 0
    #file: "/var/www/libertarian/vendor/civicrm/civicrm-core/CRM/Utils/Type.php"
    #line: 469
    trace: {
      /var/www/libertarian/vendor/civicrm/civicrm-core/CRM/Utils/Type.php:469 { …}
      /var/www/libertarian/vendor/civicrm/civicrm-core/CRM/Core/DAO.php:1737 { …}
      /var/www/libertarian/vendor/civicrm/civicrm-core/CRM/Core/DAO.php:1619 { …}
      /var/www/libertarian/vendor/civicrm/civicrm-core/CRM/Core/BAO/FinancialTrxn.php:35 { …}
      /var/www/libertarian/vendor/civicrm/civicrm-core/CRM/Contribute/BAO/Contribution.php:3609 { …}
      /var/www/libertarian/vendor/civicrm/civicrm-core/CRM/Contribute/Form/AbstractEditPayment.php:755 { …}
      /var/www/libertarian/vendor/civicrm/civicrm-core/CRM/Contribute/Form/AdditionalPayment.php:78 { …}
      /var/www/libertarian/vendor/civicrm/civicrm-core/CRM/Core/Form.php:668 { …}
      /var/www/libertarian/vendor/civicrm/civicrm-core/CRM/Core/QuickForm/Action/Display.php:76 { …}
      /var/www/libertarian/vendor/civicrm/civicrm-packages/HTML/QuickForm/Controller.php:203 { …}
      /var/www/libertarian/vendor/civicrm/civicrm-packages/HTML/QuickForm/Page.php:103 { …}
      /var/www/libertarian/vendor/civicrm/civicrm-core/CRM/Core/Controller.php:355 { …}
      /var/www/libertarian/vendor/civicrm/civicrm-core/CRM/Utils/Wrapper.php:98 { …}
      /var/www/libertarian/vendor/civicrm/civicrm-core/CRM/Core/Invoke.php:292 { …}
      /var/www/libertarian/vendor/civicrm/civicrm-core/CRM/Core/Invoke.php:69 { …}
      /var/www/libertarian/vendor/civicrm/civicrm-core/CRM/Core/Invoke.php:36 { …}
      /var/www/libertarian/web/modules/contrib/civicrm/src/Civicrm.php:88 {
        Drupal\civicrm\Civicrm->invoke($args)
        › ob_start();
        › $content = \CRM_Core_Invoke::invoke($args);
        › $output = ob_get_clean();
        arguments: {
          $args: array:2 [ …2]
        }
      }
      /var/www/libertarian/web/modules/contrib/civicrm/src/Controller/CivicrmController.php:80 { …}
      Drupal\civicrm\Controller\CivicrmController->main() {}
      /var/www/libertarian/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php:123 { …}
      /var/www/libertarian/web/core/lib/Drupal/Core/Render/Renderer.php:573 { …}
      /var/www/libertarian/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php:124 { …}
      /var/www/libertarian/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php:97 { …}
      /var/www/libertarian/vendor/symfony/http-kernel/HttpKernel.php:151 { …}
      /var/www/libertarian/vendor/symfony/http-kernel/HttpKernel.php:68 { …}
      /var/www/libertarian/web/core/lib/Drupal/Core/StackMiddleware/Session.php:57 { …}
      /var/www/libertarian/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php:47 { …}
      /var/www/libertarian/web/core/modules/page_cache/src/StackMiddleware/PageCache.php:106 { …}
      /var/www/libertarian/web/core/modules/page_cache/src/StackMiddleware/PageCache.php:85 { …}
      /var/www/libertarian/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php:47 { …}
      /var/www/libertarian/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php:52 { …}
      /var/www/libertarian/vendor/stack/builder/src/Stack/StackedHttpKernel.php:23 { …}
      /var/www/libertarian/web/core/lib/Drupal/Core/DrupalKernel.php:708 { …}
      /var/www/libertarian/web/index.php:19 { …}
    }
  }
]

```

# Answer
> 3 votes
Based on the stack trace it sounds like maybe the "Accounts Receivable Account" has been deleted. Look under Admin - CiviContribute - Financial Accounts. You're not supposed to be able to delete it but stranger things have happened.

OP: I checked this and saw that there were no financial accounts assigned to the financial type we were using in the affected records. I assigned some financial accounts and can now view, edit and delete those records. Thanks!

---
Tags: civicontribute
---


# Question
Title: Adding custom fields to a Drupal webform?
I'd like to create a survey via Drupal form asking supporters to note which issues they are most interested in.

We have set up a custom fields with this question and a list of assorted answers.

However, in Drupal, I see no way to add in my custom fields to the form.

What am I missing? Is there a different way to go about this?

# Answer
Click on the 'CiviCRM' tab in the webform. Down the left side of this tab you'll see the contacts for the webform (Contact 1 etc). Matching each contact on the right side of the screen are all the fields for that contact, after you've selected the contact type. You should be able to enable the custom field sets and other fields as well as groups, relationships etc - and then go on to enable the fields for the custom set. If a custom field isn't showing up here, check that it's enabled in Civi.
> 3 votes

---
Tags: drupal, custom-fields
---


# Question
Title: Search Kit - List of Events with their real total amounts
# **What we want**

We want to have a Search that shows us the upcoming Events with the Total Amount paid for each event. Something like this:

# **Our problem**

While listing the upcoming events is easy, showing what our Partipants paid for them is quite troublesome.

To be able to show what the Participants paid, we have to do it via Line Items. We constructed our Search like the following one:

What this Search shows is what the Participants should have paid, but not what actually paid.

For example, an event costs 100€, but the Participant only paid 80€. This search would add the 100€ instead the real 80€.

Our question is, how we can add the real amount instead of the cost of the event?

# Answer
I think what you want can be accomplished by filtering out transactions with an incomplete status, like this:
> 4 votes

---
Tags: civievent, searchkit, line-items
---


# Question
Title: Composer Drupal Update fails because unappliable Patch of Civicrms zetacomponents/mail
I try to update a Drupalmachine on 9.4.5 site via composer 2.4.1. `~/bin/composer.phar update drupal/core "drupal/core-*" --with-all-dependencies` (see below for composer.json)

first try i can run it and get into interactive question that drupal/coder has multiple files changed (439) and what i want to do:

```
y - discard changes and apply the update
n - abort the update and let you manually clean things up
v - view modified files
d - view local modifications (diff)
s - stash changes and try to reapply them after the update
? - print help

```

i try to choose 'yes', but unfortunately i ran into a problem that patch 86 from zetacomponents/mail can not be applied and the update crashed. This patch seemed to be merged and old composer try to install zetamail in version 1.9.3. I tried to apply the patch manually on the files, but this doesnt work either.

Here is the shortend version of the run through the update to the error. After gathering the patches it got this errormessage, that the patches doesnt apply.

```
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://github.com/zetacomponents/Mail/pull/86.patch)!

```

Like suggested I provide the composer.json:

```
{
  "name": "drupal-composer/drupal-project",
  "description": "Project template for Drupal 8 projects with composer",
  "type": "project",
  "license": "GPL-2.0-or-later",
  "authors": [
    {
      "name": "",
      "role": ""
    }
  ],
  "repositories": [
    {
      "type": "composer",
      "url": "https://packages.drupal.org/8"
    }
  ],
  "require": {
    "php": ">=7.0.8",
    "civicrm/civicrm-asset-plugin": "~1.1",
    "civicrm/civicrm-core": "5.49.4",
    "civicrm/civicrm-drupal-8": "5.49.4",
    "civicrm/civicrm-packages": "5.49.4",
    "composer/installers": "^1.2",
    "cweagans/composer-patches": "^1.6.5",
    "drupal/admin_toolbar": "^3.0",
    "drupal/civicrm_entity": "^3.0@beta",
    "drupal/console": "^1.0.2",
    "drupal/content_access": "^1.0@alpha",
    "drupal/context": "^4.1",
    "drupal/core": "^9.0.0",
    "drupal/core-composer-scaffold": "^9",
    "drupal/core-project-message": "^9",
    "drupal/core-recommended": "^9",
    "drupal/entity": "^1.2",
    "drupal/honeypot": "^2.0",
    "drupal/libraries": "^3.0@beta",
    "drupal/role_delegation": "^1.1",
    "drupal/rules": "^3.0@alpha",
    "drupal/token": "^1.10",
    "drupal/typed_data": "^1.0@beta",
    "drupal/upgrade_status": "^3.12",
    "drupal/views_aggregator": "^2.0",
    "drupal/views_data_export": "^1.1",
    "drupal/webform": "^6.1",
    "drupal/webform_civicrm": "^6.0",
    "drush/drush": "^9.7.1 | ^10.0.0",
    "howtomakeaturn/pdfinfo": "1.*",
    "vlucas/phpdotenv": "^4.0",
    "webflo/drupal-finder": "^1.0.0",
    "zaporylie/composer-drupal-optimizations": "^1.0"
  },
  "require-dev": {
    "drupal/core-dev": "^9"
  },
  "conflict": {
    "drupal/drupal": "*"
  },
  "minimum-stability": "dev",
  "prefer-stable": true,
  "config": {
    "sort-packages": true,
    "allow-plugins": {
      "composer/installers": true,
      "cweagans/composer-patches": true,
      "civicrm/composer-compile-plugin": true,
      "civicrm/composer-downloads-plugin": true,
      "civicrm/civicrm-asset-plugin": true,
      "drupal/console-extend-plugin": true,
      "drupal/core-composer-scaffold": true,
      "drupal/core-project-message": true,
      "zaporylie/composer-drupal-optimizations": true,
      "dealerdirect/phpcodesniffer-composer-installer": true
    }
  },
  "autoload": {
    "classmap": [
      "scripts/composer/ScriptHandler.php"
    ],
    "files": [
      "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": "web/"
      }
    },
    "installer-paths": {
      "web/core": [
        "type:drupal-core"
      ],
      "web/libraries/{$name}": [
        "type:drupal-library"
      ],
      "web/modules/contrib/{$name}": [
        "type:drupal-module"
      ],
      "web/profiles/contrib/{$name}": [
        "type:drupal-profile"
      ],
      "web/themes/contrib/{$name}": [
        "type:drupal-theme"
      ],
      "drush/Commands/contrib/{$name}": [
        "type:drupal-drush"
      ]
    },
    "civicrm-asset": {
      "path": "web/libraries/civicrm",
      "url": "/libraries/civicrm",
      "assets:packages": {
        "+include": [
          "kcfinder/**"
        ]
      }
    },
    "enable-patching": "true",
    "compile-whitelist": [
      "civicrm/civicrm-core",
      "civicrm/composer-compile-lib"
    ],
    "compile-mode": "all"
  }
}

```

I it save to try `"composer-exit-on-patch-failure": false` or is that safe? I find this question here but there is the Answer that the Patch is not important anymore, but no statement how to get around the Error. Also I am stuck at a place that that the update fail, regardless of the use of `composer upgrade` or `composer update`, i cant get to the \[y,n,v,d,s,?\] decision anymore. Is there a method to get the update done?

# Answer
> 1 votes
If you can upgrade civi to 5.52+ then do that.

If not you could restrict zeta mail to an earlier version, e.g. `composer require zetacomponents/mail:1.9.2`, but then remember to remove that from composer.json when you do upgrade civi later.

---
Tags: email, upgrade, composer, failure
---


# Question
Title: "The website encountered an unexpected error. Please try again later." when trying to create mailing
I'm receiving an error "The website encountered an unexpected error. Please try again later." whenever I try to create a new mailing. If I disable Mosaico and FlexMailer the CiviMail system appears to load correctly, but as soon as I reenable FlexMailer the error returns.

I updated to CiviCRM 5.52.3 earlier today, and also updated the Drupal Views and EU Cookie Consent modules, but otherwise haven't changed anything since this morning when it was working.

I've tried clearing Drupal caches, the Cleanup Caches option in CiviCRM, and deleting all files in sites/default/files/civicrm/templates\_c/. So far nothing has made a difference.

I can't see anything in ConfigAndLog with a timestamp matching when I'm trying to create a mailing.

# Answer
(because StackExchange likes Answers more than Comments)

Probably relates to conflict of having the old flexmailer extension now that flexmailer is included in civicrm core.

CiviCRM core now includes Flexmailer: how to remove old flexmailer extension?
> 1 votes

---
Tags: civimail, mosaico, flexmailer
---


title: Member Self Service

text:
# Question
Title: Member Self Service
I would like members to be able to log into our website and be able to see the relationships that are on their organization record so that they can let us know who is still there and who needs to be added. We have our relationships set up as Primary, Employer of, and Volunteer. We know there are limits with the way that our relationships are currently set up, but I was wondering if there is an extension we could look into or other ways to allow Primary Contact members to see. Thanks for any ideas.

Edit: we use Joomla

# Answer
> 1 votes
We've addressed this need by using AlterReports on our website, Brandy. Feel free to DM me, and I'd be happy to provide additional details. We use AlterReports for all sorts of views (event lists, rosters for event organizers, My Family list - the list goes on and on) as it has an amazing flexibility in terms of what you display and how. Cannot imagine running a complex Joomla website without it. You'll need some SQL knowledge, but I can share the query we built for the relationship list if you'd like. Then, we use Seblod for updating data (similar to what Webform does on Drupal). The combo of Seblod and AlterReports enables us to extend the CiviCRM functionality in unexpected ways. (E.g., AlterReports displays the My Family list, and a Seblod form allows for new relationships to be added, and existing ones updated or removed.)

# Answer
> 0 votes
Welcome to Stack Exchange, Brandy. In case you are using Drupal as CiviCRM's CMS you could probably have a look at the module"CiviCRM Entity" which provides enhanced integration with Drupal.

You should be able to find some documentation about this and Skvare has recently published some training videos / blog posts.

Obviously you could also built something using CiviCRM's API but that will likely require some development work in your CMS and/or CiviCRM.

---
Tags: civimember, extension, joomla
---


# Question
Title: Advanced Search returns contacts with current memberships even though Current Member set to "No"
When using *Advanced Search* and *'Display Results As'* is set to *"Contacts"*, I assumed that if I selected *"No"* for *'Current Member'*, it would not include contacts that had at least one active/current membership, but it turns out I was wrong. (We try our best to only keep one membership per contact, but there are sometimes circumstances where we have to keep multiple, e.g. one through a family member, where one is expired while the other one is still active.)

Is this a but or a design opinion difference?

If I set *'Display Results As'* to *"Memberships"*, then yeah, I'd expect that it'll pull the non-current memberships even though the contact may have another, active, one.

What's the easiest way to pull contacts with non-current memberships? One way I can think of is to create two smart groups: 1) Current members; 2) Non-current members ... then a 3rd one with criteria *"is part of Non-Current Members and is not part of Current Members"* ... seems like a super complex way to achieve a pretty basic use case for a CRM (i.e., how can I easily identify and send a mailing to non-current users, e.g. for a membership drive campaign).

# Answer
You should be able to do that with SearchKit. Look for contacts 'with (required)' a non-current membership and 'without' a current membership.
> 1 votes

---
Tags: search, smartgroups, search-results, advanced-search
---


title: Search Kit - related contacts query

text:
# Question
Title: Search Kit - related contacts query
Hoping for some Search Kit advice / guidance.

I have a search that brings in various contacts as outlined below:

* Contact 1 (Individual) - the volunteer - has associated custom data and a relationship to
* Contact 2 (Organisation) - has a relationship to
* Contact 3 (Service Manager)

I can bring in the first two without issues but don't seem to bring in the 3 contact when I start with the individual as contact 1 (as no relationship to 3 I suspect).

However if I flip it and start with above contact 2 (the organisation) I am able to bring in all the contacts necessary and filter contact 3 to current user only - however, I need to display custom data associated with contact 1 which I can't do when I start the search with contact 2 as the main contact.

Is there a Search Kit guru that can help as I could just miss something obvious, added the SQL for my queries below.

**Unable to bring in the service manager (to filter)**

```
SELECT `a`.`id` AS `id`, `a`.`display_name` AS `display_name`, `Volunteer__1`.`type_of_volunteer_64` AS `Volunteer_.Type_of_volunteer:label`, `Volunteer__1`.`vol_start_date_128` AS `Volunteer_.Vol_Start_Date`, GROUP_CONCAT(DISTINCT `far_contact_id_2`.`display_name` SEPARATOR "") AS `GROUP_CONCAT_Contact_RelationshipCache_near_contact_id_01_far_contact_id_display_name`, GROUP_CONCAT(DISTINCT `near_contact_id_3`.`display_name` SEPARATOR "") AS `GROUP_CONCAT_Contact_RelationshipCache_far_contact_id_01_near_contact_id_display_name`
FROM civicrm_contact a
INNER JOIN `civicrm_relationship_cache` `Contact_RelationshipCache_near_contact_id_01` ON `a`.`id` = `Contact_RelationshipCache_near_contact_id_01`.`near_contact_id` AND `Contact_RelationshipCache_near_contact_id_01`.`near_relation` = "Volunteer of"
INNER JOIN `civicrm_relationship_cache` `Contact_RelationshipCache_far_contact_id_01` ON `a`.`id` = `Contact_RelationshipCache_far_contact_id_01`.`far_contact_id` AND `Contact_RelationshipCache_far_contact_id_01`.`near_relation` = "Service Manager for"
LEFT JOIN `civicrm_value_volunteer__15` `Volunteer__1` ON `a`.`id` =  `Volunteer__1`.`entity_id`
LEFT JOIN `civicrm_contact` `far_contact_id_2` ON `Contact_RelationshipCache_near_contact_id_01`.`far_contact_id` =  `far_contact_id_2`.`id`
LEFT JOIN `civicrm_contact` `near_contact_id_3` ON `Contact_RelationshipCache_far_contact_id_01`.`near_contact_id` =  `near_contact_id_3`.`id`
WHERE (`a`.`is_deleted` = "0")
GROUP BY `a`.`id`
ORDER BY `a`.`sort_name` ASC
LIMIT 50
OFFSET 0

```

**Able to filter**

```
SELECT `a`.`id` AS `id`, `a`.`display_name` AS `display_name`, `near_contact_id_1`.`display_name` AS `Contact_RelationshipCache_near_contact_id_01.near_contact_id.display_name`, `far_contact_id_2`.`display_name` AS `Contact_RelationshipCache_near_contact_id_01.far_contact_id.display_name`, `far_contact_id_3`.`display_name` AS `Contact_RelationshipCache_near_contact_id_02.far_contact_id.display_name`, `Contact_RelationshipCache_near_contact_id_01`.`near_contact_id` AS `Contact_RelationshipCache_near_contact_id_01.near_contact_id`, `Contact_RelationshipCache_near_contact_id_01`.`relationship_id` AS `Contact_RelationshipCache_near_contact_id_01.relationship_id`, `Contact_RelationshipCache_near_contact_id_01`.`orientation` AS `Contact_RelationshipCache_near_contact_id_01.orientation`, `Contact_RelationshipCache_near_contact_id_02`.`near_contact_id` AS `Contact_RelationshipCache_near_contact_id_02.near_contact_id`, `Contact_RelationshipCache_near_contact_id_02`.`relationship_id` AS `Contact_RelationshipCache_near_contact_id_02.relationship_id`, `Contact_RelationshipCache_near_contact_id_02`.`orientation` AS `Contact_RelationshipCache_near_contact_id_02.orientation`
FROM civicrm_contact a
INNER JOIN `civicrm_relationship_cache` `Contact_RelationshipCache_near_contact_id_01` ON `a`.`id` = `Contact_RelationshipCache_near_contact_id_01`.`near_contact_id` AND `Contact_RelationshipCache_near_contact_id_01`.`near_relation` = "Service Manager is" AND `Contact_RelationshipCache_near_contact_id_01`.`far_contact_id` = "39260"
LEFT JOIN `civicrm_relationship_cache` `Contact_RelationshipCache_near_contact_id_02` ON `a`.`id` = `Contact_RelationshipCache_near_contact_id_02`.`near_contact_id` AND `Contact_RelationshipCache_near_contact_id_02`.`near_relation` = "Volunteer is"
LEFT JOIN `civicrm_contact` `near_contact_id_1` ON `Contact_RelationshipCache_near_contact_id_01`.`near_contact_id` =  `near_contact_id_1`.`id`
LEFT JOIN `civicrm_contact` `far_contact_id_2` ON `Contact_RelationshipCache_near_contact_id_01`.`far_contact_id` =  `far_contact_id_2`.`id`
LEFT JOIN `civicrm_contact` `far_contact_id_3` ON `Contact_RelationshipCache_near_contact_id_02`.`far_contact_id` =  `far_contact_id_3`.`id`
WHERE (`a`.`is_deleted` = "0")
ORDER BY `a`.`sort_name` ASC
LIMIT 50
OFFSET 0

```

As per Aidan's answer below - achievable with a later version of CiviCRM (I was on 5.49)

# Answer
> 3 votes
When you add Contact 3, select the entry 'Contact Related Contacts' that is indented under 'Contact Related Contacts' so that the relationship is to Contact 2 not Contact 1.

If you filter by 'related' you can see the options more clearly:

---
Tags: searchkit
---


title: Sending Test Emails

text:
# Question
Title: Sending Test Emails
I've just started using Civi at a new org and I cannot figure out how to send a test email. Maybe I'm missing something obvious, but I can't find a tutorial either???

Do I have to remove all the recipients and add a test list group only? I sincerely hope not!

Thanks!

# Answer
> 1 votes
At the bottom of the mailing form when you're designing it, in the middle of the bottom section, there's a spot to send a test.

---

If using mosaico there's also a test button in the top right in the mosaico editor.

---
Tags: email
---


# Question
Title: SMTP password deletes itself from Outbound Email settings
I am configuring the latest version of CiviCRM (Drupal) to use Mailgun as an external SMTP service. When I go to `Administer > System Settings > Outbound Email`, enter the SMTP credentials, and click `Save & Send Test Email`, everything works great, I receive the test email, and the masked password continues to appear in the password field. If I then go to send a mailing, my emails all bounce with the error:

> authentication failure \[SMTP: Invalid response code received from SMTP server while sending email. This is often caused by a misconfiguration in Outbound Email settings. Please verify the settings at Administer CiviCRM \>\> Global Settings \>\> Outbound Ema

When I return to the `Outbound Email` page, the masked password is now gone, and I'm unable to send another test without reentering the password. If I reenter the password and click `Save` instead of `Save & Send Test Email` the same thing happens. When I return to the `Outbound Email` page, the saved password is gone.

I didn't set up this CiviCRM installation, I'm just helping someone out with theirs. Is there a setting I'm missing that would account for this? Is it possible an overriding SMTP password is passed in as an environment variable somewhere or something?

# Answer
I was incorrect, the password is not being deleted. It just requires a certain flag to be passed to load in the existing password, which is saved in the database.
> 2 votes

---
Tags: drupal, email, smtp
---


# Question
Title: Error status cannot be calculated for start_date with no apparent reason
Similar to this thread, I'm suddenly unable to import memberships due to "status cannot be calculated for start\_date" -- the first import worked fine, but despite using the same membership type and start date that were used in the first import, the second import keeps throwing "status cannot be calculated for start\_date" on every record. I've tried editing the Membership Status Rules, then later disabling them. Nothing has worked so far. Is this a bug?

CiviCRM 5.52.0 | WordPress 6.02

# Answer
I just updated CiviCRM, and the problem appears to have been fixed. The only change I made was updating to 5.53.0, and right after I did so, my second membership import finally succeeded.
> 1 votes

---
Tags: civimember
---


title: Upgrade Fails With No Usable Error

text:
# Question
Title: Upgrade Fails With No Usable Error
I am trying to upgrade from Civi 5.31 in WordPress version 6.0.2 to 5.53. I am using the CV utility from the command line to complete the upgrade.

When I run the upgrade it shows "Upgrade DB to 5.48.1 : SQL" and then more than a line of dots and then fails.

The error shown is:

Task can not execute correctly. The wrong dispatch policy is active. Expected to find "upgrade.finish"

There are no other errors or messages given. I would appreciate any ideas on how to suss out more information to figure out why this failing.

Thanks, Josh

# Answer
There was some discussion about older versions of `cv` having trouble with 5.53. If you can upgrade `cv` and then you're still having trouble, you might want to chime in on https://lab.civicrm.org/dev/core/-/issues/3840.
> 2 votes

---
Tags: wordpress, upgrade
---


title: Search Kit search for cases and roles

text:
# Question
Title: Search Kit search for cases and roles
On search kit I am trying to create a table with case related information in it (e.g. case status, case type, country). To achieve this I have created a 'search for cases' with the relevant filters and fields. However, I would additionally like to add a column for a specific case role. Is there a way to add case roles (other than the case client) to a case search on search kit?

# Answer
I remember there being a Case Contacts entity but it seems to have gone missing. But the reverse is available - start with Contacts and then you can join on Contact Case Roles, or start with Related Contacts.

EDIT: https://lab.civicrm.org/dev/core/-/issues/3843
> 1 votes

---
Tags: civicase, roles, searchkit
---


title: Configuring Inbound Email Config

text:
# Question
Title: Configuring Inbound Email Config
I used to have CiviCRM Inbound Email processing perfectly, but now it no longer works. Whenever the process is run, I get the following error:

```
Full message:
Finished execution of Process Inbound Emails with result: Failure, Error message: A fatal error was triggered: Could not connect to MailStore for [prefix]@[domain].org@imap.gmail.com

Error message:

An error occured while sending or receiving mail. The IMAP server did not accept the username and/or password: A0001 BAD Too many arguments provided 136-v6mb280518080wmm.

```

Please help me fix the config (or if the config is correct I'll set about debugging). The password is functioning perfectly (I emptied it before taking a screenshot of the config). How can I fix this?

This is for a domain hosted by Google.

# Answer
> 2 votes
I would guess from the error "A0001 BAD Too many arguments provided" and this unrelated github issue that **you may have a space in your password** (or some other character that needs better handling).

That CiviCRM also triggers "A0001 BAD Too many arguments provided" error suggests CiviCRM doesn't handle spaces in passwords correctly for IMAP/POP3.

Here's some advice on debugging the inbound mail process in CiviCRM, which might be useful!

# Answer
> 1 votes
The config looks correct.

Key things to check:

* You can connect to the account using the credentials via the gmail web interface
* You don't have 2FA set up and that less secure apps are allowed for the account
* If the above fails try activating the unlock captcha https://accounts.google.com/b/0/DisplayUnlockCaptcha then test logging in by triggering the scheduled job. You should notice the unlock captcha page change after the log in attempt has finished - you might need to trigger the job again after it's run to connect.
* Finally I'd make sure you can connect to gmail from that server by using something like swaks or similar to connect -\> https://serverfault.com/questions/846026/can-i-send-a-mail-through-gmail-with-swaks (Just to make sure you are dealing with a civicrm issue an not a server issue).

# Answer
> 1 votes
I also needed to turn "Less secure apps" ON. More on that here: https://support.google.com/accounts/answer/6010255?hl=en

Clicking "Save & Test" on the Mail Accounts config page still resulted in "An error occured while sending or receiving mail. Failed to connect to the server: :143. (See log for more details.)" error, but triggering the "Process Inbound Emails" job actually worked flawlessly.

---
Tags: email
---


# Question
Title: How do I eliminate records in which a specific field is blank in a search?
I'm trying to eliminate records that do not have a mailing address from a list I want to export. So, how do I do a search to eliminate records in which the city field is blank?

# Answer
Welcome to CiviCRM SE, Daryl. If you have a current version you could use CiviCRM's new(ish) Search Kit to achieve that. Navigate to **Search menu » Search Kit** or /civicrm/admin/search#/list?tab=custom and create a search like in the screenshot:

Add all your other search criteria using the search kit's UI and hit search. Then select all found contacts and choose export from the action menu. You could also utilize the "Search Builder" (**Search menu » Search Builder** or /civicrm/contact/search/builder?reset=1) to do so but i would recommend the search kit as the search builder may soon be deprecated / replaced by the search kit.
> 3 votes

---
Tags: search
---


title: Deduping and Merging missing

text:
# Question
Title: Deduping and Merging missing
I am brand new to CiviCRM and trying to clean up a very messy database. I read the user guide for deduping and merging, and it made it seem like this is a built in feature I should find under contacts, but I do not have that option? Thanks

# Answer
There is a CMS (e.g. drupal/wordpress) permission for `CiviCRM: merge duplicate contacts` and you also need "Delete contacts" permission. Does your user account have those permissions?

Also try it with a search for contacts, and then from the Actions dropdown on the results page there is an option to merge contacts.
> 2 votes

---
Tags: duplicate-contacts
---


# Question
Title: How to implement authentication from a mobile app to CiviCRM?
Goal is to enable constituents to login and check their status in CiviCRM from a mobile app. Question is how to best implement the authentication from the mobile app?

Which is the recommended way, or both option could work?

# Answer
My thoughts:

1. Username/password that the user provides is likely the safest. However it obviously requires the user to remember their credentials, or have some sort of password manager. Of course you'd be relying on https to secure the user's credentials. However, if a compromise occurs, it's only for one user, not the entire system (like API key).
2. An API key is specific for each user. Therefore you'd likely end up with one "super user" that has an API key, and that key is stored in your app. Bad idea.
3. JSON Web Token seems promising, however I have yet to find documentation on how you obtain it.
4. OAuth tokens may be the most secure, however the user experience is probably the most awkward.

I would use #1 for a mobile app.

I would use #2 for a website you control that "talks" to Civi.
> 0 votes

---
Tags: mobile, oauth
---


# Question
Title: How to leverage Authentication Guard for APIv4 calls
I'm working on converting an app that was built against the REST APIv3 to use REST APIv4, and I've found the APIv4 documentation quite lacking.

Through trial and error, I've determined that Authentication Guard has to be effectively disabled (by having it configured with no options in the Authentication Extension) for CiviCRM to authenticate my call. All other options I've tried return 401 Unauthorized. (Note to others: Make sure you're using a recent version of CiviCRM. While APIv4 has existed for quite some time, the REST part of it appears to have been added around v5.47.)

There are two options that can be enabled, that are not mutually exclusive:

1. User Permission. What permission is this, and how do you add it?
2. Site Key. How do you include the Site Key in your APIv4 REST call? The format used for APIv3 does not appear to work.

My question is: How do you leverage Authentication Guard in your APIv4 calls?

Thanks.

# Answer
> 1 votes
While the documentation can be confusing, I wouldn't say it's lacking. I want to make sure you found this particular page, particularly the "Guards" section.

In APIv3, you use a site key and an API key. That API key corresponds to a particular user in the database (stored in `civicrm_contact` table). AuthX adds two new permissions - `authenticate with password` and `authenticate with api key`. The "User Permission" guard ensures that only users with one of those permissions can use the APIv4 endpoint. This is almost certainly (one of) the causes of your 401 error.

There are many formats for passing the site key now, too many to effectively answer here. Personally, I put it in the body of a POST request with a key of `key`, but you should still be able to pass it in as a GET param like in APIv3.

---
Tags: rest, apiv4, authentication
---


title: Syncing CIVI CRM and Mailchimp

text:
# Question
Title: Syncing CIVI CRM and Mailchimp
Has anyone synced CIVI CRM with a mailchimp account?

I work for a membership organisation and we need CIVI to track the data of our members and stay in control of our subscribe and unsubscribe lists. We are wondering whether anyone has used Mailchimp (or something similar) as it seems you can have more freedom with designing, but used it with CIVI so that you still have access to your mailing lists and data?

Any comments or suggestions on this would be appreciated.

# Answer
> 4 votes
There are several CiviCRM-MailChimp integrations. The two still in common use are Mailchimpsync and Mailchimp CiviCRM integration.

That said, it's been a long time since I've had a client use these for anything more than a transition period, since most are using Mosaico to get a better email template builder within CiviCRM.

The advantages are many, but primarily - Mailchimp can't send an email to everyone who attended an event in the last 90 days, or who lives within 30 miles of Peoria, or say, "Hey, your last donation was $25, could you increase that?" because it doesn't have that info available to it.

---
Tags: mailchimp, newsletter, sync
---


# Question
Title: Can I add an organisation's finance contact to the invoice
We have edited the workflow invoice template and have the name and address of the member organisation as the address block and would like to add the Member Organisation's Finance Contact display name to the address. Is there a civi token for this?

Or is there an extension that is available that could help with this?

Is this possible?

Many thanks Sandra

# Answer
It sounds like you want the Related Tokens extension.
> 1 votes

---
Tags: tokens, invoice
---


title: Error messages in newsletters

text:
# Question
Title: Error messages in newsletters
I use CIVI to send newsletters for my organisation. When the receiver opens the newsletter in the outlook app or on a mac they receive an error message. It seems to work for those opening the newsletter in Office 365 and through their browser as it doesn't appear.

The error message or error image appears as a sort of trace for the drafting of the newsletter. Where I have deleted an image or a text box in editing the newsletter, that's where the error appears.

Would really appreciate any take or tips on how to fix this!

# Answer
> 2 votes
It sounds like the images may not have been deleted properly.

To test this - create a new email, add a single line of text, then press the **Source** button on the formatting toolbar. Note how it shows the HTML equivalent. Press **Source** again to go back to normal editing.

Next, add an image, look at the new source HTML.

Finally, delete the image. Is the source HTML the same as before you added the image? If not, you may be deleting the image incorrectly. I typically backspace over it - without watching you work, it's hard to tell you what to do differently.

---
Tags: error, images, newsletter, outlook
---


title: 30 day overdue notification to staff

text:
# Question
Title: 30 day overdue notification to staff
I would like to send out either an email or better an email with a report with all those members who are 30 days overdue. I'm not wanting this to go straight to the member, but to one of my staff who will then decide who should be emailed. This would be just once a month.

Is this possible using civi rules or scheduled jobs? we use wordpress.

Any help gratefully received.

Thank you

# Answer
> 1 votes
Under Reports - Membership - Lapsed memberships, you can set up your criteria and save an instance of it. On the Email Delivery tab put the staff member email. Then you can set up the Mail Reports scheduled job to run it monthly and it will email it: https://docs.civicrm.org/user/en/latest/initial-set-up/scheduled-jobs/#job\_mail\_report

---
Tags: wordpress, civirules, scheduled-job
---


title: Will civicrm support in Laravel

text:
# Question
Title: Will civicrm support in Laravel
I am familiar with Laravel but integrating CiviCRM was new to me. Is it possible to integrate the CiviCRM in Laravel?

If yes can anyone provide the steps to integrate?

Thanks in advance

# Answer
CiviCRM does not use Laravel libraries, and predates Laravel. In theory you could create a project that does both, but that is almost certainly not going to give you the results you want. You're best off using CiviCRM without Laravel.

Note that Laravel and CiviCRM both incorporate elements of Symfony, so you will find places where your knowledge will be helpful.
> 2 votes

---
Tags: php, civicrm.settings.php
---


# Question
Title: Why does civicrm_postProcess hook does not pass certain parameters?
Only the "$formName" variable is getting supplied to the hook callback. Why are the rest of the variables listed in the documentation not getting supplied?

```
add_action('civicrm_postProcess', 'onFormSubmit');

function onFormSubmit() {
    $args = func_get_args(); // Returns ["CRM_Contribute_Form_Contribution"]
}

```

https://docs.civicrm.org/dev/en/latest/hooks/hook\_civicrm\_postProcess/

# Answer
add\_action defaults to 1 param: https://developer.wordpress.org/reference/functions/add\_action/
> 1 votes

---
Tags: wordpress, hooks, validation, actions, webhook
---


title: CiviEvent: archive and duperules

text:
# Question
Title: CiviEvent: archive and duperules
we want to use CiviEvents, but there are still two big problems:

1. Past events are not shown. Is there any kind of archive that can be switched on?
2. Every entry of a participant will overwrite the data in the contact fields. How can we provide this? What kind of duperules should we use?

Does anybody can help?

Thanks und kind regards, Regina

*CiviCRM 5.49.5. | WordPress 6.0.2 | German NGO*

# Answer
If you go to Events - Manage Events, you can search by date range to find old events (or all events if you don't enter a date range). I don't think there is a publicly-accessible view of past events out of the box, but you could do something with Drupal CiviCRM Entity, for example.

Usually, first name, last name and email is a good conservative dedupe rule to use that will avoid any overwriting of contact details.
> 0 votes

---
Tags: civievent
---


# Question
Title: What's the best way to create a multi-page survey in Civi?
We'd like to survey our supporters with a Typeform-esque survey (simple questions, one per page). We'd also like to create a page within Civi so all the information is in one place.

Is there a good way to do this?

# Answer
> 2 votes
There has been talk of supporting multi-step forms and wizards in FormBuilder. If you're interested in sponsoring that improvement, please get in touch on https://chat.civicrm.org/civicrm/channels/dev-afform

---
Tags: civisurvey
---


# Question
Title: Trigger CiviRule based on contribution receive date with field value comparison relative to today
I'm trying to trigger a CiviRule when a contribution is created with a receive date earlier than today, using field value comparison, but I don't seem to be able to get this to work. According to this previous question, I should be able to use yesterday, -1 day and similar, but none of these options are working for me. Has anyone else been able to get something along these lines to work?

The field value comparison appears to be working:   but the rule is never triggered.

I'm seeing a warning logged, but it doesn't seem directly related: \[warning\] Attributes passed to CRM\_Core\_Form::add() are not an array. Caller: CRM\_CivirulesConditions\_Form\_ValueComparison::buildQuickForm Array ( \[civi.tag\] =\> deprecated )

# Answer
> 0 votes
Not sure what the problem is but you should be a able to debug the isConditionValid function in the generic form value comparison and that should tell you what the problem is?

---
Tags: civirules, fieldvaluecomparison
---


# Question
Title: What can I do when the reset password function isn't working?
I have a CiviCRM account. I've forgotten my login and password. I tried to use the reset password feature and entered the email address associated with my account. I didn't get an email to reset the password though. In Outlook, I've checked the junk folder and the "other" tab of the inbox, as well as doing a search of my entire email, but can't find an email from CiviCRM. Is there another way I can resent my password or get help with logging in?

# Answer
> 1 votes
Welcome to SE!

I'm guessing you are talking about an account on your organisation's CiviCRM system. If the password reset link is not working you will need to contact the administrators of that system.

Or do you mean you are the admin and have lost access?

Alternatively do you mean an account on civicrm.org?

Or maybe an account on CiviCRM Spark?

---
Tags: passwords
---


# Question
Title: Error when trying to delete custom fields
I'm not sure if it's a bug but when I try to delete a custom field it shows me a loading **screen that never finishes**.

Additionally if I enable this custom data set for the contact and if I need to see the contact it shows me the following **error**

PEAR\_Exception: DB Error: no such field in /bitnami/wordpress/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

```
 0    CRM_Core_Error::exceptionHandler()  /bitnami/wordpress/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php:922
 1    PEAR_Error->__construct()   /bitnami/wordpress/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB.php:997
 2    DB_Error->__construct() /bitnami/wordpress/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php:575
3 PEAR::_raiseError() /bitnami/wordpress/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php:223
4 PEAR->__call()  /bitnami/wordpress/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/common.php:1928
5 DB_common->raiseError() /bitnami/wordpress/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/mysqli.php:936
6 DB_mysqli->mysqliRaiseError()   /bitnami/wordpress/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/mysqli.php:406
7 DB_mysqli->simpleQuery()    /bitnami/wordpress/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/common.php:1234
8 DB_common->query()  /bitnami/wordpress/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php:2696
9 DB_DataObject->_query() /bitnami/wordpress/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php:1829
10    DB_DataObject->query()  /bitnami/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php:472
11    CRM_Core_DAO->query()   /bitnami/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php:1637
12    CRM_Core_DAO::executeQuery()    /bitnami/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/CustomGroup.php:783
13    CRM_Core_BAO_CustomGroup::buildTreeEntityDataFromQuery()    /bitnami/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/CustomGroup.php:732
14    CRM_Core_BAO_CustomGroup::buildEntityTreeSingleFields() /bitnami/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/CustomGroup.php:621
15    CRM_Core_BAO_CustomGroup::getTree() /bitnami/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Contact/Page/View/Summary.php:53
16    CRM_Contact_Page_View_Summary->preProcess() /bitnami/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Contact/Page/View/Summary.php:77
17    CRM_Contact_Page_View_Summary->run()    /bitnami/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:319
18    CRM_Core_Invoke::runItem()  /bitnami/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:69
19    CRM_Core_Invoke::_invoke()  /bitnami/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:36
20    CRM_Core_Invoke::invoke()   /bitnami/wordpress/wp-content/plugins/civicrm/civicrm.php:1199
21    CiviCRM_For_WordPress->invoke() /opt/bitnami/wordpress/wp-includes/class-wp-hook.php:307
22    WP_Hook->apply_filters()    /opt/bitnami/wordpress/wp-includes/class-wp-hook.php:331
23    WP_Hook->do_action()    /opt/bitnami/wordpress/wp-includes/plugin.php:476
24    do_action() /opt/bitnami/wordpress/wp-admin/admin.php:259

```

# Answer
The custom field wasn't created properly at the initial stage hence it is causing problems to delete now.

If you have access to the database you can delete using below query

```
DELETE FROM civicrm_custom_field WHERE id = 123;

```

Replace 123 with custom field ID

HTH

Pradeep
> 0 votes

---
Tags: wordpress, contacts, custom-fields
---


# Question
Title: How can I search for contacts without a specific Activity Type?
I have created an Activity Type "Ceremonial" to attach to Contacts via Cases, which I am using to track qualifications we have awarded, honours we have granted and Fellows that we have admitted to membership. Each has an opportunity for ceremonial admission to the organisation. I am now trying to find those Contacts with Cases of Status="Successful" to which an Activity "Ceremonial" needs to be attached (so we can track whether the Individual has participated in a Ceremonial for their Award). I have attached the Activity to some Cases as they have been processed, but not all, and so want an efficient method to identify the rest.

# Answer
> 1 votes
You can do it with search kit as below. The key part is the "With (Optional)" for the activity restricted by type and then the "activity id is empty" in the where clause. Obviously use "Ceremonial" instead of Meeting for the activity type, and you can add case status = Successful in the where clause.

As an aside, one of the earliest features in civicase was an "audit" feature that was meant for this kind of thing - finding and acting on cases where part of the workflow was incomplete. But it was a bit of an experiment and never panned out.

---
Tags: civicase, activities, search
---


title: Search by custom field with searchkit

text:
# Question
Title: Search by custom field with searchkit
Is it possible to search contacts by custom fields with SearchKit ? I can't find a way to do it.

I need to list contacts where

```
Contact Subtype = "parent" and "has a relationship with a child" => this is working
    OR
Contact Subtype = "parent" and "Custom field::School name=XXX" => I can't find how to do this

```

(In the result table, I can successfully add the custom fields, but I can't use them in the query)

Any thoughts ?

# Answer
> 1 votes
Worth checking to see if your db might need an update running as some extension or core upgrade can require the db to have the upgrade run also.

---
Tags: searchkit
---


# Question
Title: CDN Tax Receipt, attach receipts to automated workflow messages ... sometimes?
Is there a way to send out automated cdn tax receipts, but only selectively? e.g. if a site has options for cc and ach/eft, then only send them out immediately for cc?

Or, in the case of the client who's asking, they're interested in not sending them out for larger donations, and also not for recurring donations (so that they can send out a single one at the end of the year)?

I think that answer is no, but it seems to me that it should be possible without too much work, analogous to how there's an advanced setting for deciding whether a contribution is tax receiptable.

# Answer
> 1 votes
Maybe not exactly what you're looking for, but it could be done by turning off the setting, and then having a home-made script run periodically and send receipts for contributions based on criteria of your choosing (basically the same code you would have to write to put in a hook if it existed, plus the call to send the email).

---
Tags: civicontribute, cdn-tax-receipts
---


title: Custom validation on contribution form?

text:
# Question
Title: Custom validation on contribution form?
I'm trying to implement some custom validation on a contribution form on WordPress.

I have this in my functions.php:

add\_filter( 'civicrm\_validateForm', 'validate\_org\_form', 10, 4 ); function validate\_org\_form($formName, &$fields, &$files, &$form, &$errors) {

But I get an error when the form submits:

Uncaught ArgumentCountError: Too few arguments to function validate\_org\_form

So it looks like this hook doesn't work the same for contribution forms as it does for others.

What I'm trying to do is check if an organisation already has a membership when a user is contribution on behalf of an organisation. I want to run an API call to check for memberships of the same type and fail the contribution with a message if any exist.

# Answer
The callback receives 5 params, so your code should read:

```
add_action( 'civicrm_validateForm', 'validate_org_form', 10, 5 );

```

BTW it's syntactically preferable to use `add_action` since there's nothing returned by the function as there is with `add_filter`.
> 1 votes

---
Tags: wordpress, civicontribute
---


# Question
Title: Formatting a profile in WordPress and civiCRM 5.52
I created a profile for signing up for our newsletter. Everything works fine but the format is terrible. The black backdrop is a matter of the WordPress theme but

1. I don't want the links in the menu at the top left. These must be generated by civiCRM since I have menus turned off in WordPress.
2. the SAVE and CANCEL button seem to be generated by civiCRM and I would like to center these.

Where in civiCRM do I find controls for 1 and 2 above?

# Answer
CiviCRM provides basic styling of forms, but it's up to you to style them to your satisfaction in your theme, child theme or custom plugin.

I can't see any "links in the menu at the top left" in your screenshot, so can't advise on that.
> 1 votes

---
Tags: wordpress, profile
---


# Question
Title: On contact : change history (logging) is empty
On contacts, the "Change log" tab is empty. It used to show the contact fields updated, with previous and new value.

I checked the following :

* I have enabled **logging** at Administer - System Settings - Misc.
* Contact Reports - Contact Logging Report (Summary) : works fine

Any idea why I can't see the change history on the contact page, although I can see it in a report ?

# Answer
> 1 votes
Check the browser dev tools console/network tabs. I'll bet there's an error listed there.

---
Tags: logging
---


# Question
Title: Unable to run civi database upgrades through UI
I would very much like to upgrade my version of civi to the latest secure version, but every time I attempt to do so I get stuck at the section of running the database update.

The "CiviCRM System Status" page has a row that reads "New codebase version detected. You must visit upgrade screen to upgrade the database" but if I click the "visit upgrade" link, the resulting page still says "DB Error: unknown error".

As far as I can tell from the logs, it looks like the fatal errors are caused by `CRM_Upgrade_Incremental_MessageTemplates->updateTemplates()`, and seems to be coming from a database query that looks something like `"UPDATE civicrm_msg_template SET msg_html = '...' "`

I haven't actually succeeded in loading the update page, let alone started running the update, so I'm not sure why it looks like the update is running (and failing?) but even so - I do eventually need it to be able to run!

I can successfully run the update using the command `drush civicrm-upgrade-db` but since I don't have drush installed on my production server, I will never be able to update my production site if we can't figure out what's wrong with the UI, or find another way to run the updates.

A thought: Most CMSes already have a robust system for running updates. I don't know why civi isn't using that already, but since the civi UI is broken, I wonder if it would be possible to use the working system update UI to trigger the civicrm database updates? Has anyone tried to write update hooks that trigger civi updates?

For reference:

* old civi version is 5.47.3
* new civi version is 5.53.0
* CMS is Backdrop CMS

# Answer
> 2 votes
I've experienced issues occasionally upgrading the database in the UI but succeeding in command line for the same upgrade so you could try that route if you have cv installed.

```
cv upgrade:db -vvv

```

---
Tags: upgrade, backdrop
---


# Question
Title: concatenate two fields and copy to another one
For each contacts of a given sub type (subtype = child) we need to concatenate to set the external identifier as the concatenation of lastname & first name. We are doing this by exporting to excel, concatenate in excel and then import. It works but is time consuming and cannot be scheduled to run every 24 hours for example.

Is there a way to

1. set external identifier = concatenate(Last name, First name)
2. run this periodically in some way, or even better : each time firt or last name is modified ?

# Answer
> 0 votes
You will need to implement api and/or hook to update via cron job and/or when contact is updated via custom extension

---
Tags: contacts
---


# Question
Title: Tips for troubleshooting email performance
Tips for troubleshooting email performance.

I have a CiviCRM instance that currently sends 800 emails an hour and I have the feeling that it can do better. Some details.

* CiviCRM 5.51.3
* The CMS is Drupal 9.
* The mail is sent by SMTP to AmazonSES (The Paris data-center is used, and port 587)

The CiviMail Settings are as follows:

The cron starts 4 times per hour. So, it is ready for 2000 emails.

The mailing process keeps the server busy. There is a long-running PHP process that asks 25% processor time, and MySQL needs 15%.

The SMTP server sometimes emits the following error.

```
(code: 451, response: 4.4.2 Timeout waiting for data from client.)]

```

This suggests that Amazon is fast enough and waits for CiviCRM. It also bothers me a bit, and that is why the database update rate is 1 (to prevent double emails).

The sending limit for Amazon is 50 mails a second (with a maximum of, 100000 a day).

Has someone tips, how to troubleshoot this? I already disabled the custom tokens, unfortunately without impact.

# Answer
> 2 votes
I found the culprit. It was CiviRules. In the system, a rule configured on activity with a complicated test. For every e-mail sent, a mass mail activity is created and the activity rule fires. Disabling the rule did speed up the email job.

# Answer
> 0 votes
We usually get around 6000 per hour through AWS, with the following settings and a cron job running every ~5 minutes:

Perhaps try a lower throttle time? I don't think the batch size should be much different between 400 and 500, but I do recall some performance improvement from reducing it in the past.

# Answer
> 0 votes
Our problems started in April of 2022. when we upgraded to 5.48.0 from 5.46.3. That's when we had to start batching or the entire process would hang.

(Embarrassed to say I have been using the Drupal Cron and so just runs 1x/hour, which I need to fix.)

---
Tags: civimail, performance, amazon-ses
---


title: Reassign Role in Multiple Cases

text:
# Question
Title: Reassign Role in Multiple Cases
What is the best way to reassign a case manger for multiple cases in CiviCase? For example, a case manager is leaving the organization and we need to reassign these cases to a new person. I can go to each case and reassign the case role, but I'm wondering if there's another way this can be done in a bulk process.

I'm thinking maybe one possibility is to place all the cases into a group and then adding a "new relationship" through Manage Groups. Then I guess disabling the previous relationships manually through the person's contact record.

# Answer
> 3 votes
Okay, so this is a bit of a workaround but it does the job.

1. In Drupal 7 Views or SearchKit, you can build a table that shows all case relationship that are active for a specific case manager (filter by case type and/or case relationship if needed). The columns you want are: case\_id, contact a (the client), contact b (the old case manager), relationship type a-to-b, case start date, and case end date. You will want to export this list on a spreadsheet.
2. Next, assign an "End Date" to all the cases. This step will disable the active relationships and put an case "end date". If you are doing this in Drupal Views, get the "Views Bulk Operations VBO" module so you can modify the entities. Set active relationship = 0 and specify case end date.
3. Lastly, use the spreadsheet you downloaded to create a CSV import to CiviCRM. The columns should be something like: civicrm\_relationship\_type, case\_id, contact\_id\_a, contact\_id\_b, and case\_start\_date. This allows you to make a new relationship for the client (client\_id\_a), for a specific case (case\_id), to a new staff (contact\_id\_b) with a case start date (case\_start\_date).

---
Tags: civicase, roles
---


title: How can I remove obsolete extensions?

text:
# Question
Title: How can I remove obsolete extensions?
Both Afform and Api v4 are indicated as obsolete extensions, but there is no "uninstall" button.

How to remove APIv4 extension seems to indicate that you should manually delete the extension directory and remove the entry from the database.

Is there no other, perhaps more, "safe" way to remove extensions?

Or should we just write that down to bad practice on the part of the extension developer?

# Answer
Unfortunately no, that's the only way to do it, Or should have uninstalled the extension prior to CiviCRM upgrade
> 1 votes

---
Tags: extension, delete
---


# Question
Title: Event Person who Books Doesn't Attend Attend
At our events the person who registers multiple people isn't necessarily going to attend the event. Is there a way that I can allow for this so they don't become registered as part of the process of online payments?

# Answer
You can always register other contacts from the event registration page. It is not mandatory to be a current user.

In CiviCRM 5.54 each participant can be tracked by which user registered the contact for the event.
> 2 votes

---
Tags: civievent, civibooking
---


# Question
Title: Civi Event Invoice goes to everyone - I only want it to go to the first person
Is there any way that I can have automated invoices going only to the person who's registering multiple contacts rather than every contact email? We allow multiple registrations and one person will pay (the first person registered). with the confirmation, which we do want everyone to get, they are also all getting a copy of the invoice receipt which we only want to go to the person registering everyone.

Thanks in advance.

# Answer
Civi Sends emails and receipts to all the participant registrants by default. To avoid sending invoice will need bit of custom coding.
> 2 votes

---
Tags: civievent, invoice
---


# Question
Title: How to allow self-service updates of recurring contribution credit card details with IATS?
Is it possible to use a message template to send an email reminder asking recurring donors to update their credit card when it fails?

# Answer
> 3 votes
This works for us using IATS Payments Extension, not sure how it would be applied with other payment processors. Fuzion tokens is also required for the {contribution.latest\_recur\_contribution\_id} token.

Simply send contact this link: /civicrm/contribute/updatebilling?reset=1&crid={contribution.latest\_recur\_contribution\_id}&{contact.checksum}

---
Tags: recurring-contributions, iats
---


# Question
Title: Using CiviRules to create a Case on a Contact record
I'm trying to use CiviRules in WordPress to create a new Case for contact records using a Field Value Comparison (when a custom data field "is not empty").

My test cases are confirming that the rule is executing and certain other rule Actions are being applied (e.g. adding the contact to a Group), but the Case is not being created on the Contact record.

There is a log entry that is added each time the rule executes that I believe is related to why the Case is not being created, but I am not sure how to interpret it.

It's an error message that says Rule: 'Test Rule' with id xx failed for contact xxxxx because of Failed to execute action.

For more detail, here is the Context section of the error message:

```
(
    [rule_title] => Test Rule
    [original_error] => Civirules could not fund case: Expected one Case but found 0. API call: Case.getsingle with params: contact_id="xxxx", case_type_id="3", status_id="1"
    [reason] => Failed to execute action
)

```

Any insight that can be provided about places to look for additional information or things I possibly may not have configured properly would be very helpful.

# Answer
I would debug the Field Value Comparison (class CRM\_CivirulesConditions\_Generic\_ValueComparison and function isConditionValid) to check if the condition is OK.

What CiviRules action are you using to create the case?
> 1 votes

---
Tags: wordpress, civicase, civirules
---


# Question
Title: Bounce processing is not switching the Primary email after marking an Email "On Hold"
Our CiviCRM system has bounce processing setup. It appears to be correctly pulling the emails from the mailbox we setup. The issue is that once it marks a users profile as "On Hold", it is not automatically switching to a new Primary email. As I understood bounce processing, there is a threshold number of bounces that gets reached before marking the email as "On Hold" and switching the Primary. Am I missing a setting somewhere? Is there a way to bulk update all the "On Hold" emails to their alternative emails (when available)?

# Answer
> 2 votes
Not a simple solution, but the best I've found to this long-time annoyance. Using Searchkit, you can set up a saved search for contacts with a primary email on hold bounce, who have a second email address that is not on hold. Then use an unequal field transformation, so you'll only see the secondary email addresses that are different than the primary ones.

You can add a table which will sort these descending on the second email field, so you'll see the contacts with a viable second email on the top of the search results and with an edit in place column for Primary for the second email, so you can make the switch right on this table. Would be ideal if this happened automatically, but in the meantime, this is the least painful solution that I've found.

---
Tags: civimail, bounce, bounce-processing
---


# Question
Title: Is it OK to change a contact hash in order to invalidate all checksums for that contact?
Sometimes, someone makes a mistake and sends out a personalized link in a mailing with their contact id and checksum, which is not great. In the past, I've simply created a duplicate contact and merged the old contact into the new one, with the result that the old contact id is no longer valid — which solves the problem.

But seeing that one can change the contact hash via API4, I wonder if there is any reason not to just change the hash to some other 32-character hexadecimal number, invalidating all checksums for that contact? Or in other words, is the hash used anywhere else beyond just creating and validating checksums?

There is an invalidate checksums hook, but that's not really practical for a one off.

# Answer
I'm about 98% sure it would be fine to change the hash. Maybe make a note of the original hash just in case.
> 1 votes

---
Tags: checksum, contact-hash
---


# Question
Title: Server access error for event registration with credit card
I have a paid event set up for front end registration (Joomla). When "pay later" is used it works fine but when a credit card is used (Stripe processing) the user gets an "Internal server error" message.

Edited to remove all of the logging that was misleading and to add the logging which helped.

In the ConfigAndLog cache

```
Sep 25 21:11:40  [info] $IDS Detector Details = Array
(
    [0] => Array
        (
            [name] => mp_52e5e0805583e8a410f1ed50d8e0c049_mixpanel
            [value] => {"distinct_id": "182a8fbd1b8e23-08597f4ac8da3f-1b525635-157188-182a8fbd1b91e3","$device_id": "182a8fbd1b8e23-08597f4ac8da3f-1b525635-157188-182a8fbd1b91e3","$initial_referrer": "$direct","$initial_referring_domain": "$direct"}
            [page] => /index.php?option=com_civicrm&task=civicrm/ajax/rest&Itemid=484

.....

   [1] => Array
        (
            [name] => IDS_request_uri
            [value] => /index.php?option=com_civicrm&task=civicrm/ajax/rest&Itemid=484
            [page] => /index.php?option=com_civicrm&task=civicrm/ajax/rest&Itemid=484

    .....
Sep 25 21:11:40  [error]
$Fatal Error Details = array:3 [
  "message" => "You do not have permission to access this page."
  "code" => null
  "exception" => CRM_Core_Exception {#1613
    -errorData: array:1 [
      "error_code" => 0
    ]

```

# Answer
Okay there were a lot of distractors but in the end what seemed to solve the server error was to give the public access to ajax via the Joomla ACL settings.
> 1 votes

---
Tags: civievent, joomla, stripe
---


title: amp config test site giving error

text:
# Question
Title: amp config test site giving error
I am new to buildkit, I tried running amp config and it looks like the amp test works properly after following the buildkit documentation. It said 'received expected response' in the terminal when I ran amp test but localhost:7979 gives me an error:

> Error: Expected GET or POST value 'exampleData=foozball' Error: Failed to write /Users/varshanayanar/.amp/canary/data/IFZK6GOETKf28HsBKdBng9FcQs1ppSGz/example.txt Error: Failed to remove /Users/varshanayanar/.amp/canary/data/IFZK6GOETKf28HsBKdBng9FcQs1ppSGz/example.txt.

I am running this on a Mac. Below are the amp config details:

```
db_type:mysql_dsn ,
mysql_dsn : mysql://root:root@localhost:8889 ,
perm_type:worldwritable,
hosts type:file,
httpd_type :apache24,
httpd_visibility:local,
httpd_restart_command : /Applications/MAMP/Library/bin/apachectl graceful,

```

I have also added IncludeOptional to the Apache configuration file. Can anyone tell what I am doing wrong here?

# Answer
Do you mean if you access localhost:7979 in your browser? I think that's expected, this port is just for amp testing in the specific way that amp tests by sending data. I get the same on my Mac.

Are you trying to access a site that you set up with buildkit? I believe it is set up by default on port 80. You can check in home/.amp/apache.d/ where there will be a configuration file. For some reason, I've had trouble accessing mine in Chrome (I get the default Apache page), but it works in Firefox.
> 0 votes

---
Tags: civicrm.settings.php, civicrm-buildkit
---


title: Invalid Entity Filter in CiviGrant

text:
# Question
Title: Invalid Entity Filter in CiviGrant
I'm running the latest version on WordPress. When I tried several times to add a grant, the following error showed:

```
CRM_Core_Exception: Invalid Entity Filter in /public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/CustomGroup.php on line 485

```

I did add a few grant types and disabled the originally installed ones. Could that be the issue?

Thanks!

# Answer
> 3 votes
I had this issue just now as well, the full error was:

```
CRM_Core_Exception: Invalid Entity Filter in CRM_Core_BAO_CustomGroup::validateSubTypeByEntity() (line 651 of /var/www/html/sites/all/modules/civicrm/CRM/Core/BAO/CustomGroup.php).

```

If you look at the code, you can see that subtypes of entities have to be integers (with the exception of contacts, which appear to have been grandfathered in).

What that means is that when you create a new grant type, you can choose the label and the description, but you shouldn't override the "value" field, which will get auto-populated as the next available integer (for that 'option group'). Or, if you do, you can only choose a numeric value.

Or at least, you have to follow this rule if you want to create custom field groups which are restricted to these grant types. And you probably want to do it anyway.

---
Tags: civigrant
---