# Question
Title: How to target Drupal CSS Injector rule at a CiviCRM profile, using query string paramters
I want to target a Drupal CSS Injector rule at a specific Civi profile, using the query string parameter that identifies the profile.

There is a section in the CSS Injector dialogue 'Add the CSS on specific pages'. It's v easy to use 'add on only the listed pages' with a path and wildcards as required, but that can't target a specific profile. For that I'm imagining I could use the option 'Add if the following PHP code outputs a nonzero value' to target a specific profile by using the profile id in the query params.

I assume that could work - ? The problem is this is very difficult to test because any mistake in the php will irretrievably break the entire site.

Does anyone have an opinion on whether this is a correct or sensible thing to be attempting and/or a working example of using the nonzero php option?

PS I know I could add targeted css via the Drupal theme, but if I could do it via the UI that would be very much easier in my current setup.

# Answer
> 1 votes
It's certainly something you can do, but as you probably realize it's fragile, hard to maintain and hard to test, so not a great idea if you can avoid it. You could do something like:

`<?php $url = request_uri(); if (strpos($url, "civicrm/profile/create?gid=NNN")) { return TRUE; } ?>`

# Answer
> 1 votes
To answer my own question, I looked a bit harder and found that there is a suitable css class in the html:

\<div class="crm-contribution-page-id-6 crm-block crm-contribution-main-form-block" data-page-id="6" data-page-template="main"\>

this class: crm-contribution-page-id-6

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


title: contact.id token not working in email

text:
# Question
Title: contact.id token not working in email
I used to have no problem having a link in an email like

...signup.php/reply={contact.id}

Today the token does not fill with the recipient's id.

The same email has

Dear {contact.first\_name},

that works.

Any suggestions?

# Answer
> 0 votes
If the link has {contact.contact\_id} rather than what the token dropdown gives {contact.id} The link fills as before.

If you look at old email that worked now get the message: "Deprecated: Deprecated function CRM\_Utils\_Token::getTokenDetails, use If you hit this in mailing code you should use flexmailer - otherwise use the token processor. in /home/mastersu/public\_html/wp/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php on line 1087"

Anybody know what we should do now?

---
Tags: civimail, tokens
---


title: CiviRule not triggering

text:
# Question
Title: CiviRule not triggering
I am trying to setup a rule to notify donors and staff when a payment fails, but for some reason I can't get the trigger to work. Trigger is "contribution added" and condition is "contribution status = failed" (we use moneris for online payments and it does add a contribution record with status failed)

In the email message there are 2 "from" fields. I can manually type an email in one, the other is a drop-down list. However, only one email shows in the drop-down when we have dozens saved in the FROM email addresses setup.

# Answer
> 2 votes
Changing the trigger to 'contribution is changed' seems to have worked.

---
Tags: civirules
---


title: Smarty code in email message subject

text:
# Question
Title: Smarty code in email message subject
I know nothing about smarty (it's on my to do list to start learning!) and I'm wondering if it is possible to do something like this in the message subject (or message body) of a bulk email:

If {contact.first\_name} is blank
Then "Friend" else {contact.first\_name}?

# Answer
You will need to set CIVICRM\_MAIL\_SMARTY to 1 in civicrm.settings.php file to execute smarty logics. And then can use below code in your message template

```
{capture assign=contactName}{contact.first_name}{/capture}
{if $contactName}{$contactName}{else}{ts}Friend{/ts}{/if}

```
> 3 votes

---
Tags: civimail, smarty
---


title: new Contribution triggers send invoice

text:
# Question
Title: new Contribution triggers send invoice
Our Drupal web form is connected to CiviCRM and creates a new contribution. I want to automatically trigger civi to send an invoice based upon the new contribution as soon as it has been created. The contribution has the status "Pending". The invoice should be attached (as a PDF) to the email sending the invoice. I know how to do this manually. How can I configure Civi to do it automatically?

I looked at CiviRules but could not construct a condition that worked. Also looked at Schedule Reminders

What am I missing?

Using Drupal 8 / CiviCRM 5.45.3

This is not about sending a receipt or a thank you. I know how to configure them for automatic sending.

# Answer
> 1 votes
If you install the PDF API extension (on an installation where CiviRules is installed) you will get the possibility to use the Send PDF action in CiviRules. You can then create an invoice template and use that?

# Answer
> 0 votes
The CiviRule action to create an invoice doesn't exist, it would need to exist before this was possible.

---
Tags: contributions, invoice, automation
---


# Question
Title: Blank screen when using versafix-1 templates
This weekend I migrated my site from one server to another. The htdocs remained the same, just the infrastructure was upgraded. I backed up my sql database and files and restored them in the new location. No paths locally or via the internet changed. Only the IP address of the server. PHP and MySQL were upgraded but only by point releases (ie. 7.3 and 8.0 were the core).

After the migration it seems that I cannot create any new mailings in Mosaico using the versafix-1 template nor can I reuse existing emails based on this template. What is weird is I can use the template tedc15 and tutorial. When I select versafix-1 it goes to a blank grey screen.

Console errors:

```
TODO error!!! Trying to set a new default value for bodyTheme longTextStyle.linksColor while it already exists (current: #3f3f3f, new: #ccc)

declarations.js:130 Model ensure path failed undefined name -ko-color value @longTextStyle.linksColor default #ccc element undefined

parser.js:403 Exception while parsing the template Exception parsing expression @longTextStyle.linksColor TypeError: Cannot read property 'longTextStyle.linksColor' of undefined

parser.js:403 Uncaught Exception parsing expression @longTextStyle.linksColor TypeError: Cannot read property 'longTextStyle.linksColor' of undefined

admin.php?page=CiviCRM&q=civicrm/mosaico/iframe&snippet=1:1 Uncaught ReferenceError: pagespeed is not defined
    at HTMLImageElement.onload (admin.php?page=CiviCRM&q=civicrm/mosaico/iframe&snippet=1:1)

```

Here's what I've done to troubleshoot:

Reinstalled Mosaico:

* Uninstalled Mosaico
* Deleted the Mosaico directory from the ext folder of my server
* Downloaded a fresh copy of Mosaico from the CiviCRM website
* Installed Mosaico

Upgraded to the latest version of ImageMagick (also made sure the extension was not commented out)

Verified file permissions (I actually set everything to 777 inside the wp-content/uploads/civicrm directory for testing)

Disabled Asset Caching

Verified Resource URLs and Directories (both set to \[civicrm.files\]/ext/)

Can anyone help shed some light on what's going on here?

Many thanks for your help!

# Answer
For reasons that I am still unsure of, I needed to apply the mosaico-php-backend script located here: https://github.com/markalston/mosaico-php-backend

I did change operating environments from Ubuntu to Debian so something on the backend may have been different but regardless, applying this script fixed my issue.
> 2 votes

# Answer
Came across this question when looking for the same problem. For me, the answer was to directly change the metadata for the template in the database. It is found in civicrm\_mosaico\_template.

I can't see why the metadata needs to include the full URL rather than a more portable relative path!
> 1 votes

---
Tags: mosaico, templates
---


# Question
Title: How can I upload the Cvisualize extension to my Civicrm?
Good morning,

I'm new to Civicrm and I'm hooked! I'm trying to upload an extension ( cvisualize) for all the reports and I don't know how to do it. I go to the extensions menu and in "Add New" I get a list that does not include Cvisualize. I have downloaded the .zip from the civi website, but I don't know how to upload it. I work with woocomerce. Can someone help me?

Greetings to the community, you are awesome!

# Answer
> 2 votes
It should be in the Add New list, but note that list is unordered - try CTRL-F to find it in the page.

But if you want to do it manually, you can unzip it into the wp-content/uploads/civicrm/ext folder.

More information: https://docs.civicrm.org/sysadmin/en/latest/customize/extensions/#installing-a-new-extension

---
Tags: extension
---


title: Domain Address Change

text:
# Question
Title: Domain Address Change
I am looking to send a Mailing out, and unfortunately, it looks like the domain address has been changed and is incorrect. The Domain Address populates to San Antonio Texas vs. Oakland California. How can I change the domain address to be from California?

# Answer
It's under Administer - Communications - Organization Address.

More information: https://docs.civicrm.org/user/en/latest/initial-set-up/installation-and-basic-set-up/#organization-address-and-contact-info
> 2 votes

---
Tags: civimail
---


title: very slow in sending emails

text:
# Question
Title: very slow in sending emails
I am trying to send an email to around 4 thousand contacts but it took one day to send it to 500. I tried to go on "scheduled jobs" and "execute the job now" but it says error and I don't see improvements.

As suggested in an other question I also went on Civimail settings and I put 100 as Mailer Batch Limit, but nothing changed.

Hope you can help me. Many thanks!

# Answer
> 0 votes
It is likely your ISP throttling your output. When we were with 1&1 it took 2 days to send 3500 email. Now we are with AWS it takes 50 minutes. You might be able to apply to your ISP to raise your limits.

---
Tags: scheduled-job, mail
---


# Question
Title: CiviCRM plugin causes a ~ 30 second login delay
Just upgraded to CiviCRM 5.54.1, on WordPress 6.0.3 (self-hosting on a virtual private host running CentOS 9, PHP 7.4.32 using php-fpm). For a really long time now, I think since the beginning to be honest, there's been a roughly 25 second delay after a user clicks login before the login is accepted and the login page starts to be processed on the server. Once that happens things are quick.

Browser debugging has the wait squarely on admin-ajax.php. Enabling custom logging on my SSL request log confirms that the request to that URL takes 30 seconds on login (most of the time it's logged as 0 seconds, as it only logs in units of integer seconds).

It's not OS resource related, it's not traffic related. I don't think it has anything to do with database performance as there isn't much traffic or activity at all, and no SQL queries are showing as suspicious (unable to tell if there are just a bajillion of them adding up with my view though). I can't find anything in any error log even with debugging turned on that helps me figure out what's going on.

Disabling the CiviCRM plugin causes logins to be instantaneous. Re-enabling brings back the login delay. While I know that the two WordPress tests around REST API timeout and active PHP session are deemed harmless and there are posted workarounds to disable those tests, I can't help but wonder if while the tests may be testing the wrong thing, the underlying issue may be valid.

Searched this group and the internet in general several times, trying different search terms, to no avail. No help on the WordPress StackExchange group either.

So, does anyone have any ideas what it may be or how I could narrow the culprits down a bit?

Thank you.

Michael

# Answer
> 1 votes
Update: when the combination below is present (at least with some JetPack paid plans), it seems that JetPack’s ‘Dedicated Sync’ thread which gets called on login is somehow blocked by CiviCRM’s session management giving the 30s timeout. I’ve been working with JetPack engineers for a while now, taking traces to narrow things down. The workaround is for them to disable the Dedicated Sync thread, but I’m not sure what is lost when you do that. That warning in WordPress’s system health about an active PHP session is probably not as harmless as has been mentioned here…

It seems like this was related to something going on with the JetPack plugin, in the end. CiviCRM + JetPack + all the themes I tried that didn't come with WordPress = slow login. CiviCRM + JetPack + included WordPress themes = fast login, but the layout options weren't what I wanted. Change any of those and logins were fast. JetPack Support noticed an unknown-cause, not fully understood by me sync discrepancy, fixed it, and now any login after the first one (per user, per browser, so, session cookie updating) is fast. Given that there will always be something going wrong unexpectedly, I'm hoping they'll take my suggestion and make the JetPack plugin a bit more robust, assuming that was in fact the root cause.

# Answer
> 0 votes
I am unsure if this is an 'answer' but I have seen this before and I have always tracked it down to another plugin waiting on a request. That plugin on it's own is not the issue, but as it's unaware of CiviCRM the combination is the issue.

I'd start by disabling all plugins except CiviCRM, go to a default theme and see if the problem is still there. If it is I'd look at the server/fpm settings.

If CiviCRM loads on a clean site, I'd enable the theme, test. If no issues I'd move to plugins one by one until I found the issue.

I've just tested on a cpanel server (closest I have to your config) and with a theme we use on most sites (Kadence) and about 20 plugins - login is nearly instant.

My enviornment is WP 6.0.3, CiviCRM 5.54, php 7.4-fpm, CentOS and WHM/cPanel

---
Tags: wordpress, performance
---


# Question
Title: Issue importing state/province from non-US countries
I'm importing contacts from a legacy system and am running into a wall importing addresses from non-US countries. For instance, for Canada, I'm trying to import a Canadian province. I've tried both the full name and the two-character abbreviation (e.g. "Saskatchewan" or "SK") and neither works. I have confirmed that the provinces are correctly included in the civicrm\_state\_province database table. The import error states:

```
Invalid value for field(s) : State

```

What am I doing wrong?

# Answer
> 4 votes
You MUST un-set the “Default Country” on the Administer \> Localization \> Languages, Currency, Locations page before importing non-US addresses. Unsetting this value (which I had set to United States) allow the import to proceed without getting the error. This seems like a bug in the import module (?).

---
Tags: import
---


# Question
Title: Applying patches that time out on composer update?
I've just updated to MacOS ventura 13.0.1. How do I get composer update to work?

The version of patch

```
 patch -v
 patch 2.0-12u11-Apple

```

The patch file is there

```
cat /var/folders/q4/6fm4gd05575d6snq43_pcggm0000gn/T/63830c0849b7b.patch
--- Mail/mime.php   2020-06-27 18:35:27.000000000 +1000
+++ Mail/mime.php   2020-07-25 08:36:14.570334621 +1000
@@ -1527,6 +1527,9 @@
             $this->{$type} .= $data;
         }

+        // wordwrap the txtbody to be 750 characters to comply with RFC 2821
+        // CRM-3133
+        $this->{$type} = wordwrap($this->{$type}, 750);
         return true;
     }

```

If I run the command manually there is a prompt for 'file to patch'

```
% patch -p1 --no-backup-if-mismatch -d  /Users/jrobens/Sites/electrifyingbradfield/vendor/pear/mail_mime < '/var/folders/q4/6fm4gd05575d6snq43_pcggm0000gn/T/63830c0849b7b.patch'

File to patch: ^C%

```

The man page provides 2 scenarios

> ```
>  patch [-bCcEeflNnRstuv] [-B backup-prefix] [-D symbol] [-d directory] [-g vcs-option] [-F max-fuzz] [-i patchfile] [-o out-file] [-p strip-count]
>      [-r rej-name] [-T | -Z] [-V t | nil | never | none] [-x number] [-Y prefix] [-> z backup-ext] [--quoting-style style] [--posix] [origfile [patchfile]]
>
> ```
>
> patch \<patchfile

This works

> patch -d vendor/pear/mail\_mime \< '/var/folders/q4/6fm4gd05575d6snq43\_pcggm0000gn/T/63830c0849b7b.patch'

> patching file 'Mail/mime.php'

Adding -p1 does not

# Answer
Installing gpatch is the solution recommended here. The symptoms are the same, the process freezes waiting for input on 'which file to patch'.

https://github.com/cweagans/composer-patches/issues/423
> 1 votes

---
Tags: composer
---


title: Database update error with 5.55.2

text:
# Question
Title: Database update error with 5.55.2
The Wordpress database update process from 5.34.0 to 5.55.2 fails right near the end with this error:

Exception: "API error: DB Error: constraint violation on ReportTemplate.create"

Perhaps you know of a quick fix before I have to roll everything back.

Note: civicrm seems to be up and running however -- I haven't seen a bug yet. Perhaps I can ignore this update error?

Edit: Here is the tail end of the log I found hope it's enough:

```
    #message: "DB Error: constraint violation"
#code: 0
#file: "/home/noyb/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php"
#line: 955
trace: {
  /home/noyb/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php:955 {
    ›   CRM_Core_Error::backtrace('backTrace', TRUE);
    ›   throw new PEAR_Exception($pearError->getMessage(), $pearError);
    › }
  }
  /home/noyb/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php:944 { …}
  /home/noyb/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB.php:997 { …}
  /home/noyb/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php:575 { …}
  /home/noyb/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php:223 { …}
  /home/noyb/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/common.php:1928 { …}
  /home/noyb/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/mysqli.php:943 { …}
  /home/noyb/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/mysqli.php:413 { …}
  /home/noyb/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/common.php:1234 { …}
  /home/noyb/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php:2696 { …}
  /home/noyb/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php:1650 { …}
  /home/noyb/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php:730 { …}
  /home/noyb/public_html/wp-content/plugins/civicrm/civicrm/CRM/Price/BAO/PriceSet.php:225 { …}
  /home/noyb/public_html/wp-content/plugins/civicrm/civicrm/CRM/Price/Form/DeleteSet.php:76 { …}
  /home/noyb/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php:573 { …}
  /home/noyb/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/StateMachine.php:144 { …}
  /home/noyb/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Next.php:43 { …}
  /home/noyb/public_html/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Controller.php:203 { …}
  /home/noyb/public_html/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Page.php:103 { …}
  /home/noyb/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php:355 { …}
  /home/noyb/public_html/wp-content/plugins/civicrm/civicrm/CRM/Price/Page/Set.php:145 { …}
  /home/noyb/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:319 { …}
  /home/noyb/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:69 { …}
  /home/noyb/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:36 { …}
  /home/noyb/public_html/wp-content/plugins/civicrm/civicrm.php:1199 { …}
  /home/noyb/public_html/wp-includes/class-wp-hook.php:303 { …}
  /home/noyb/public_html/wp-includes/class-wp-hook.php:327 { …}
  /home/noyb/public_html/wp-includes/plugin.php:470 { …}
  /home/noyb/public_html/wp-admin/admin.php:259 { …}
}

```

} \]

> Nov 27 13:04:43 \[debug\] $backTrace = #0 /home/noyb/public\_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(441): CRM\_Core\_Error::backtrace("backTrace", TRUE) #1 /home/noyb/public\_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(39): CRM\_Core\_Error::handleUnhandledException(Object(PEAR\_Exception)) #2 /home/noyb/public\_html/wp-content/plugins/civicrm/civicrm.php(1199): CRM\_Core\_Invoke::invoke((Array:3)) #3 /home/noyb/public\_html/wp-includes/class-wp-hook.php(303): CiviCRM\_For\_WordPress-\>invoke("") #4 /home/noyb/public\_html/wp-includes/class-wp-hook.php(327): WP\_Hook-\>apply\_filters("", (Array:1)) #5 /home/noyb/public\_html/wp-includes/plugin.php(470): WP\_Hook-\>do\_action((Array:1)) #6 /home/noyb/public\_html/wp-admin/admin.php(259): do\_action("toplevel\_page\_CiviCRM") #7 {main}

# Answer
Do you have an Extended report extension installed? If yes, then probably you would need to

1. Upgrade CiviCRM to 5.46.3
2. Upgrade the Extended report extension to the latest version.
3. Upgrade CiviCRM to 5.55.2
4. Run the extension update db if there are any.

or

1. Replace the extended report extension folder to latest.
2. Upgrade CiviCRM to 5.55.2
3. Run the extension update db if there are any.
> 1 votes

---
Tags: upgrade, error
---


# Question
Title: Populating custom field set name with a sub-field in layout
I have a custom field set that allows multiple entires.

They represent "outreaches" for organisations. eg: City Office, Rural outreach office etc.

Each field set has a bunch of information - Outreach name, opening hours, location, desciption etc.

My issue is the following. I have them in a tab on the organisation contact page. When users go into the tab, or edit the content of the tab they see a list of the sub-services but all the entries are named for the parent custom field set. Here is a picture to illustrate the issue:

What I want is to populate the heading in the accordion with the value from the "servive name" field of the custom field set.

eg:

It's quite frustrating for users at the moment as they must open each service accordion to see which one it actually is when they may only need to update one of them. Most organisation only have 1-3 sub-services but some - as in the above example - have five or more.

Any ideas on how to implement this?

PS - sorry for the image quality. I am having issues with Flameshot screen captures at the moment.

# Answer
> 3 votes
Not a direct answer to your question but perhaps a solution?

Have you considered changing the custom data set style from Tab to Tab with table?

Tab -

Tab with table -

---
Tags: custom-fields, contact-layout-editor
---


title: Import data, given Contact ID

text:
# Question
Title: Import data, given Contact ID
I have a CSV with various fields, including `Internal ID` and `Phone`. I want to match `Internal ID` to `Contact ID`, and add `Phone` to the set of phone numbers for each contact.

I use a simple field mapping for import, shown here (real data redacted for most fields):

But I get the following error:

When selecting the field mapping, there are 5 options with an asterisk `*` by them, and `Contact ID` is one of them (along with the other 4 `First Name`, `Last Name`, `Email`, and `External Identifier`), indicating (I presume) that they're valid for matching to a contact. Why is this not respected when actually doing the import?

And why does the preview say there are 459 "valid rows", when it should already know at this stage that it's not going to succeed?

I'm wondering if I need to create another dedupe rule for `Contact ID`, maybe? Or if I'm matching on `Contact ID`, maybe I don't need dedupe checking (set to "No Duplicate Checking"), is it a special case, maybe?

Any help is appreciated, thanks.

# Answer
> 2 votes
Have you set 'For Duplicate Contacts' to Update on the initial import contact screen?

---
Tags: contacts, import, dedupe-rules
---


# Question
Title: Is there a clear step by step guide to setting up oAuth for Gmail?
I'm looking for a step by step guide on how to set up oAuth for Gmail for bounce processing.

I have the oAuth extension installed, and I have a project set up in Google Cloud, but I'm at a loss what next steps are. I am running civiCRM 5.55.0.

I have read the section "Adding an account via OAuth" on : https://docs.civicrm.org/sysadmin/en/latest/setup/civimail/#adding-an-incoming-email-account-for-processing-bounces-andor-email-to-activities

But Add Mail button doesn't reveal as a dropdown. I see under "OAuth2 Client Administration" in civiCRM the Gmail setting, and that is where I get lost. I have also read "Google Mail (Provider)" on : https://docs.civicrm.org/sysadmin/en/latest/setup/oauth/

But that is where it falls apart for me as there isn't a step-by-step guide on what to do in Google Cloud.

Is the actual setup process documented anywhere (or perhaps some one has something they can share)?

# Answer
> 0 votes
I think provider-specific details were left out on purpose and just deferred to their own documentation. There are some (maybe out of date) testing notes at https://lab.civicrm.org/dev/core/-/issues/3645#note\_76731.

The last time I checked there was a scary looking screen about the app being unverified, but just ignore it.

If you're already set up at google, but not seeing the Add Mail Account on the mail accounts screen, then did you do the steps at https://docs.civicrm.org/sysadmin/en/latest/setup/oauth/#civicrm-client?

---
Tags: civimail, oauth
---


# Question
Title: How to extract or list participant custom data?
My event has custom data extending participants. I can't find any way to report, search or sort on the custom data.

I have found the relevant tables for the options but the sql statement will be complex. I'd prefer to find a report already written. If I can't I could write my own stand alone page in php and query the database directly.

Edit: Here is the sql to show dinner preferences for each conference participant. I hard coded a couple of id numbers to save time.

SELECT civicrm\_contact.display\_name, civicrm\_email.email, civicrm\_phone.phone, civicrm\_option\_value.name FROM civicrm\_participant, civicrm\_contact, civicrm\_phone, civicrm\_email, civicrm\_value\_rpc\_2023\_meal\_24, civicrm\_option\_value where civicrm\_participant.event\_id=5 and civicrm\_participant.status\_id=1 and civicrm\_participant.contact\_id = civicrm\_contact.id and civicrm\_participant.contact\_id = civicrm\_phone.contact\_id and civicrm\_value\_rpc\_2023\_meal\_24.entity\_id=civicrm\_participant.id and civicrm\_option\_value.option\_group\_id = 124 and civicrm\_value\_rpc\_2023\_meal\_24.meal\_preference\_44 = civicrm\_option\_value.value and civicrm\_email.contact\_id = civicrm\_participant.contact\_id

# Answer
If your fields are Searchable then they should show up as expandable sections in the Event Participants List Report

If they are not showing there then suggest you go to your Custom Fields and confirm if you set them to be Searchable or not.
> 0 votes

---
Tags: participants
---


title: Smarty templating and PHP8 warnings

text:
# Question
Title: Smarty templating and PHP8 warnings
Wondering if anyone had any ideas about modifiying the Smarty so that it automatically handles null values being passed in as variables in the templates?

These notices being elevated to Warnings in PHP8 is causing a lot of messages to appear in development environments using legacy code

Cheers Jonny

# Answer
> 2 votes
There has been ongoing work on this and the team working hard to have it fixed ASAP. If you turn off the debugging on the site it should not display the warnings on the screen though

---
Tags: php8
---


# Question
Title: Form builder: how to prevent duplicate contacts
With Form Builder, do you know how I can prevent duplicate contacts creation with the same name and email? I have not found anywhere how to set the 'dedupe rule' for the contact.

Thanks

# Answer
> 1 votes
I found that it has probably already been developed and will be available in the next versions (perhaps 5.56 or 5.57). See this PR

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


title: CIVICRM release path process

text:
# Question
Title: CIVICRM release path process
I am currently on CIVICRM 5.463 under Joomla 3.10.11. As I am relatively knew to the CIVICRM world, is there a specific release upgrade process (other than taking backups) that I should be aware of? Any specific gotchas that I should watch out for in doing an upgrade? Are there any issues with me upgrading directly to 5.55 from 5.463? Any concerns about associated extensions?

# Answer
Take a look at https://docs.civicrm.org/sysadmin/en/latest/upgrade/joomla, which has steps for joomla and https://docs.civicrm.org/sysadmin/en/latest/upgrade/version-specific which has generic information.
> 1 votes

---
Tags: upgrade, joomla, paths, release
---


title: How to add an fa-icon to a custom menu?

text:
# Question
Title: How to add an fa-icon to a custom menu?
I've read the documentation but still tried to add a custom icon to a custom admin menu with an extension

```
_custommenu_civix_insert_navigation_menu($menu, 'Docuthèque', [
    'label' => 'Dossier formation FC PSE1',
    'name' => 'Dossier formation FC PSE1',
    'url' => 'https://ffmns.gestad.net/documents/2022/11/dossier-fc-pse1.xlsx/',
    'permission' => 'access CiviCRM',
    'attr' => ['target' => '_blank'],
    'icon' => 'crm-i fa-file-spreadsheet'
  ]);

```

It doesn't work but can you confirm that this is really not possible?

# Answer
> 3 votes
I don't think there isn't any icon with 'fa-file-spreadsheet' in Civi. Can you check in the New Activity type form if the one you are looking for is present or the one you can select from the list?

Hover on one of the icons, it should display the icon text which you can use in the code. For example, I would replace `fa-file-spreadsheet` with `fa-plus-square-o` from the screenshot below.

Or you can use the list from Font-Awesome icons.

Based on your code example I would use `'crm-i fa-file-excel-o'`

HTH

Pradeep

---
Tags: menu
---


title: CiviCRM support for PHP 8.1?

text:
# Question
Title: CiviCRM support for PHP 8.1?
Drupal 9 has now deprecated PHP 7.4. CiviCRM gives lots of deprecated and warning messages under PHP 8.1. It is possible to suppress them by adding

```
// PHP 8.1 generates lots of warnings that 7.4 does not.
error_reporting(E_ALL & ~E_DEPRECATED & ~E_WARNING);

```

immediately before

```
require_once 'CRM/Core/ClassLoader.php';
CRM_Core_ClassLoader::singleton()->register();

```

at the bottom of civicrm.settings.php. However, are there plans to change the code so those warnings are no longer given? It is surely better to make sure the code doesn't give deprecated and warning messages?

# Answer
Yes it's just a large task and they're getting fixed but slowly. Unlike every other language on the planet php itself has greatly changed, and keeps changing every couple months. As a comparison, imagine if javascript now decided to output warnings when doing something like `a + b` and a=2 and b=null. So much javascript on the internet would be throwing warnings and need changing.
> 1 votes

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


# Question
Title: Is it safe to mark contact emails as "on_hold" in bulk with a direct database query?
We've just now started getting bounce reports for our outgoing email, and the number of them is alarmingly high. The majority of the responses is: "The email account that you tried to reach does not exist" so it is just that our contact list is very out of date.

From a recent mailer, CiviCRM marked 200 as bounces but the external bounce report shows over a 1000. That is a *lot* to go through 1 by 1, so I was thinking of running a database query such as:

```
update civicrm_email SET on_hold = '1', hold_date = NOW()
where email in (
 [list of email addresses]
)

```

Is this an ill-advised thing to do? Is the on\_hold information tracked elsewhere also that might cause a conflict?

Thanks!

# Answer
> 2 votes
Yes, it is safe to update the email in civicrm to on-hold.

---
Tags: civimail
---


# Question
Title: Drupal 9 Create User from contact the email field is hidden
Creating a user from a contact via actions menu brings form with hidden email field!??! at *civicrm/contact/view/useradd?reset=1&action=add&cid=2572&cid=2572* Why 2 CID?

Searching to find out where and how this is happening.. Worked last week..

# Answer
The contact on the civi side needs to have an email address.
> 1 votes

---
Tags: user-account, user, drupal-9
---


title: Civicrm consultancy

text:
# Question
Title: Civicrm consultancy
Good afternoon,

I am Specialist content for an association. We have recently started working with Civi and I would like to contact someone expert in the platform for certain issues. I don't know if this is the right place. Mainly what I need is a support or consultant for civi with whom I can solve and advance in certain aspects.

I look forward to hearing from you, Best regards.

# Answer
https://chat.civicrm.org would be a good place to start. Just ask your question there.

You can also use https://civicrm.org/partners-contributors
> 3 votes

---
Tags: civicrm-home
---


# Question
Title: extension assets (js and css) being blocked: The resource was blocked due to MIME type (“text/html”) mismatch
I've been troubleshooting a problem with our Stripe payment processor, and figured out that in fact extension scripts and style sheets are being blocked. Sample error:

```
The resource from “https://<domain>/civicrm_custom/extensions/mjwshared/js/crm.payment.js?r=rEd8ien_US” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff)

```

Errors appear for js and css files in the extensions directory. However, CiviCRM itself is working fine, all js and css assets loading correctly. It's only the extensions that are being blocked.

Direct calls to the JS and CSS asset URLs also produce 404s.

I'm not sure exactly when this problem started; the last time we used the Stripe extension was last March; CiviCRM and the processor extension have been upgraded since then. The site has not been moved. I found this entry and I've looked at the Resource URL and directory settings and they are the same as previously (they are absolute paths).

Permissions for the directories have also not changed, and seem to be similar to the Civicrm directories.

I'm just a bit stumped as to why the extensions are being blocked, but not the main Civi?

What have I overlooked? Thanks!

System deets: Joomla 3.10.11 CiviCRM 5.55.2

# Answer
> 1 votes
Color me stupid. Found the problem: firewall was blocking access to the extensions directory. Not a Civi problem at all :-)

---
Tags: extension, resource-urls
---


# Question
Title: Mosaico or CiviMail appending Sample Header/Footer Language to emails?
I don't know what triggered this, but mosaico is appending

```
Sample Header for HTML formatted content.

```

at the top of each message and

```
Sample Footer for HTML formatted content
Unsubscribe
Address Info

```

I know I can disable this on traditional CiviMail emails but how can i disable this with mosaico emails.

Latest Civi/WordPress

Edit: Disabling header and footer in admin *Headers, Footers, and Automated Messages* makes no difference.

Edit: I have Mosaico Message Templates & Pretty Workflow Messages installed but this was fine before and disabling both make no difference.

Edit 2: I rebuilt the template and email from scratch and the problem seems to have resolved itself. Very strange.

Its faint to see, but see message.

# Answer
> 3 votes
Until this gets fixed, if you have a mailing where you are experiencing this issue and don't have time to rebuild your template and email from scratch, you can find your mailing in the `civicrm_mailing` table and set the `header_id` and `footer_id` fields to `NULL`.

# Answer
> 2 votes
Ran into this as well. Fixed it by removing the text for the Mailing Header and Mailing Footer under Administer \> CiviMail \> Headers, Footers, and Automated Messages.

# Answer
> 2 votes
It looks like this is fixed in https://github.com/veda-consulting-company/uk.co.vedaconsulting.mosaico/pull/536 so this should be fixed in 2.10.

# Answer
> 1 votes
Deleting the 2 entries in the table `civicrm_mailing_component` was my ugly but working solution

# Answer
> 0 votes
I thought I had fixed it by unchecking default next to mailing header. It no longer showed up in preview. Also, it was null in the mailing tables, but when I went to send the message it errored with the missing domain.address, action.OptOutURL or action.UnsubscribeURL. I ended up adding a foot id in the table to send it. This was for a message copied from before the upgrade. It appears to do the right thing when I create a new message from a template.

# Answer
> 0 votes
@Sean T. Walsh: Administer \> CiviMail \> Headers, Footers, and Automated Messages was a good hint, but deactivating didn't solve the issue for existing mails / templates. My hack: Edit Header / Footer and delete or \<!-- comment out --\> the contents.

---
Tags: civimail, mosaico
---


# Question
Title: Send scheduled mailing fails due to deprecated function CRM_Utils_Token::getTokenDetails
My send scheduled reminder cron job has been failing consistently.

The log file shows about a dozen of these errors every time send scheduled reminders fails:

```
[warning] Deprecated function CRM_Utils_Token::getTokenDetails, use If you hit this in mailing code you should use flexmailer - otherwise use the token processor.
CRM_Core_Error::deprecatedFunctionWarning
CRM_Utils_Token::getTokenDetails
::gdpr_civicrm_tokenValues
CRM_Utils_Hook::runHooks
Array
(
    [civi.tag] => deprecated
)

```

I use flexmailer already. The mail fails when using simple tokens like {contact.first\_name}, but also when deleting all tokens from the mail body.

What could cause this behavior?

getTokenDetails is not mentioned as deprecated in their official documentation other than some other functions of CRM\_Utils\_Token.

# Answer
> 1 votes
I had a png-logo pasted as part of our HTML signature: data:image/png;base64 The image pointed to an URL as well.

Deleting it solved the problem for me - if anyone can guess why, please edit or comment.

Now there is only one instead of a dozen of these alike error messages remaining for each run of scheduled reminders, which finally finish successfully.

---
Tags: tokens, scheduled-reminders, cron-job, flexmailer
---


# Question
Title: Reports - field names in Filter tab all blanks!
In Reports, the field names on the left side in the 'Filters' tab are all blank. I don't know when this happened but it affects all reports. 'Columns' tab is OK. Another system I have at the same level (5.53.0) is not affected. This is really odd! - I've cleared caches, disabled ReportPlus, cleared caches again but the problem persists.

# Answer
The only thing I can think is some rogue css coming from somewhere, like `div#report-tab-set-filters td.label { display: none; }`. If you right-click and choose "inspect", are they there in the html but have some css hiding them?
> 1 votes

---
Tags: civireport
---


# Question
Title: Way to reset search preferences, display preferences when admin page inaccessible?
In Refrence to my related issue how do I re-write the default preferences back to what they were when first CiviCRM was installed? Admin screen no longer accessible after search preferences changes..

Drupal 9, PHP 8, CiviCRM 5.55.2

# Answer
> 1 votes
Do you have cv installed? You can do

`cv ev '\Civi::settings()->set("quicksearch_options", array ( 0 => "sort_name", 1 => "contact_id", 2 => "external_identifier", 3 => "first_name", 4 => "last_name", 5 => "email", 6 => "phone_numeric", 7 => "street_address", 8 => "city", 9 => "postal_code", 10 => "job_title"));'`

Alternatively if you have database access you can do

`UPDATE civicrm_setting set value='a:11:{i:0;s:9:"sort_name";i:1;s:10:"contact_id";i:2;s:19:"external_identifier";i:3;s:10:"first_name";i:4;s:9:"last_name";i:5;s:5:"email";i:6;s:13:"phone_numeric";i:7;s:14:"street_address";i:8;s:4:"city";i:9;s:11:"postal_code";i:10;s:9:"job_title";}' where name='quicksearch_options';`

---
Tags: drupal-9, php8
---


title: link contacts to external systems

text:
# Question
Title: link contacts to external systems
i have data on my contacts spread over different systems, among which civicrm. i do have keys of the external system in civicrm, e.g. an id `123`. now, this key can be used to browse info on this contact at `https://externalsystem.tld/users/123`.

technically, just knowing the id `123` would be enough to then look up such further info, and might save our database some space over also storing the full URLs.

however, from a UX perspective, it would be nice if our people browsing the civicrm contacts would simply have a link or even button per contact, saving them the labor of manually constructing URLs to then manually open, if they wanted to look up a contact in the external system.

how might we give our contact UI buttons or URLs like this?

# Answer
> 2 votes
You can come oh-so-close with searchkit and formbuilder, but it only works if the logged-in user is viewing their own contact. It might be worth posting in https://chat.civicrm.org in the searchkit channel if there's a way to get the "currently viewed contact id" and use that in the WHERE clause.

If there were, then you can set up a search that outputs external\_id, and uses the "currently viewed contact id" in the where clause, then add a search display and use the "rewrite" option for the external id field to make it the url and insert token `[external_identifier]`.

Then create a formbuilder form for the display, and choose the option to "add to contact summary page".

You can also do it with custom code and hooks, but not sure if that's what you're looking for.

Here's a screenshot of what it looks like with "currently logged in user" in the where clause:

---
Tags: contacts, contact-view, links, button
---


title: CMS User Query with SearchKit

text:
# Question
Title: CMS User Query with SearchKit
The "Advanced Search" interface has the following option:

CMS User? Yes No Does the contact have a WordPress Account?

However, I have been unable to find a similar option in SearchKit. Is that functionality available in SearchKit?

# Answer
> 2 votes
Making User accounts as base table is possible to check

---
Tags: searchkit, cms-integration
---


# Question
Title: Is -TypeError: array_flip(): Argument #1 must be of type array, string given- a php 8, Drupal 9, civicrm 5.55.2 or all combined Issue?
PHP 8 TypeError I encountered when making adjustments to the search preferences, unchecking not needed fields and checking new custom fields. no autocomplete drop down anymore and when I TRY to go back into search preferences, a fatal error is thrown with:

`The website encountered an unexpected error. Please try again later. TypeError: array_flip(): Argument #1 ($array) must be of type array, string given in array_flip() (line 380 of /code/vendor/civicrm/civicrm-core/CRM/Admin/Form/SettingTrait.php). array_flip('external_identifiersort_namecitycustom_Annuity_Balancecustom_PAP_Balancecustom_Pension_Credits_to_Date') (Line: 380) CRM_Admin_Form_Setting::reorderSortableOptions('quicksearch_options', Array) (Line: 224) CRM_Admin_Form_Setting->addFieldsDefinedInSettingsMetadata() (Line: 66) CRM_Admin_Form_Setting->buildQuickForm() (Line: 47) CRM_Admin_Form_Setting_Search->buildQuickForm() (Line: 689) CRM_Core_Form->buildForm() (Line: 76).... and more..`

Is this just because of php 8? I am on Drupal 9 and it requires php 8, but will work on 7.4, i thinks.. ? any fixes on the horizon?

# Answer
> 1 votes
I'm guessing this has been a bug for a while, not strictly related to php 8, it just crashes with php 8. Can you file an issue at https://lab.civicrm.org with the stack trace?

By the way drupal 9 will run with php 7.4 and it won't be removed from drupal 9, just drupal 10.

EDIT: Fix is at https://github.com/civicrm/civicrm-core/pull/25170

# Answer
> 1 votes
A roll back to php 7.4 along with deletion of template\_c files seems to bring back a working environment. As in, php7.4 does not fatal error on this however the issue persists.. Just tested in Drupal 7 as well and any change with search preferences causes things to break.

---
Tags: drupal-9, php8
---


title: Database security

text:
# Question
Title: Database security
I'm a CS grad student and curious about the security of the database beyond what is provided by the CiviCRM application. For example, the ACL can be used for more detailed access through the application but is bypassed if a developer has access to the database directly.

My interest stems from my own experience supporting CiviCRM in the past. The IT people had full access to the database which held data about people that could not be leaked.

I'd like to know if such security is an issue for any organizations using CiviCRM. Is it considered OK to allow developers or IT people to access the database fully, or would there be any demand for security that could protect certain tables, fields, or rows of data even from someone with direct database access?

# Answer
> 2 votes
This is such an interesting question - because I don't believe many users/owners realise that access to databases is absolutely required for support, or how security is exposed. However, the simple answer is that normally whoever has access has to sign some kind of non-disclosure agreement that's suitably worded. The NDAs I've signed were not really up to the job, so the owners have relied on trust. Which won't always work, of course. The other aspect that I don't think users/owners even realise is that the hosting company (if there is one) will also have complete access to databases and files. It wouldn't be feasible to restrict access as you describe though, at least not for CiviCRM. Full access is needed 100% for support, but in my experience isn't properly dealt with in terms of agreements etc.

---
Tags: database, security
---


# Question
Title: Memberships Due for Renewal for Mail Merge
We have recently upgraded to civicim 5.55.2. When we select Memberships Due for Renewal for Mail Merge we are taken back to the welcome screen.

# Answer
thank you, it was a custom link so now resolved
> 2 votes

---
Tags: renewals
---


# Question
Title: Why is the access control option not available for smart groups anymore? Fresh install
civicrm 5.55.2 drupal 9.4.8

smart groups acl not available. parent group has the option.

does not matter if smart group is parent or child

# Answer
Access control for the smart group was never supported AFAIK. Only for static groups
> 4 votes

---
Tags: smartgroups, acl
---


title: Problems after updating to PHP 8.1

text:
# Question
Title: Problems after updating to PHP 8.1
after updating to PHP 8.1, I have a punch of warning, like:

```
Warning: Undefined array key "pledgeBlock" in /.../wp-content/uploads/civicrm/templates_c/de_DE/%%3D/3D1/3D13F2BA%%Main.tpl.php on line 138

Warning: Undefined array key "pcpSupporterText" in /.../wp-content/uploads/civicrm/templates_c/de_DE/%%3D/3D1/3D13F2BA%%Main.tpl.php on line 222

Warning: Undefined array key "showMainEmail" in /.../uploads/civicrm/templates_c/de_DE/%%3D/3D1/3D13F2BA%%Main.tpl.php on line 230

Warning: Undefined array key "onBehalfOfFields" in /.../wp-content/uploads/civicrm/templates_c/de_DE/%%B0/B02/B02188B6%%OnBehalfOf.tpl.php on line 20

Warning: Undefined array key "showCMS" in /.../wp-content/uploads/civicrm/templates_c/de_DE/%%98/98F/98F6DF1D%%CMSUser.tpl.php on line 5

Warning: Undefined array key "products" in /.../wp-content/uploads/civicrm/templates_c/de_DE/%%DF/DF4/DF4B6A64%%PremiumBlock.tpl.php on line 5

Warning: Undefined array key "honoreeProfileFields" in /.../wp-content/uploads/civicrm/templates_c/de_DE/%%3D/3D1/3D13F2BA%%Main.tpl.php on line 267

Warning: Undefined array key "help_pre" in /.../wp-content/uploads/civicrm/templates_c/de_DE/%%70/70E/70E79F81%%Block.tpl.php on line 6

Warning: Undefined array key "prefix" in /.../wp-content/uploads/civicrm/templates_c/de_DE/%%5C/5C2/5C26BC2B%%Fields.tpl.php on line 13

Warning: Undefined array key "mode" in /.../wp-content/uploads/civicrm/templates_c/de_DE/%%5C/5C2/5C26BC2B%%Fields.tpl.php on line 32

Warning: Undefined array key "hideFieldset" in /.../wp-content/uploads/civicrm/templates_c/de_DE/%%5C/5C2/5C26BC2B%%Fields.tpl.php on line 32

```

I already tried the tip mentioned in CiviCRM support for PHP 8.1?, cleared the templates\_c directory, and cleared the cache. The warnings remain.

Any suggestions? Thank you very much

# Answer
There has been ongoing work to fix the notices. If you have debbuging on in CiviCRM, turn it off or turn off notice displays on screen for now until there is a fix for all the notices in tpls.
> 2 votes

---
Tags: php8
---


title: Upgrading, received database error

text:
# Question
Title: Upgrading, received database error
On a (copy of a) Drupal 7.92 site, I'm attempting to upgrade CiviCRM from version 5.42.1 to 5.55.2. I did this by executing the following steps:

```
cd /bitnami/drupal/modules/contrib
rm -rf civicrm
curl -L https://download.civicrm.org/civicrm-5.55.2-drupal.tar.gz | tar -zxf -

```

and then (since I don't have `drush` installed) I visited `/civicrm/upgrade?reset=1` on my site to execute the database updates. Everything seemed to go well (there were a lot of updates!) until just before the end of the progress bar, when I got this error message:

It doesn't give any more specifics than this, e.g. what constraint is being violated.

If I visit the `/civicrm/upgrade?reset=1` upgrade page again, it says "Your database has already been upgraded to CiviCRM 5.55.2".

Can I assume that this is not going to cause any snags? Any way to figure out more specifically what went wrong, before I try this on my live site?

**UPDATE**

@pradeep-nayak correctly suggested that there were likely CiviCRM Extensions that needed to be updated. Here's a screenshot of my extensions page after attempting the upgrade:

I'll try doing the upgrade in steps as suggested and update if anything *interesting* happens.

# Answer
> 3 votes
Do you have an Extended report extension installed? If yes, then probably you would need to

1. Upgrade CiviCRM to 5.46.3
2. Upgrade the Extended report extension to the latest version.
3. Upgrade CiviCRM to 5.55.2
4. Run the extension update db if there are any.

or

1. Replace the extended report extension folder to latest.
2. Upgrade CiviCRM to 5.55.2
3. Run the extension update db if there are any.

# Answer
> 0 votes
Thanks to @pradeep-nayak for setting me on the right path. For posterity, here are the steps that ended up working.

```
# DO: visit /civicrm/admin/extensions?reset=1 and do updates

# Upgrade drupal
DRUP=~/stack/drupal
TB=drupal-7.92.tar.gz
OTHER=/bitnami/drupal

sudo mv $DRUP $DRUP-old

cd "$(dirname $DRUP)"
curl https://ftp.drupal.org/files/projects/$TB | sudo tar -zxvf -
sudo mv "${TB//\.tar\.gz/}" drupal

cd $DRUP
sudo rm -rf sites
sudo ln -s $OTHER/sites .
sudo ln -s $OTHER/modules/contrib $DRUP/modules/

# Upgrade civicrm to intermediate version
V1=5.46.3
cd $OTHER/modules/contrib
rm -rf civicrm
curl -L https://download.civicrm.org/civicrm-${V1}-drupal.tar.gz | tar -zxf -
# DO: visit /civicrm/upgrade?reset=1
# DO: visit /civicrm/admin/extensions?reset=1 and do updates

# Upgrade civicrm to final version
V2=5.55.2
cd $OTHER/modules/contrib
rm -rf civicrm
curl -L https://download.civicrm.org/civicrm-${V2}-drupal.tar.gz | tar -zxf -
# DO: visit /civicrm/upgrade?reset=1
# DO: visit /civicrm/admin/extensions?reset=1 and do updates

```

When I did this "for real" the final time, I did get some errors in the website after the CiviCRM steps about various PHP errors that prevented the site from loading. I'm not sure what that was about, but just waiting a while longer between steps seemed to cure it.

---
Tags: upgrade, database
---


# Question
Title: Tokens in a Reports Title and Format section?
Is it possible to use tokens in Report Title/Header/Footer? Gave it a quick try with `{contact.first_name}` and failed.

# Answer
Unfortunately, the tokens are not supported in report headers or footers. They will be rendered as plain text or html.

You could use alterMailParams hook to process and replace the tokens.

HTH

Pradeep
> 3 votes

# Answer
maybe in the future, using SearchKit for reports will offer this support
> 1 votes

---
Tags: civireport, tokens, reports, custom-reports
---


# Question
Title: Civicrm on Wordpress installer table doesnt exist
Using Ampp version 4.3 with Apache v2.4.54, MySQL v8.0.31, php version 7.4.32, Windows

Every time I run the CiviCrm installer I get an error "Table 'civicrm.civicrm\_worldregion' doesn't exist in ... " I've tried to add the innodb settings in mysql.conf but mysql doesn't know these entries. The table is indeed not present in my DB (using the same DB as wordpress).

I don't know how to continue and I would like to get some help. Thanks

Whole error message is `Fatal error: Uncaught Civi\Setup\Exception\SqlException: Cannot execute /******************************************************* * * civicrm_county * *******************************************************/ INSERT INTO civicrm_worldregion (id, name) VALUES("1", "Europe and Central Asia"): Table 'civicrm.civicrm_worldregion' doesn't exist in C:\Program Files\Ampps_4_2\www\civicrm.test\wp-content\plugins\civicrm\civicrm\setup\src\Setup\DbUtil.php:206 Stack trace: #0 C:\Program Files\Ampps_4_2\www\civicrm.test\wp-content\plugins\civicrm\civicrm\setup\plugins\installDatabase\InstallSchema.civi-setup.php(85): Civi\Setup\DbUtil::sourceSQL() #1 C:\Program Files\Ampps_4_2\www\civicrm.test\wp-content\plugins\civicrm\civicrm\vendor\symfony\event-dispatcher\EventDispatcher.php(264): InstallSchemaPlugin->installDatabase() #2 C:\Program Files\Ampps_4_2\www\civicrm.test\wp-content\plugins\civicrm\civicrm\vendor\symfony\event-dispatcher\EventDispatcher.php(239): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch() #3 C:\Pro in C:\Program Files\Ampps_4_2\www\civicrm.test\wp-content\plugins\civicrm\civicrm\setup\src\Setup\DbUtil.php on line 206`

# Answer
> 0 votes
PHP8 is not recommended, see the System Requirements Docs here.

PLease try again with PHP7.4.

# Answer
> 0 votes
I would try to manually create this missing table. there are only two columns: id (primary key with auto-increment) and name.

---
Tags: wordpress, database, installation, mysql, issues
---


# Question
Title: How can you create more than one automated thank you for a donation?
We would like to set up a second thank you email to everyone who donates to our organization that is scheduled to go out 24 hours after the donation is made. It would be wonderful if it could include HTML formatting options and specific data tokens so that the letter is personal.

Thanks so much.

# Answer
Have you tried Schedule reminders?
> 2 votes

---
Tags: donations, automation
---


# Question
Title: Search Kit Actions do not appear on Form Builder form
I have a test search to select Contacts using Search Kit. I have created a Table display (with the Enable Actions option ticked), and including a menu section containing the default links. In the Preview, or if I view this display directly, I can select one or more results, click the Actions button, and I get a dropdown of all available actions. The Links menu is also displayed against each result.

If I create a Form Builder form to display this same Table (plus an exposed filter on the Contact name), the display function works, but when I select some results and click the Actions button nothing happens. The Links menu is also missing.

What am I doing wrong? It feels like a permissions problem, but I am logged in as administrator, and have set the Form Builder form to require CiviCRM Administrator permission.

# Answer
> 1 votes
Again, not really an explanation, but just wiped the first search and also uninstalled an experimental theme extension, then rebuilt the search and form from scratch. Works fine

Sorry for the hassle.

# Answer
> 0 votes
not really a solution but have you tried to replicate on https://dmaster.demo.civicrm.org/? I've never had this issue and your configuration seems right.

---
Tags: searchkit, actions
---


title: How do I edit the type in a field set?

text:
# Question
Title: How do I edit the type in a field set?
I am trying to link a field to specific types of cases. there id a field already set up which is linked to the wrong cases and I need to change it. How do I do this?

# Answer
> 1 votes
I'm interpreting your question as "I have a set of custom fields that are configured to only appear for a specific case type, and I want to change it so they appear for a different case type".

At Administer - Customize - Custom Fields, you'll see the list of field sets. Each one has a "more" link on the far right. Click there and pick "Settings". Then you can change which case types the set appears for.

---
Tags: custom-fields
---


# Question
Title: CiviCRM Display Preferences/Wysiwyg Editor does not show "Default Drupal Editor" as an option
We've been using CiviCRM (now on v5.55.2) installed on Drupal (now v7.92) for several years. During that time we've used a couple of different rich text editors (TinyMCE, FCKEditor, CKEditor) and IMCE as a file manager to create and edit content in Drupal with good success. We've not had a need for a rich text editor in CiviCRM in the past but recently we decided to start using CiviMail to send newsletters to our members.

In an effort to configure CiviCRM with an editor I've carefully read the page, "Configuring CiviCRM to use Default Drupal Editor" in the System Administrator Guide and confirmed that everything is set up as that document describes. Unfortunately, the Default Drupal Editor option does not appear in the drop down list of possible editors for the CiviCRM WYSIWYG editor setting and nothing I've tried makes it show up.

I have searched high and low in this forum for clues about what may be wrong but haven't found the exact problem. There is one thread that is close but their problem was in using system-flow templates. We are using User-driven message templates.

Since the last question related to this feature was posted in 2018 I can't help but wonder if the feature is still available. Any ideas would be greatly appreciated.

# Answer
It's not a direct answer to your question but I wonder if you've considered installing the Mosiaco extension? You might find that an improvement over the standard CiviMail interface. This may mean that you don't need to install a text editor.
> 1 votes

---
Tags: ckeditor, wysiwyg
---


# Question
Title: Reports failing after upgrade whenany filter enabled
After upgrading to 5.54.1, most reports are failing to run for us, generating the error below:

**Error thrown**

**Call to undefined method Html2Text\Html2Text::getText()**

Some reports were seemingly ok but after some troubleshooting I can break these too. The reports with no filters enabled are fine, but as soon as any filter is selected, the error above appears on a new white page.

There's nothing being logged in the ConfigandLog file when this happens. Can reproduce at will. Not limited to any specific report or filter.

Any ideas? Thank you!

# Answer
@astroned I just ran into this issue as well and traced it to a conflict with another plugin (mailpoet). It loads a php library called Html2Text that is completely different from what Civi includes (but accomplishes the same task). I modified CRM\_Utils\_String::htmlToText() to conditionally run the converting function based on which library was getting loaded (using method\_exists to determine which). Not ideal but that function performs a pretty basic task and I'm not too concerned about which of the two libraries is used.
> 2 votes

---
Tags: civireport, reports, custom-reports
---


# Question
Title: Find organizations that don't have employees with an active membership
To join, the employers of our members must sign an agreement. I would like to find organizations that have previously signed the agreement (indicated with a custom field), but no longer have any employees who are active members, so that the agreement can be terminated.

Using SearchKit, I am able to find organizations that have no employees in our database (see image). However, the query misses out on organizations that still have employees, but none of those employees have an active membership. I think this could be done if I could specify in the "With (optional) Contact Related Contacts" join that the related contact must also be the member of a group, but I don't think that's possible. Is there some other way to do this?

# Answer
> 1 votes
I finally figured it out:

1. Do "With (Optional)" to join in individuals that are active employees of the organization.
2. Do another "With (Optional)" to join in active memberships of those individuals.
3. Group by the display name of the organization.

Organizations with an empty membership type for employees can then easily be identified.

# Answer
> 1 votes
Does this get you what you want?

Not sure if i can paste here from the export

> `[ [ "SavedSearch", "save", { "records": [ { "name": "test", "label": "test", "form_values": null, "mapping_id": null, "search_custom_id": null, "api_entity": "Contact", "api_params": { "version": 4, "select": [ "id", "display_name" ], "orderBy": [], "where": [ [ "contact_type:name", "=", "Organization" ] ], "groupBy": [], "join": [ [ "Membership AS Contact_Membership_contact_id_01", "INNER", [ "id", "=", "Contact_Membership_contact_id_01.contact_id" ], [ "Contact_Membership_contact_id_01.membership_type_id:name", "=", "\"Related\"" ] ], [ "Contact AS Contact_RelationshipCache_Contact_01", "EXCLUDE", "RelationshipCache", [ "id", "=", "Contact_RelationshipCache_Contact_01.far_contact_id" ], [ "Contact_RelationshipCache_Contact_01.far_relation:name", "=", "\"Employer of\"" ], [ "Contact_Membership_contact_id_01.membership_type_id:name", "=", "\"Related\"" ] ] ], "having": [] }, "expires_date": null, "description": null } ], "match": [ "name" ] } ] ]`

---
Tags: searchkit
---


# Question
Title: Url redirection to a path with "de" for new Mailing
I have a CiviCRM (5.55.1) running on Drupal (9.4.8). The language ist set to German.

When I click "Neues Rundschreiben" aka "New Mailing", the URL of that menu item is https://MyHost/civicrm/a/#/mailing/new but then it redirects me to https://MyHost/**de**/civicrm/a/#/mailing/new. This give a Page not found error. If I remove the **"de"** from path, all works as expected.

This site does not use Mosaica and it does not have Multi-Language enabled.

It seems the only menu entry with this behavior.

Any Suggestion?

# Answer
> 1 votes
We had a similar problem and could resolve it by disabling the language detection by url in Drupal: /admin/config/regional/language/detection

The reason however is most liekly a bug with Moasaico which saves the complete URL including Drupal's language prefix liek this: domain/prefix/url-path

Some "static files" CiviCRM/Mosaico uses can currently only be used if the urls are saved without the language prefix.

---
Tags: mailing, localisation
---


# Question
Title: Conditional Allow Contacts to create or add a new case
CiviCRM Noob here...

I have the requirement to allow for contacts/individuals to file a request for benefit. I have a case and timeline created. My question is how does the contact initiate the case process? Specifically, only contacts/individuals of a specific smart group, to have that ability?

Not Antonymous. Contacts-CMS Authenticated users, based on a tag, or a group, more specifically, users without a tag.?.? Or apprea on the contact dashboard..?

Drupal 9 Civi 5.55

Thanks for any help and direction with this. I have CiviCRM entity installed, thinking rule based module display might do the trick but.. not as straight forward as I thought. No menu item available to create a link. so I am kinda lost

# Answer
You can use webform-civicrm if you need anonymous users to create cases.
> 1 votes

---
Tags: civicase, dashboard, user-dashboard, drupal-9
---


# Question
Title: API CSV import creates events that start and end at midnight
Importing the .csv quoted below to create Events. The snippet further down shows the field mappings. Everything comes across correctly except the time components of Start Date and End Date, which get set to 12:00 AM of the correct date. Once I get these to work, there are another 200+ to import. Anything I should do differently to capture the correct times?

```
Event Type,Start Date,End Date,Title,Default Role,Is Active,Is Public,Share Social
Performance,11/15/2022 07:00,11/15/2022 14:30,BBTB,Attendee,No,No,No
Performance,11/17/2022 07:00,11/17/2022 14:30,BBTS,Attendee,No,No,No

```

Using extension CSV GUI Import to api v1.10, CiviCRM 5.55.1, Drupal 7.91, PHP 7.4.33, MySQL 5.7.40

# Answer
Worked around this by following up on @petednz comment and sticking with the default date format. The failing imports used mm/dd/yyyy (1st snippet below). Selecting the default date format (yyyy-mm-dd) and reformatting the .csv accordingly (2nd snippet) parsed the times correctly.
> 2 votes

---
Tags: civievent, import
---


# Question
Title: Can a group have a child relationship to two or more different parent groups?
Assuming that I have the groups GR1, GR2, GR3, GR4, etc and parent groups PG-A and PG-B;

can GR1 be configured to be a child group both in parent group PG-A and simultaneously be a child group in parent group PG-B?

I could not find an answer in the CiviCRM documentation.

# Answer
After some thought and experimentation, I discovered that any group can be in more than one parent group.
> 2 votes

---
Tags: groups
---


title: Hypen before contribution amounts

text:
# Question
Title: Hypen before contribution amounts
I have been working with CiviCRM for years and I never had this problem before. I recently installed CiviCRM 5.56.0 on a new clients WordPress site, WP version 6.1.1.

I am attempting to set up a contribution page for donations the same way I always do, with the amount by itself without a label. See screenshot below.

However, this is how it is appearing on the front end, with a hypen (minus sign) before the amount. That should not be there and I can not figure out why it is there. Is it a bug in the latest release? It looks like a minus or negative sign and can be confusing to donors.

This is how it looks in every other CiviCRM install I manage and how I need it to look in this install. Can someone tell me what is going on and how I can fix it?

# Answer
There's a fix in 5.57 - https://github.com/civicrm/civicrm-core/pull/25033 \- but I can't then explain why some of your sites don't have the problem. What versions are your other sites?
> 2 votes

---
Tags: civicontribute
---


# Question
Title: Search Preferences set a custom Profile quick search - autocomplete fields drop down stops working. This is Why!
pretty sure this is related to TypeError: array\_flip():

New install, CiviCRM 5.55.2 on drupal9 php7.4

* setup few custom fields for INDIVIDUAL in new group, fields searchable. Not View only!
* Create profile with fields, used for search listing, directory.. all fields searchable. and result
* Set new profile as default contact - save

Autocomplete fails to list fields. clear cache, reset DB-triggers rebuild menu, etc no effect. return to search preferences, and get...

If you remove the custom profile, everything returns to normal and fields list under autocomplete again..

With this in mind I

* went back to my Profile and added a couple CONTACT fields, email, etc..
* set profile in search preferences
* Autocomplete stops working again
* I select another option in autocomplete contact search PHONE, etc and save.

Autocomplete field lists come back! with all the previous fields selected.

*adding contact fields with individual custom fields was not the fix. Selecting deselecting any of the fields, reordering the list causes it to break. whether or not a custom search profile is used or not.*

# Answer
> 1 votes
There is a fix at https://github.com/civicrm/civicrm-core/pull/25170, also with an upgrade script to fix any broken values in the database.

---
Tags: custom-fields, profile, custom-search, quicksearch, autocomplete
---


# Question
Title: Can I search for a contact using their Joomla UserID?
I need a way to find a list of contacts using a list of Joomla userIDs. Eg: I have a list of Joomla userids (23,55,69,505,9949) -- how can I use civiCRM search to find the related contact records for those userIDs?

# Answer
> 4 votes
You can create a search kit to find the contacts using user id in (23,55,69,505,9949)

```
[
  [
    "SavedSearch",
    "save",
    {
      "records": [
        {
          "name": "Joomla_User_Contacts",
          "label": "Joomla User Contacts",
          "form_values": null,
          "mapping_id": null,
          "search_custom_id": null,
          "api_entity": "UFMatch",
          "api_params": {
            "version": 4,
            "select": [
              "uf_id",
              "contact_id",
              "contact_id.display_name"
            ],
            "orderBy": [],
            "where": [],
            "groupBy": [],
            "join": [
              [
                "Contact AS UFMatch_Contact_contact_id_01",
                "INNER",
                [
                  "contact_id",
                  "=",
                  "UFMatch_Contact_contact_id_01.id"
                ]
              ]
            ],
            "having": []
          },
          "expires_date": null,
          "description": null
        }
      ],
      "match": [
        "name"
      ]
    }
  ]
]

```

---
Tags: advanced-search
---


# Question
Title: Mandatory key(s) missing from params array: entity_id
Using a fairly generic CiviCRM contribution page with membership (CiviCRM 5.19.4 + Drupal 7) and CiviDiscount (3.7).

When a 100% discount code is used, instead of completing, the above error is returned from line 2500 of CRM/Contribute/Form/Contribution/Confirm.php, which is an api call.

The api call is to "completetransaction", with values:

```
[id] => 1550
[trxn_id] =>
[payment_processor_id] => 3
[is_transactional] =>
[fee_amount] =>
[receive_date] =>
[card_type_id] =>
[pan_truncation] =>
[version] => 3

```

Since the spec for this api call doesn't include entity\_id, presumably this is cascading from a separate api call with the complete transaction.

The contribution is left as incomplete.

# Answer
> 2 votes
This one came up again for me so I set up some tracing. The error comes when the completetransaction api call tries to create a EntityFinancialTrxn, but there's no entity id. This is now with CiviCRM ver 5.49.5, CiviDiscount3.8.7

Here's the argument to the entity create call, which gets triggered as part of the completetransaction api call.

```
 [entity_table] => civicrm_financial_item
 [financial_trxn_id] => 6745
 [entity_id] =>
 [amount] => 0
 [version] => 3

```

I notice that in spite of the error, a valid pending contribution is created, and that it can be manually completed without error.

When I look at that successful manual completion and compare, I can see that the failed completetransaction is failing at the point where it should have already created an entry in civicrm\_financial\_trxn - it needs to do that so that there's an id that can go in the civicrm\_entity\_financial\_trxn as the entity id.

Since these are empty/dummy 'financial transactions', I suspect some logic somewhere in the financial system that's deciding it doesn't need to add an empty financial transaction.

Taking a different approach, I tried commenting out the completetransaction call in the Confirm.php page and discovered it tries twice to complete it, both times with notes about this being a bit of a kludge for membership edge cases.

After commenting both out, the UX no longer reports the error, though the contribution remains incomplete in the backend.

Conclusion: the completetransaction api seems to be where this needs fixing.

---
Tags: civicontribute, civimember, api, cividiscount
---


# Question
Title: Using internal anchor links in Mosaico emails
Even though anchor links don't work in all mail clients, we have still been using them in emails for tables of content in a monthly newsletter. It seems like at least a few others have run into the same problem we have, which is that Mosaico breaks anchor links:

How can I set up anchors in Mosaico mailing? Internal links in a Mosaico template?

I've found that the issue is actually because Flexmailer seems to try to apply tracking to all URLs, including anchor links, which breaks them. I've put those details here:

https://github.com/civicrm/org.civicrm.flexmailer/issues/43

Does anyone have ideas how this could be fixed simply?

# Answer
> 1 votes
Adding an answer for completeness' sake:

This was a bug and it was fixed last year in the following commit https://github.com/civicrm/civicrm-core/pull/20115

So if you update your Mosaico extension, it should be fine.

Credit: @LarsSG

---
Tags: mosaico, flexmailer
---


title: How do I add a custom Name Badge?

text:
# Question
Title: How do I add a custom Name Badge?
Civi offers four default Event Name Badges, but we need something different (same size as an Avery L4727 label). Can anyone direct me to how to add a custom name badge? We're using Civi 4.6.15.

Thanks

# Answer
We're using 4.7.8 and can do this without having to enter it directly into the database.

If you go to Administer \> System Settings \> Option Groups \> Name Badge Format and add a new name badge format you can enter the values you want in the value field. eg {"paper-size":"a4","orientation":"portrait","font-name":"times","font-size":6,"font-style":"","NX":2,"NY":4,"metric":"mm","lMargin":6,"tMargin":19,"SpaceX":0,"SpaceY":0,"width":100,"height":65,"lPadding":0,"tPadding":0}

Then you can adjust those details for your requirements and the settings will be available for your badge layouts.
> 3 votes

# Answer
It's not very strait forward, but here are the steps needs, (credit to Kasia Wakarecy) as commented in the old CiviCRM forum (https://forum.civicrm.org/index.php?topic=35420.0):

The new badge templates can be added through Administer \> System Settings \> Option Groups \> Name Badge Format. That interface only allows to enter the new badge name and a description but no info about the layout. To actually tell CiviCRM some details about that badge layout, direct database update is required to add that value:

1. To know which value to update in the database, run first this query:
`SELECT id FROM`civicrm\_option\_value`WHERE name = "Avery 5392"`
where "Avery 5392" is the name of the new badge layout you just added. The result is going to be like id = 847.
2. Enter the layout details for that badge into the DB using this query:
`UPDATE civicrm_option_value
SET value = '{"name":"Avery 5392","paper-size":"letter","metric":"mm","lMargin":2,"tMargin":25.4,"NX":2,"NY":3,"SpaceX":0,"SpaceY":0,"width":101.6,"height":76.2,"font-size":12,"orientation":"portrait","font-name":"helvetica","font-style":"","lPadding":3,"tPadding":3}' WHERE `civicrm_option_value`.`id` = 847;`

Update the id = 847 with the id number from the first query.

The fields above mean:

```
'name' => '5395' // name of label
'paper-size' => 'a4' // paper size
'metric' => 'mm' // units
'lMargin' => 15 // left margin in mm (because metric = mm)
'tMargin' => 26 // top margin in mm (because metric = mm)
'NX' => 2 // number of items in x (left to right) direction
'NY' => 4 // number of items in y (top to bottom) direction
'SpaceX' => 10 // spacing between items in x (left to right) direction in mm (because metric = mm)
'SpaceY' => 5 // spacing between items in y (top to bottom) direction in mm (because metric = mm)
'width' => 83 // width of one item in mm (because metric = mm)
'height' => 57 // height of one item in mm (because metric = mm)
'font-size' => 12 // font size
'lPadding' => 3 // left padding in mm (because metric = mm)
'tPadding => 3 // top padding in mm (because metric = mm)

```
3. Now, that new layout/template is available when adding new Event Badge Layouts (civicrm/admin/badgelayout?reset=1&action=browse)
> 6 votes

# Answer
There is an even simpler way to add a name badge format. Just create a normal mailing label format and then copy it to a new name badge format.

1. Go to Administer - Communications - Label Formats
2. Add a label format with all the dimensions you need for your name badges and save.
3. Go to Administer - System Settings - Option Groups and select Edit Options for Mailing Label Format.
4. Copy the value of the new label format you just created.
5. Return to Option Groups, but this time select Edit Options for Name Badge Format.
6. Add a new Name Badge Format, paste in the value and add a name.
7. You can now go back to Administer - Communications - Label Formats and delete the label you created as it was just temporary to copy.
8. Now go to Admin - CiviEvent - Event Name Badge Layout to set up your the fields on your name badges.
> 2 votes

---
Tags: civievent
---


# Question
Title: How is email_id field on civicrm_group_contact table used?
See also https://lab.civicrm.org/dev/core/-/issues/4032

# Overview

I'm currently working with an organisation who are moving to CiviCRM. They have contacts, who frequently have multiple employers, typically with a work email address for each employment. When signing up to email groups, it's often useful for these contacts to be able to control which group subscription goes to which email address.

For example:

We have a contact, Bob. Bob is employed by CompanyA and CompanyB, and has the email addresses bob@company-a.com and bob@company-b.com. bob@company-a.com is the primary email address.

Bob signs up for two three mailing lists, but wants two to go to his primary email address and one to go to his secondary email address.

# Current behaviour

This isn't something which is possible through the current CiviCRM UI, which is fine (I can't imagine this use-case is that common).

However, looking at the database table civicrm\_group\_contact it has a field email\_id, with the comment Optional email to associate with this membership. This field is exposed in the CiviCRM API and SearchKit.

As far as I can tell, it appears that this email\_id field is not actually used by any logic within CiviCRM core. It seems to be at least 10 years old (dating back to the pre-Git days), and so it's possible the email\_id was introduced as part of a feature that was never finished.

# Expected behaviour

I had assumed that when email\_id was set, this email address would be used as the email address to actually be emailed, when sending a bulk mailing to a group via the CiviMail component. This unfortunately does not seem to be the case.

Currently it is possible to set the "Location Type" and "Selection Method" when selecting a group as part of the new mailing form. If a location type is set I would expect it to take precedence over the configured email\_id (although this detail could be debated either way).

Whilst it might be nice if there was an associated UI to select the email address, I don't think any UI changes are required to make the email\_id field useful - if CiviCRM simply uses the value (as set via plugin code or the API) that would be enough to enable the use case detailed above.

# Comments

It's possible that I'm completely misunderstanding what the email\_id field is for, and it is actually used - if so I'd love to know the details from someone closer to this area of the core code!

So I guess my question are:

1. Has anyone else come across a requirement like this, and how did you get around it?
2. Does anybody know the history of the email\_id field in the civicrm\_group\_contact table?
3. Is there an alternative solution which I'm missing?

# Answer
The field apparently was added to CiviCRM in version 1.1 https://github.com/civicrm/civicrm-core/blob/master/xml/schema/Contact/GroupContact.xml#L106 so it is very possible it is no longer used. You can use the svn repo at https://github.com/civicrm/civicrm-svn to do more investigation if you want of the code references as well as confirm when it was added to the schema - the comment seems odd on the line cited above.

If you can't find the field in the curren codebase, then, yes, it might be cruft that could be used for something else, but best practice would be to remove it.

I would be cautious when searching the codebase for references since fields are often not prefaced by a table in PHP code, and sometimes fields are implicitly referenced as a group. Probably grep'ing email\_id would be a tedious but good place to start.

Putting up a PR to remove it would be useful in the normal course of finding an unused field.

I discourage repurposing of core fields for alternative purposes. It is safer if you are going to create a custom extension to handle emails for groups in other ways to just create a new my\_email\_id field. That way your extension won't get battered by a cruft cleanup of core down the road, or leave you asking core maintainers to not merge the cleanup because of your extension's use.

In general I think it would be good to make it more feasible to use different location types for cases where it defaults to primary email. If you need support to facilitate this by refactoring a core file, eg to add a hook, please ping me.
> 1 votes

---
Tags: core, civigroup
---


# Question
Title: "Cron not running" message, but definitely is
There are a lot of questions here on the message "Cron not running", but I have failed to find one that actually describes how CiviCRM keeps track of this, which might help explaining what we see in our installation.

We have a cron job that runs the "execute" job every five minutes:

```
EXECUTE_ALL = -e Job -a execute
# cronjob for execution of all CiviCRM jobs
# m h dom mon dow command
*/5 * * * *   cd $CIVI_ROOT; $PHP bin/cli.php -j -s $CIVISITE -u $CIVIUSER -p $CIVIPASS $EXECUTE_ALL

```

And Civi reports that each job has run successfully. But we still have this:

Civi´s job "control" thinks the last run was at 02:26 but the Bounce fetcher was last run at 11:10.

We are at UTC+1, Joomla 3.10.4, CiviCRM 5.47.3, Ubuntu 20.04, mysql Ver 15.1 Distrib 10.3.34-MariaDB.

The timestamps in the `_civicrm_job_log` database table is consistent with our actual time.

Can I still be seeing some timezone issue?

# Answer
> 1 votes
After googling and searching a bit more, it looks like CiviCRM considers the Update Check job as the heartbeat that it monitors.

And as others have noted in other questions and answers on this topic, it needs to run at least hourly for CiviCRM to consider the cron jobs to be functional.

So, if you have this warning, check how often your "CiviCRM Update Check" job is run at least hourly (as is in fact recommended).

# Answer
> 0 votes
I too have a similar problem. Cron is most certainly running, but our WordPress instance insists that Cron is not. I changed our update Check job from daily to hourly, as suggested above, but this didn't alter anything.

To be clear, for us, CiviCRM does not report that jobs are successful. CiviCRM jobs simply never happen.

As you can imagine I am keen for insights. Each time we do a newsletter mailout or an announcement, I have to force the job to execute manually (Settings \> Scheduled Jobs \> pick the one I want \> Execute now).

If more appropriate, I can compose a separate question for my case, but the general symptoms seem to be quite similar to those described above.

---
Tags: cron-job, timezone
---


# Question
Title: Should Word Replacement work on button text?
I have a contribution form page that is primarily used by folks who want to sign up for membership, which in many cases does not require payment. I would like the button on the bottom, which currently shows a checkmark and the word "CONTRIBUTE", to say "SUBMIT". I have tried putting that as a Word Replacement, both with all lowercase and all uppercase, but without impact.

In fact, I am not sure Word replacements are working at all. They didn't work on a word I used in the body of a form, as a test, but that's not necessary, I can edit the word itself.

Any ideas? If Word Replacement will never work, can anyone point me to where the 'CONTRIBUTE" button text can be edited directly? Thanks! (Using CiviCRM with WordPress, current versions.)

# Answer
Yes, Word Replacements does work for this. I replicated your issue as it is case sensitive. The helper text says:

*IMPORTANT: Replacements are case-sensitive whether 'Exact Match' is checked or not.*

To get it to work you need to enter it as **Contribute** in Propercase.

I referenced the value of it below as custom CSS styling could differ from the value:
> 6 votes

# Answer
Here is an example of a CSS alternative that I am using. Colors and positioning will vary depending on your theme.

```
/* Change text color to background color of button to make original text invisible, and set button line height */
.crm-contribution-page-id-3 #_qf_Main_upload-bottom { color: #a3ce1e; line-height: 5px; }
/* Add new text, format and reposition over original text */
.crm-contribution-page-id-3 #_qf_Main_upload-bottom:after { content: "Join"; text-indent: 0; display: block; color: #ffffff; position: relative; top: -9px; }
/* Change text color of the check mark back to be visible */
.crm-contribution-page-id-3 .fa-check { color: #ffffff; }
/* Change original text color on hover to also be invisible */
.crm-contribution-page-id-3 #_qf_Main_upload-bottom:hover { color: #7ebb45; }

```
> 4 votes

---
Tags: forms
---


# Question
Title: (Fixed) CRM_Custom_Import_Form_Summary error when sending one of email
When trying to send an individual mail I get a 500 error POST /administrator/?option=com\_civicrm&task=civicrm/activity/email/add&action=add&cid=7070&selectedChild=activity&atype=3&snippet=json&crmAngularModules=af,afCore,afsearchGrants,angularFileUpload,api4,checklist-model,crmDialog,crmResource,crmSearchDisplay,crmSearchDisplayTable,crmSearchTasks,crmUi,crmUtil,dialogService,ngSanitize,ui.bootstrap,ui.sortable HTTP/1.0

and a PHP error AH01071: Got error 'PHP message: PHP Fatal error: Declaration of CRM\_Custom\_Import\_Form\_Summary::preProcess() must be compatible with CRM\_Contact\_Import\_Form\_Summary::preProcess(): void in /var/www/vhosts/springsdancecompany.org.uk/httpdocs/administrator/components/com\_civicrm/civicrm/CRM/Custom/Import/Form/Summary.php on line 13', referer: https://springsdancecompany.org.uk/administrator/?option=com\_civicrm&task=civicrm/contact/view&reset=1&cid=7070

Running 5.54.0 on Joomla 3.10 (at present due to errors I am unable to upgrade further)

Problems seemed to start with 5.54.0 upgrade and what I presume is the move of afforms into the core product

# Answer
> 2 votes
I know you said drupal but that url is joomla, so I think this is that joomla issue where you have to delete the civi code folder completely and replace it with the new version, but that isn't natively how joomla works, so you still have code files from the earlier version in the tree. The file CRM/Custom/Import/Form/Summary.php no longer exists in 5.54 but it's still there in your files and getting in the way.

I'd start by just deleting/renaming that file and see how it goes.

See also the last paragraph in this section: https://docs.civicrm.org/sysadmin/en/latest/upgrade/joomla/#install-the-extension

---
Tags: civimail, joomla
---


# Question
Title: Is there a log or record of CiviCRM updates I've done?
Our scheduled jobs stopped working on December 8. Is there a way to see if we updated our installation at, or around, that date?

We have updated once after that. I can see some PHP files that have that date so it seems reasonable that we did an update then.

# Answer
The table civicrm\_log has a record of updates - if you filter/query the civicrm\_log.data column for "update" you might see what you want.

You can also access via API Explorer with something like

EDIT You may need to set the "limit" set higher than default 25, and "order by id desc" to help see the latest entries. (from comment by thoni56)
> 2 votes

# Answer
Do you mean a log of when files in the filesystem were changed? That isn't recorded in civi. If you mean a log of when CRM/Upgrade/Incremental/XXX scripts were run then it depends how you ran it. If you ran using the UI then it will be in ConfigAndLog. If you ran using cv then it depends if you logged the output anywhere.
> 0 votes

---
Tags: logs, install
---


# Question
Title: How do we deter malicious Civi Contribute credit card testing?
We have experienced recent malicious credit card testing attacks against our Civi/Joomla/Stripe site's Contribute pages. How have others successfully deterred such attacks?

**Our site:**

* CiviCRM 5.52.2
* Joomla! 3.10.11
* Stripe Processor 6.7.10

We use a publicly accessible Civi Contribute page for donations. Up until these attacks yesterday, Joomla login was not required for a user to submit a donation payment on this page. Ideally, we would like to remove the login requirement again to provide a seamless path to donation for non-members.

**What happened:**

Our publicly accessible Civi Contribute donation page started receiving invalid $2 charge attempts at a frequency of ~1 charge per second. Stripe successfully identified these as spam and thankfully blocked every charge (10k+ individual charges).

The frequency of requests to the web server brought the site to a crawl. Accessing the web GUI for Civi and Joomla was nearly impossible. The database also spun up to consume 95% of our available CPU while attempting to handle the queries associated with each malicious charge attempt.

Using Stripe Radar and the Apache access logs, we determined that the attackers were using rotating IP addresses (many hundred per hour).

**What we did (in order):**

* Blocked some of the recurring malicious IPs addresses using our firewall. This did not help, as the attacker just rotated IPs.
* Added a reCAPTCHA to the Civi Contribute page. This did not have any effect on the attacks.
* Blocked access to the Civi AJAX API using an Apache .htaccess RewriteRule. This stopped the invalid charges from reaching Stripe but also expectedly broke legitimate payment requests.
* In the web GUI, modified the Joomla Access Control setting for "CiviCRM: access AJAX API" to only be allowed for logged-in Joomla users.

After blocking non-logged in users from submitting payments we continued to see attack requests at a high frequency for another 3 hours. All those requests were correctly returned a 403 or 500 error. The database took 3 hours to finish processing the queries for the malicious payment attempts.

How have others successfully deterred such attacks? What additional mitigation would folks recommend if want to remove the login requirement from the Contribute page?

Thank you!

# Answer
> 2 votes
For future reference, here is how we solved this issue:

We implemented the below changes, which have successfully deterred a card testing attack since:

* Installed the Civi Firewall extension (https://lab.civicrm.org/extensions/firewall). This extension works alongside the Stripe extension to automatically block IP addresses whose payment attempts return fraudulent or blocked status from Stripe. Highly recommend this as a first step.
* Worked with MJW Consulting to add and install a function to the Stripe Extension which sets a global minimum payment amount for the Stripe Extension (in our case, a $10 limit, as all testing transactions were less than that). This prevents the payment requests from ever reaching Stripe, if under the limit. I am not 100% sure if this feature will be included in Stripe Extension 6.8 for all users, but it is a really great feature.
* Enabled Stripe's Radar feature temporarily to identify IP addresses carrying out the attack that weren't rotating and block at the web server firewall (had a few Microsoft Azure IPs in the mix that were being heavily reused).

# Answer
> 1 votes
Welcome to SE! Are you using https://lab.civicrm.org/extensions/firewall ? Not sure whether it will help with rotating IP's but worth looking at.

# Answer
> 1 votes
This does not help your situation but for Drupal users, if you use CiviWebform Integration for your contribution pages. You can set it so that the user/ip cannot process the form more than Xs in an hour.

# Answer
> 1 votes
One of the easiest ways to prevent your site from being used for credit card tumbling is to set a minimum amount on your donation form. The reason card tumbling is always with small $ amounts is b/c they are trying to stay under the radar from a card holder’s perspective (until they find a set of credentials that works - and then go big).

Re: https://home.iatspayments.com/blog/why-credit-card-processing-matters-for-your-business/

# Answer
> 0 votes
I wanted to point out a recent question/answer I had Server access error for event registration with credit card

Where in order to make event registration work I had to change the ACL for the ajax api "public" which I never had needed before. I think that is a bug that was somehow introduced somewhere in the interaction of Joomla and Civicrm.

---
Tags: civicontribute, contributions, contribution-page, stripe, security
---


# Question
Title: Fuzion token {latestcurrentmembership.end_date} blank in scheduled reminder based on membership - works in mailings. Alternative?
We use the Fuzion Tokens extension and it's great! We have a membership expiration alert message template using {latestcurrentmembership.end\_date} and it works perfectly well in mailings. However, in testing scheduled reminders, I see that for a record where the value displays appropriately in the mailing, it's blank in the email sent by the reminder.

The reminder is based on the membership expiration date and it works. All the tokens display in the drop-downs for Email Screen in the schedule reminder interface. What else might be going on? What can I check? Is there a native token I could use instead? This is CiviCRM 5.50.2 on Wordpress 6. Thanks for any ideas!

Update: same problem with this particular token in scheduled mailings. The fix is to use {latestcurrentmembership.allend\_date} instead.

# Answer
> 1 votes
Much better answer! I found this older question: Civimember: token for membership end date not working for scheduled mailings, and it also works for reminders! The working token is {latestcurrentmembership.**all**end\_date} - that "all" makes it work. Sorry if there's Fuzion documentation about this that I missed!

# Answer
> 2 votes
I used a workaround which gives the same result. Because the reminder triggers based on the expiration date, I plugged in a Smarty snippet that will match the expiration and created new templates to use just for the reminders. So for the "one week before" I have `{$smarty.now+24*60*60*7|date_format}`, and for "two days before" `{$smarty.now+24*60*60*2|date_format}`. Not as elegant but accomplishes the goal.

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


# Question
Title: Can I use SearchKit to display a specific Contact Tag on a public directory?
I am building a membership directory and want to display information on each member that is contained in the form of Contact Tags. I can obviously display the full list of Tags, but we use some for back office purposes. I am using SearchKit to build the dataset for the directory, as the requirements go beyond the capabilities of other Civi searches. So for instance, I would like to display (on a public directory / form) the Tag "Founding Contributor" (which identifies a category of donor) whilst excluding other Tags associated with that Contact. I have Tags grouped in Tag Sets, which helpfully distinguish "back office" Tags from others.

# Answer
You should be able to if you add 'Contact Tags' as a required or optional entity and then limit to the specific tag you want to include.
> 2 votes

# Answer
I have found that I can specify a second Contact.Tag as an optional entity to show a second Tag in a separate Column...
> 1 votes

---
Tags: tags, searchkit, directory
---


# Question
Title: CiviRule to chase volunteer for application form two weeks after it has been sent
I'm trying to build a CiviRule to chase a volunteer for an application form, two weeks after the application form has been emailed to them, by sending them a second email reminding them of the outstanding application form. (In the version of the rule shown in the screenshot, I've turned off the 2-week delay for testing purposes.)

The application form is (manually) emailed to the volunteer, creating the Activity of type "Email" with subject "Volunteer Application Form". So I search for volunteers with incomplete application forms (via a smart group, which I've tested) after a new activity of type 'Email' and subject 'Volunteer Application Form' is added. That's the theory at least but the rule never triggers. I've tried lots of different attempts, including not using a smart group, but to no avail. The closest I've gotten to success is I remove the need to be a volunteer then the rule triggers for me, the person carrying out the activity of sending the application form to the volunteer, but this isn't what I want--and in that case also, the volunteer himself/herself never gets the chaser.

Please let me know if you have any suggestions, or different ways of approaching the same problem. Thanks!

Per a helpful suggestion from Lars below, and after further experimentation, I'm now fairly sure there is a bug in CiviRules.

| Test | Trigger | Linked Condition | Linked Action | Action | Outcome | As Expected |
| --- | --- | --- | --- | --- | --- | --- |
| 1 | Activity is added: Trigger for **all contacts** | Null | Add Tag to Contact | Phone Call or Meeting | *Only* Target is tagged | No |
| 2 | Activity is added: Trigger for **all contacts** | Null | Add Tag to Contact | Email | *Only* Source is tagged | No |
| 3 | Activity is added: Trigger for **Activity Target** | Null | Add Tag to Contact | Email | *Neither* Target nor Source is tagged | No |
| 4 | Activity is added: Trigger for **Activity Source** | Null | Add Tag to Contact | Email | *Only* Source is tagged | Yes |

# Answer
> 0 votes
Your rule is set for All Contacts. Have you tried setting it for Activity Target - it doesn't explain why it isn't working for 'All Contacts' but worth confirming I think

If that makes no difference then there is also the option to add a Condition to specify the Target

---
Tags: civirules
---