# Question
Title: What does IDS (Intrusion Detection System) exactly? What happens if I disable it?
One of my clients sends emails with click-through links. And sometimes, after clicking on the link, the following message is displayed.

I did some research. The error is generated from a piece of code that does an IDS check. IDS stands for Intruder Detection System. It can be disabled in Drupal 7 by granting the skip IDS check to the anonymous user.

Now I have a workaround, but comment of the grants says *this permission has security implications*

What are exactly this security implications? Clients are always reluctant in disabling security stuff.

The work for IDS is done by the PHP package PHPIDS. It can be found on GitHub https://github.com/PHPIDS/PHPIDS. I could not find any documentation about how it works. The stats show me the following.

* The project is a bit old. Last commit in 2014.
* The project was also popular - 224 forks.

So maybe the IDS solves a problem from a long time ago and is not needed any more. Does someone (with a good memory) know the answers?

# Answer
> 1 votes
It still has a use and does catch some attacks, but it does sometimes give false positives for civi (e.g. copy/pasting a long email thread into an activity is the one I usually see), and yes is very old. Some firewalls have traffic analysis that can be an alternative, or if you have access you could install an alternative IDS like Snort.

---
Tags: permissions, security
---


# Question
Title: Can 'civi version' show release candidates?
We have a bash update script that gets all released versions with `civi version` command but how do I find the release candidates?

# Answer
Are you trying to get the number or the tar file? If the tar file you can just do e.g. https://download.civicrm.org/latest/civicrm-RC-drupal.tar.gz (see https://download.civicrm.org/latest/)
> 1 votes

---
Tags: sysadmin
---


# Question
Title: Contribution Test Pages work only for Amount = $1.00
I hesitated to raise this issue because I've probably made a real rookie mistake somewhere. My Contribution Pages work fine in production mode but the transactions are not recorded in CiviCRM when I use Test Mode. All my Contribution Pages are affected. I posted an earlier question Contribution Pages are not working in Test-Drive Mode about this when I thought that all Tests were failing. Here's the screenshot iATS log in CiviCRM

It shows that $1.00 transactions in Test Mode are OK. Test transactions for other amounts are Rejected. What am I missing? Is this a CiviCRM problem or an iATS problem? (CiviCRM 5.48.0 on WordPress Version 5.9.3)

# Answer
That's functioning as it should -\>

VISA 4222222222222220 / exp date in future and CVV any 3 digits -\> will result in OK for all $amounts

VISA 411111111111111 / exp date in future and CVV any 3 digits -\> will produce results based on the $amount

Documentation: https://content.iatspayments.com/developers-test-credit-card-numbers

PS - and test transactions are hidden from the normal UI. So you will want to Contributions -\> Find Contributions and then specifically indicate "Contribution is a Test" -\> hit the Yes radio button.

PS2 - alternatively you can set up the iATS test payment processor as it's own payment processor in CiviCRM and then process LIVE with fake VISA. These transactions are easier to find but they do require some ad-hoc clean up.
> 2 votes

---
Tags: civicontribute, contribution-page, iats, testing
---


# Question
Title: How to print USA tax receipt to individuals?
I see a seperate extension for Canadian Tax Receipts, but I need to print out tax receipts that are USA compliant for all individuals.

How can I generate a tax receipt for the USA?

UPDATE:

More specifically, we need to generate a tax receipt for Contacts that have the annual total (not individual contributions) of each financial type that is tax deductible. So for example if we had three financial types of say Donations (tax deductible) and Building Fund (tax deductible) and Book Sales (not tax deductible) it would show the total for the entire year for their Donations and then the total for the entire year for their Building Fund contributions, but would not show the Book Sales.

# Answer
We use Thank You Letters for our US year-end receipts Go to Find Contribution, set the date for last year, select the financial type(s), and Refresh Results. This gives you the list of contributions. Check "All Records" Then under actions select "Thank You Letters-Print or Email." On the Thank You screen Group by "Contact and Financial Type" Separator set to "Horizontal Cell"

You will have to create the receipt so it pulls in the information you need. Below is our code. We use line items so you will have to edit this code to your needs.

```
    <table border="0" style="width: 900px;">
    <tbody>
        <tr>
            <td width="30%"><img height="auto" src="https://secure.radiusinternational.org/sites/default/files/images/Receipt%20Logo%20wAddress.png" width="275" /></td>
        </tr>
        <tr>
            <td style="text-align:left; font-weight: bold; padding-top:60px;" width="50%">{contact.addressee}</td>
            <th style="padding-top:60px; text-align:center; color:#70551F;padding-left:100px; ">2021 Contribution Statement</th>
        </tr>
        <tr>
            <td style="text-align:left; " width="40%">{contact.street_address}</td>
            <td style="text-align:center; font-style: italic; color:#281c1d;padding-left:100px;  ">January 1, 2021 - December 31, 2021</td>
        </tr>
        <tr>
            <td width="40%">{contact.city}, {contact.state_province} {contact.postal_code}</td>
            <td style="text-align:center; font-style: italic; color:#281c1d; padding-left:100px; ">Federal Id # 27-4638772</td>
        </tr>
    </tbody>
</table>

<p style="font-size:18px; font-weight: bold;font-style: italic; color:#70551F;">Thank you for your support of XYZ Foundation in 2021</p>

<p>No goods or services were received for these Tax Deductible contributions</p>

<table align="left" cellpadding="4" cellspacing="0" class="table" style="width: 875px;border: 1px solid #fff;">
    <tbody>
        <tr style="padding: 8px; border: 1px solid #fff;color:white; background-color: #70551F;">
            <th style="padding: 8px;">Date</th>
            <th style="padding: 8px;">Cont ID</th>
            <th style="padding: 8px;">Contribution Designation</th>
            <th style="padding: 8px;">Amount</th>
        </tr>
        <!--

    {foreach from=$contributions item=contribution} {assign
    var="date" value=$contribution.receive_date|date_format:"%B %d %Y"}
{crmAPI var='result' entity='LineItem' action='get' contribution_id=$contribution.id}
  {foreach from=$result.values item=lineitem}

  -->
        <tr style="padding: 4px; border: 1px solid #281c1d;">
            <td style="font-size:.8em; padding: 1px; border: 1px solid #fff;">{$date}</td>
            <td style="font-size:.8em; padding: 1px; border: 1px solid #fff;">{$contribution.id}</td>
            <td style="font-size:.8em; padding: 1px; border: 1px solid #fff;">{$lineitem.label}</td>
            <td style="font-size:.8em; text-align:right;padding: 1px; border: 1px solid #fff;">$ {$lineitem.line_total}</td>
        </tr>
        <!--
    {/foreach}{/foreach}

 -->
        <tr style="padding: 3px; border: 1px solid #281c1d;text-align:right;padding-top:10px;">
            <th colspan="3" style="padding: 3px; border: 1px solid #fff;text-align:right;padding-top:10px;padding-right:20px;">2021 Total Contributions</th>
            <td style="padding-right: 4px; border: 1px solid #fff;padding-top:10px;text-align:right;">$ {$contribution_aggregate}</td>
        </tr>
    </tbody>
</table>

```

FYI,

1. We have some donors (foundations) that do not not need/want year-end receipts. We make them as do not SMS. Since we use Line Items, we pull a line item report check Is Not SMS and whatever other filters we need. We add those contacts to a group. Then in the Find Contribution step we filter by Group "XYZ".
2. We have over 700 receipts to create. Our server cannot process the thnak you letters. We have to ask our webhost to boost our processing timeout and memory so we can do this. They bump it up and back down once we finish.
> 1 votes

# Answer
Can you update the invoicing message template to print the tax receipt?
> 1 votes

# Answer
You may want to have a the Donation receipts extension. It was primarily build for German tax receipts but may be a good starting point for what you have in mind.

Unfortunately documentation is a bit outdated and it has quite some features not described yet but you should get the hang of it.
> 1 votes

# Answer
So I picked Iowa Boy's answer as correct because it helped me figure out the basics of what I wanted to do.

However I modified it to better suit our needs. We did not need line items, but just the full amount of each contribution. I also wanted to be able to show either Tax Deductible contributions or Non tax deductible contributions or both.

The template I have provided below has a couple variables you can set, depending on what you want for the output:

`show_which_contribs`

* set this to 1 if you want to show both Tax-Deductible and Non-Tax Deductible contributions.
* set this to 2 if you want to show only Tax-Deductible contributions.
* set this to 3 if you want to show only Non-Tax Deductible contributions.

`group_contribs_by`

* set this to 1 if you want to list all individual contributions seperately.
* set this to 2 if you want to show only a summary/total of Tax-Deductible and/or Non-Tax Deductible contributions.

So go ahead and use FIND CONTRIBUTIONS to narrow down your results to whatever you want (date range and/or specific contacts). Then from the results, select ALL RECORDS and then choose THANK YOU LETTER-PRINT OR EMAIL. For GROUP CONTRIBUTIONS BY choose CONTACT. Then for the template you can use the following:

```
<!-- ** TEMPLATE TO CREATE A USA TAX RECEIPT by JEFF SHERK https://civicrm.stackexchange.com/questions/41120/how-to-print-usa-tax-receipt-to-individuals **
  ** CHOOSE SOME OPTIONS HERE:

  ** show_which_contribs :: 1=show both tax-deductible and non-tax-deductible contributions (default)  2=only show Tax-Deductible  3=only show Non-tax-deductible
  {assign var="show_which_contribs" value=1}

  ** group_contribs_by :: 1=no grouping, just show all individual contributions (default)  2=show summary of total only of Tax-Deductible and Non-tax-deductible (no individual contributions shown)
  {assign var="group_contribs_by" value=1}

-->

<p><span style="font-size:150%;">My Company Name</span><br />
123 Some Street, City, State 12345<br />
Phone: +1 555 555-5555    Federal EIN: 12-3456789<br />
<br />
<!--
  ** CHECK IF OUR OPTIONS ABOVE ARE VALID. DEFAULT THEM TO 1 IF THEY ARE NOT. **
  {if $show_which_contribs != 1 AND $show_which_contribs != 2 AND $show_which_contribs != 3}
    {assign var="show_which_contribs" value=1}
  {/if}
  {if $group_contribs_by != 1 AND $group_contribs_by != 2}
    {assign var="group_contribs_by" value=1}
  {/if}
  ** NEED TO LOOP THRU ALL CONTRIBUTIONS TO FIND THE FIRST/EARLIEST CONTRIBUTION DATE AND THE LAST/LASTEST CONTRIBUTION DATE **
  {assign var="date_from" value="2099-12-31"|date_format:"%Y/%m/%d"}
  {assign var="date_to" value="1999-01-01"|date_format:"%Y/%m/%d"}
  {foreach from=$contributions item=contribution}
    {assign var="contribution_date" value=$contribution.receive_date|date_format:"%Y/%m/%d"}
    {if $contribution_date < $date_from }
      {assign var="date_from" value=$contribution.receive_date|date_format:"%b %e, %Y"}
    {/if}
    {if $contribution_date > $date_to }
      {assign var="date_to" value=$contribution.receive_date|date_format:"%b %e, %Y"}
    {/if}
  {/foreach}
  ** SHOW THE DATE RANGE ON THE RECEIPT. IF BOTH DATES ARE THE SAME, THEN ONLY SHOW ONE DATE **
--></p>

<p><b>Contributions Summary</b> - <!-- {if $date_to eq $date_from} --> {$date_from}<br />
<!-- {else} --> {$date_from} to {$date_to}<br />
<!-- {/if} --></p>

<hr />
<p>For:<br />
<span style="font-size:110%;"><b>{contact.addressee}</b></span><br />
{contact.street_address}   {contact.city}   {contact.state_province}   {contact.country}   {contact.postal_code}</p>

<table align="left" cellpadding="1" cellspacing="1" style="width:100%; border: 2px solid black; font-size:90%;">
    <thead>
        <tr align="left" style="font-size:80%;">
            <th style="border: 1px solid black;">Date</th>
            <th style="border: 1px solid black;">Type</th>
            <th style="border: 1px solid black;">Source</th>
            <th style="border: 1px solid black;">Tax Deductible</th>
            <th style="border: 1px solid black;">Amount</th>
        </tr>
    </thead>
    <tbody><!--
    {assign var='total_contrib_non_tax' value=0}
    {assign var='total_contrib_tax' value=0}
    {assign var='total_contribs' value=0}
    {foreach from=$contributions item=contribution}
      {assign var="date" value=$contribution.receive_date|date_format:"%b %e %Y"}
      {assign var="financial_type_id" value=$contribution.financial_type_id}
      {assign var="financial_type_name" value=$contribution.financial_type}
      {assign var="contribution_source" value=$contribution.contribution_source}
      {assign var="contribution_total_amount" value=$contribution.total_amount}
      {$contribution_total_amount|string_format:"%.2f"}
      {crmAPI var='resultFinancialType' entity='FinancialType' action='get' id=$financial_type_id}
      {assign var="financial_type_is_deductible" value=$resultFinancialType.values[0].is_deductible}
      {if $financial_type_is_deductible eq '1'}
         {assign var="financial_type_is_deductible" value="Tax-Deductible"}
         {if $show_which_contribs == 1 OR $show_which_contribs == 2}
            {assign var='total_contrib_tax' value=$total_contrib_tax+$contribution_total_amount}
            {assign var='total_contribs' value=$total_contribs+$contribution_total_amount}
         {/if}
      {else}
         {assign var="financial_type_is_deductible" value="Non tax deductible"}
         {if $show_which_contribs == 1 OR $show_which_contribs == 3}
            {assign var='total_contrib_non_tax' value=$total_contrib_non_tax+$contribution_total_amount}
            {assign var='total_contribs' value=$total_contribs+$contribution_total_amount}
         {/if}
      {/if}
      {$total_contrib_non_tax|string_format:"%.2f"}
      {$total_contrib_tax|string_format:"%.2f"}
      {$total_contribs|string_format:"%.2f"}
       {if $group_contribs_by == 1 AND ($show_which_contribs == 1 OR ($financial_type_is_deductible == "Tax-Deductible" AND $show_which_contribs == 2) OR ($financial_type_is_deductible == "Non tax deductible" AND $show_which_contribs == 3)) }
  -->
        <tr style="font-size:80%;">
            <td>{$date}</td>
            <td>{$financial_type_name}</td>
            <td>{$contribution_source}</td>
            <td>{$financial_type_is_deductible}</td>
            <td>${$contribution_total_amount}</td>
        </tr>
        <!--
       {/if}
    {/foreach}
      {if $group_contribs_by == 2}
       {if $show_which_contribs == 1 OR $show_which_contribs == 2}
-->
        <tr>
            <td> </td>
            <td> </td>
            <td> </td>
            <td>Total Tax-Deductible</td>
            <td>${$total_contrib_tax}</td>
        </tr>
        <!--
       {/if}
       {if $show_which_contribs == 1 OR $show_which_contribs == 3}
-->
        <tr>
            <td> </td>
            <td> </td>
            <td> </td>
            <td>Total Non tax deductible</td>
            <td>${$total_contrib_non_tax}</td>
        </tr>
        <!--
       {/if}
      {/if}
 -->
    </tbody>
</table>

<p><span style="font-size:110%;">Total Non-Tax Deductible: ${$total_contrib_non_tax}                  Total Tax-Deductible: ${$total_contrib_tax}<br />
<span style="font-size:120%;"><b>Total: ${$total_contribs}</b> </span></span></p>

<p><span style="font-size:75%;"><i>No goods or services were provided in return for the Tax Deductible contributions listed.</i></span></p>

```

Hope this helps somebody!
> 1 votes

---
Tags: civicontribute
---


# Question
Title: Can I create a new membership for an existing contact using CiviCRM Drupal Webforms?
I am using CiviCRM's webform module for Drupal and I'd like to be able of setting it up a form that does the following:

1. locate the **existing contact** rather than creating a new one,
2. **add a new membership** record for the contact (no matter if the contact has already one or more memberships).

If I set the form by checking **existing contact** (or by setting a deduplication rule), as soon as the form is submitted, CiviCRM will try to find an existing contact and will do the same thing for the membership.

This means that for contacts with existing memberships, their membership records are updated rather than new membership records being created for those contacts.

* Am I maybe missing an **existing membership** checkbox somewhere?
* Is there a way, without coding, so I can create a new membership for an existing contact using CiviCRM Drupal Webforms?

# Answer
CiviCRM was built on the logic that a contact would only have one Membership. There are work arounds for this, such as having the Membership Types associated with a different Organisation. This makes it easier to have someone hold several memberships at the same time.
> 1 votes

---
Tags: webform-civicrm
---


title: PDF file extension format

text:
# Question
Title: PDF file extension format
Since upgrading CiviCRM to 5.46.3 When trying Print/merge document it does not download as a .pdf extension. The file can be opened on MacOS or Linux machines but doesn't open on Windows.

# Answer
> 2 votes
It is the CiviCRM core issue and has been resolved in a recent version.

Either you can upgrade CiviCRM to 5.49.1 or apply the below patches to fix the issue.

---
Tags: pdf
---


# Question
Title: In Contact reports, why are the contacts' names not linked to their records?
Using CiviCRM 5.48.2 with WordPress (current version).

The other day I noticed that in my contact reports (e.g. Current Member List), the names are not linked to the person's record. The links are there in contribution reports, but not contact reports. This is the case both on the dashboard and in the reports area.

I have looked all over to see if this is some setting, but can't find anything.

Any suggestions welcomed. Thanks.

# Answer
> 1 votes
For some reports, the link is displayed if the contact id is included as a column for the report and in some, it is pointed to a report. Maybe try including contact id as a column!!

---
Tags: contacts, civireport
---


# Question
Title: Will unsupervised dedupe rules be used in API Contact create?
I want to import an old database using API Contact create. In the de-dupe rule documentation it mentions "They are also used when you Import contacts". I see in the API documentation that there exists a parameter 'dupe\_check'. When set what will it do exactly? Will it use the rules? How will it respond when dupes are found?

# Answer
> 2 votes
The `dupe_check` works almost exactly the opposite from what you'd expect :)

If you set `dupe_check` to `TRUE` in a `Contact.create` API call, then an unsupervised dedupe check will be performed. If there IS a duplicate, then the contact won't be updated, the API call will return an error with a list of contact IDs that are matched.

---
Tags: drupal, api, developer
---


# Question
Title: With webform_civicrm, how to add contact2's lineitem info into Registration Confirmation and Receipt template
I have set up a civievent with a webform\_civicrm booking form, where the employer is contact1 and the individual delegate is contact 2.

The main event uses the event participation field, and additional options are set up with lineitem fields.

is there a way to add contact2's participation and lineitem info into the Registration Confirmation and Receipt template?

(Site uses pp to date D7 and Civi)

# Answer
> 1 votes
I tend to send two receipts out for this -\>

1. one confirmation email triggered from webform: you have all webform submitted values available as tokens to compose an very email with perhaps including maps/directions, speaker bio, anything really.
2. one (boring) transaction receipt email triggered from civicrm: it only serves as a payment confirmation receipt.

---
Tags: civievent, webform-civicrm, drupal-7
---


# Question
Title: Smarty arrays in message template for Thank You letters
I have Smarty enabled in settings file (on WordPress), and I am able to successfully use Smarty in Thank You letter template as long as I am using regular variables (non-arrays).

As soon as I try to create an array, I am unable to get it to work. Here are some things I have tried...

These simply display 1

```
<!--
{assign var="test" value=[111,222,333]}
-->
<p>{$test[2]}</p>

<!--
{assign var="test" value=[111,222,333]}
-->
<p>{$test.2}</p>

```

These create an error:

```
<!--
{assign var="test" value=['y'=>'yellow','b'=>'blue']}
-->
<p>{$test[y]}</p>

<!--
{assign var="test" value=['y'=>'yellow','b'=>'blue']}
-->
<p>{$test.y}</p>

```

EDIT: Just to add some more details on what I am doing... I am going to Find Contributions and then selecting All Records and then choosing Thank You Letters from the Actions drop down. I can successfully print a letter with ALL their contributions listed (each one individually), and I can successfully print a letter with a summary only Tax Deductible and/or Non Tax Deductible contributions. What I want to do is calculate a total for each Financial Type... I need to create an array in smarty in order add the total for each Financial Type seperately so I can then print a letter with a summary by Financial Type only. I am basing my solution on Iowa Boy answer from this thread: How to print USA tax receipt to individuals?

But regardless of my use case, I can not seem to get arrays in Smarty to work properly.

EDIT: So apparently Smarty v2 (currently the version used by CiviCRM) does NOT let you create or work with arrays.

# Answer
> 0 votes
CiviCRM v5.48.1 is using Smarty v2.6, and based on Demerit response above, it appears that Smarty v2 does not support arrays.

I am not sure if Smarty v2 (in any form) never supported arrays, or if it is just the implementation in CiviCRM that does not support arrays.

# Answer
> 0 votes
If you don't care about line-items and are just using the financial type at the contribution level, you should be able to use grouping by financial type as described here, using table cell: https://docs.civicrm.org/user/en/latest/contributions/manual-receipts-and-thank-yous/#grouped-contribution-thank-you-letters

Otherwise I don't think you can do arrays in smarty and the functions that might allow working around it will give a security error. But you could make a custom token in php.

---
Tags: wordpress, civimail, message-templates, smarty
---


# Question
Title: PHP Fatal Error trying to create contribution with duplicate Transaction ID causes script to crash (using api4 on WordPress)
If I use the API Explorer V4, and I try to create a new contribution with a Transaction ID that already exists, then the response I get back is as follows:

```
status: 500, statusText: Internal Server Error, xhrStatus: complete
{
  "error_code": 0,
  "error_message": "Duplicate error - existing contribution record(s) have a matching Transaction ID or Invoice ID. Contribution record ID(s) are: 100"
}

```

But when running an external script (CiviCRM v5.48.1 with WordPress v5.9.3), if I try to add a contribution and the Transaction ID already exists, it causes script to crash and returns the following php fatal error in the log:

```
PHP Fatal error:  Uncaught CRM_Core_Exception: [0: Duplicate error - existing contribution record(s) have a matching Transaction ID or Invoice ID. Contribution record ID(s) are: 99
  thrown in /home/me/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contribute/BAO/Contribution.php on line 103

```

My expectation was that I should still get a response/result from my call that contains the error message without crashing the script.

This is my test code to reproduce the error:

```
<?php

require_once '/home/me/public_html/wp-content/plugins/civicrm/civicrm/civicrm.config.php';
require_once '/home/me/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Config.php';
$civi_config = CRM_Core_Config::singleton();

for ($i=1; $i<=3; $i++) {

    $transaction_id = "xyz123"; // needs to be unique but use same id to test for this bug
    $total_amount = 2*$i;
    $source = 'Test '.$i;
    $contribution_results = civicrm_api4('Contribution', 'create', [
      'checkPermissions'=>FALSE,
      'values' => [
        'contact_id' => '262',
        'financial_type_id' => '1',
        'payment_instrument_id' => '1',
        'total_amount' => $total_amount,
        'trxn_id' => $transaction_id,
        'currency' => 'USD',
        'source' => $source,
      ],
    ]);

    echo "<pre>";
    print_r($contribution_results);
    echo "</pre>";
}

?>

```

# Answer
> 1 votes
It's throwing an exception so if you don't want that to kill your script you need to enclose the api call in a `try {} catch {}`block. See php documentation on exceptions Eg:

```
try {
  $contribution_results = civicrm_api4( ...... );
}
catch (Exception $e) {
  print "Error: " . $e->getMessage();
}

```

---
Tags: wordpress, civicontribute, api
---


# Question
Title: Deprecated function getUrlPath on WordPress when creating external functions from outside of CiviCRM
I am running CiviCRM v5.48.1 with WordPress v5.9.3 and I am writing some functions outside of CiviCRM environment on Wordpress, using this:

```
<?php

require_once '/home/me/public_html/wp-content/plugins/civicrm/civicrm/civicrm.config.php';
require_once '/home/me/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Config.php';
$civi_config = CRM_Core_Config::singleton();

?>

```

This call creates the following deprecated function error in the php log:

```
PHP Deprecated:  Deprecated function CRM_Utils_System::getUrlPath, use CRM_Utils_System::currentPath. in /home/me/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php on line 1043

```

# Answer
> 0 votes
Depends what you're doing but try `cv`.

Don't add any `require`'s or `CRM_Core_Config::singleton()` stuff. Just write your script and call it with `cv scr path_to_your_script`. `cv` takes care of setting up the Civi environment before running your script.

---
Tags: wordpress, core
---


title: Edit Custom Field Type

text:
# Question
Title: Edit Custom Field Type
I need to edit a Custom Field Type (which is greyed out) from Numeric to something that allows me to enter 8 numeric digits only. Currently, it adds a comma. I guess I need integer or something. Thanks!

# Answer
> 2 votes
It's greyed out because changing the type could create lots of issues. Instead, create a new field of the right type and copy existing data to it.

If you use Alphanumeric you can set the Database Field Length to 8. That will limit it to 8 characters. If you want to enforce the digits only restriction then try hook\_civicrm\_validateForm \- see the example on that page.

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


title: Use search kit like a pivot table?

text:
# Question
Title: Use search kit like a pivot table?
Ive used search kit and created a list of service user demographics, there are 7 columns, age, gender, ethnicity etc.

I then download the csv, copy and paste to excel and then have to create pivot for the different headings.

Is there any way that this can be done in search kit at all?

# Answer
> 2 votes
You could script it as an excel macro but yes in 5.50 there will be something similar called Segmentation in search kit.

---
Tags: searchkit
---


title: API3 Error Custom Fields

text:
# Question
Title: API3 Error Custom Fields
Deleted Custom Field set called Area and added a new custom field set called Regions and I get the below. I cannot access any Contacts now.

```
CiviCRM_API3_Exception: "'group_areas' is not a valid option for field custom_group_id"

CiviCRM_API3_Exception: "'group_areas' is not a valid option for field custom_group_id"

#0 /home/xxxxxxx/public_html/wp-content/uploads/civicrm/ext/org.civicoop.areas/CRM/Areas/Config.php(17): civicrm_api3("CustomField", "getsingle", (Array:3))
#1 /home/xxxxxxx/public_html/wp-content/uploads/civicrm/ext/org.civicoop.areas/CRM/Areas/Config.php(28): CRM_Areas_Config->__construct()
#2 /home/xxxxxxx/public_html/wp-content/uploads/civicrm/ext/org.civicoop.areas/areas.php(75): CRM_Areas_Config::singleton()
#3 /home/xxxxxxx/public_html/wp-content/plugins/civicrm/civicrm/CRM/Utils/Hook.php(283): areas_civicrm_fieldOptions("Contact", "custom_35", (Array:0), (Array:1))
#4 /home/xxxxxxx/public_html/wp-content/plugins/civicrm/civicrm/CRM/Utils/Hook/WordPress.php(136): CRM_Utils_Hook->runHooks((Array:29), "civicrm_fieldOptions", 4, "Contact", "custom_35", (Array:0), (Array:1), NULL, NULL)
#5 /home/xxxxxxx/public_html/wp-content/plugins/civicrm/civicrm/Civi/Core/CiviEventDispatcher.php(249): CRM_Utils_Hook_WordPress->invokeViaUF(4, "Contact", "custom_35", (Array:0), (Array:1), NULL, NULL, "civicrm_fieldOptions")
#6 /home/xxxxxxx/public_html/wp-content/plugins/civicrm/civicrm/vendor/symfony/event-dispatcher/EventDispatcher.php(214): Civi\Core\CiviEventDispatcher::delegateToUF(Object(Civi\Core\Event\GenericHookEvent), "hook_civicrm_fieldOptions", Object(Civi\Core\CiviEventDispatcher))
#7 /home/xxxxxxx/public_html/wp-content/plugins/civicrm/civicrm/vendor/symfony/event-dispatcher/EventDispatcher.php(44): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch((Array:1), "hook_civicrm_fieldOptions", Object(Civi\Core\Event\GenericHookEvent))
#8 /home/xxxxxxx/public_html/wp-content/plugins/civicrm/civicrm/Civi/Core/CiviEventDispatcher.php(198): Symfony\Component\EventDispatcher\EventDispatcher->dispatch("hook_civicrm_fieldOptions", Object(Civi\Core\Event\GenericHookEvent))
#9 /home/xxxxxxx/public_html/wp-content/plugins/civicrm/civicrm/CRM/Utils/Hook.php(167): Civi\Core\CiviEventDispatcher->dispatch("hook_civicrm_fieldOptions", Object(Civi\Core\Event\GenericHookEvent))
#10 /home/xxxxxxx/public_html/wp-content/plugins/civicrm/civicrm/CRM/Utils/Hook.php(1002): CRM_Utils_Hook->invoke((Array:4), "Contact", "custom_35", (Array:0), (Array:1), NULL, NULL, "civicrm_fieldOptions")
#11 /home/xxxxxxx/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/CustomField.php(320): CRM_Utils_Hook::fieldOptions("Contact", "custom_35", (Array:0), (Array:1))
#12 /home/xxxxxxx/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/CustomField.php(1109): CRM_Core_BAO_CustomField->getOptions()
#13 /home/xxxxxxx/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/CustomGroup.php(1930): CRM_Core_BAO_CustomField::displayValue("4", Object(CRM_Core_BAO_CustomField), 1805)
#14 /home/xxxxxxx/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contact/Page/View/Summary.php(56): CRM_Core_BAO_CustomGroup::buildCustomDataView(Object(CRM_Contact_Page_View_Summary), (Array:4), FALSE, NULL, NULL, NULL, 1805, 1)
#15 /home/xxxxxxx/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contact/Page/View/Summary.php(77): CRM_Contact_Page_View_Summary->preProcess()
#16 /home/xxxxxxx/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(319): CRM_Contact_Page_View_Summary->run((Array:3), NULL)
#17 /home/xxxxxxx/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(69): CRM_Core_Invoke::runItem((Array:14))
#18 /home/xxxxxxx/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(36): CRM_Core_Invoke::_invoke((Array:3))
#19 /home/xxxxxxx/public_html/wp-content/plugins/civicrm/civicrm.php(1199): CRM_Core_Invoke::invoke((Array:3))
#20 /home/xxxxxxx/public_html/wp-includes/class-wp-hook.php(307): CiviCRM_For_WordPress->invoke("")
#21 /home/xxxxxxx/public_html/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters("", (Array:1))
#22 /home/xxxxxxx/public_html/wp-includes/plugin.php(474): WP_Hook->do_action((Array:1))
#23 /home/xxxxxxx/public_html/wp-admin/admin.php(259): do_action("toplevel_page_CiviCRM")
#24 {main}

```

NOTE: I disabled the Areas extension and it appears to have fixed things. I am leaving this open as I would like to find out what I am doing wrong or if it might be a code issue.

# Answer
There's an argument that the extension could mark the custom group reserved or prevent someone deleting it if it's required for the extension to function. If you uninstall and re-install the extension I expect now it would recreate the fields.
> 2 votes

---
Tags: wordpress, custom-fields, api, groups
---


# Question
Title: How can I link a related contact in Contact Layout Editor?
I'm displaying a contact on the Contact Layout Editor based on a custom relationship, which is working fine. I've figured out how to display it as plain text, or as an editable text field (which updates the organization name on the related contact if edited).

Is there a way I can display it as a link to the related contact record?

# Answer
> 2 votes
Depending on how you're determining what relationship to display this might be an alternative - the contacts display as links: https://github.com/eileenmcnaughton/org.wikimedia.relationshipblock. And it's compatible with contact layout editor.

---
Tags: contact-layout-editor
---


# Question
Title: Need Membership Chair to access CiviCRM Memberships, Treasurer to access Contributions. On Drupal
In Drupal we have various roles set up for the Membership Chairperson, the Treasurer, and other committees.

We are trying to give access to these same functions through CiviCRM, not Drupal. Our Drupal developer is gone but the roles are already built and assigned.

So, using CiviCRM, we'd like *only* the membership chair to have access to all CiviCRM Memberships AND Mailings AND Events and *only* the treasurer to have access to Contributions AND Mailings AND Events.

So the roles are done in Drupal. How do we implement the same in CiviCRM so new committee chairs can go through the Civi interface instead of Drupal's? I'm getting confused understanding ACLs.

Using CiviCRM 5.44.0 on Drupal 8/9.

# Answer
> 2 votes
Drupal permissions/roles are what control what someone sees/does in the backend of civicrm. so you may just need to run your eye down the many, many rows of CiviCRM Permissions for those Roles.

---
Tags: civicontribute, civimail, drupal, civimember, acl
---


# Question
Title: Why are all my live Stripe payment attempts failing?
CiviCRM 5.49.1 with Drupal 7. I have three contribution pages (a donation, a membership and an event registration). All three use the Stripe payment processor (latest version = 6.7.3), and have been working well. However we've seen lots of payments not being successful in recent weeks so I'm trying to understand what's going wrong. Test drive payments on all three pages work fine. Live payments all fail. Can't see any obvious clues in the CiviCRM log file. All that's there is lots of entries like this:

```
May 19 09:02:29  [error] Stripe.process_stripe: Unable to cancel paymentIntent. The resource ID cannot be null or whitespace.

```

Looking at https://lab.civicrm.org/extensions/stripe/-/issues/365 which relates to this error message it doesn't appear to be critical, but I'll delete the rows that down't have street\_intent\_id - looks like there are just a couple.

Any clues as to how to get my live payments working again greatly appreciated.

# Answer
> 2 votes
Finally got the bottom of this, once I was granted access to the Stripe account. The account was configured to use a 2016 version of the Stripe API. Updating that to the version recommended by the Stripe extension, and everything started working.I guess my test transactions were working because I wasn't using test card numbers that triggered the 3DSecure validation.

what I'm sort of surprised by is why Stripe itself was allowing an account to use a 2016 version of the API, which presumably was built before 3DSecure was even a thing. And when my client raised a query with Stripe as to why the transaction were all failing, they didn't flag up the API version as a possible candidate.

---
Tags: civicontribute, stripe
---


title: Show CiviCRM events in fullcalendar

text:
# Question
Title: Show CiviCRM events in fullcalendar
We currently show our events, from "Google Calendar", in our Wordpress website calendar, using Fullcalendar (fullcalendar.io). But we would like to show instead our CiviCRM events in this calendar (and not using 'Google Calendar' any longer). How to do that? Thanks.

# Answer
> 1 votes
Welcome to CiviCRM SE. Have you tried CiviCRM Event Calendar or CiviCalendar.

---
Tags: calendar
---


title: Can't edit mosaico templates any more

text:
# Question
Title: Can't edit mosaico templates any more
Recently we migrated our site from Drupal to Wordpress, everything seems to be working fine however we can't edit mosaico templates we had created while we were on Drupal. Have bunch of JS errors on browser console, seems its trying to load template from oldsite.

Checked the Resource URL, Directories settings everything seems to be correct. Also cleared CiviCRM cache and delete template\_c with no success.

Any pointers would be appricated

Thank you

# Answer
Mosaico extension stores path in civicrm\_mosaico\_template and civicrm\_mosaico\_msg\_template table. When mosaico extension code is moved you will need to update path in these tables to new path.

You can run below query to update the path from `sites/default/files/civicrm/ext/` to `wp-content/civicrm_extensions/`

```
UPDATE civicrm_mosaico_template
SET metadata = REPLACE(metadata, 'sites/default/files/civicrm/ext/', 'wp-content/civicrm_extensions/‘);

UPDATE civicrm_mosaico_msg_template
SET metadata = REPLACE(metadata, 'sites/default/files/civicrm/ext/', 'wp-content/civicrm_extensions/‘);

```

HTH

Pradeep
> 3 votes

# Answer
If you want to also edit any draft emails that use Mosaico, you also need to run this query:

```
UPDATE civicrm_mailing SET template_options = REPLACE(template_options, 'https:\\/\\/proddomain.ext\\/media\\/civicrm\\/ext\\', 'https:\\/\\/devdomain.ext\\/media\\/civicrm\\/ext\\') WHERE template_type = 'mosaico';

```

In my example, note that I have a absolute path in my templates (not sure if this is always the case).
> 3 votes

# Answer
There is now an API to simplify this process and make it accessible to folks who aren't comfortable modifying the database directly.

`MosaicoTemplate.replaceurls` is the API. Full documentation is available, but if you aren't comfortable with the command line:

* Go to **Support menu » Developer » API Explorer v3** (see screenshot below).
* For *Entity* choose **MosaicoTemplate**. For *Action* choose **replaceurls**.
* Set *Base URL of the server where the templates were generated* to the old URL you want to change.
* Click **Add Parameter** to add a second line. Set it to **Base URL of the current server** equals the new URL.
* Press the **Execute** button at the bottom of the page.
> 2 votes

---
Tags: mosaico
---


# Question
Title: Getting fatal error when doing things with extension
Whenever Im doing anything with extensions Im getting this error

```
CiviCRM_API3_Exception: "API error: on OptionValue.getsingle"

#0 /home/lgsecrmo/hub.littlegate.org.uk/sites/all/modules/civicrm/CRM/Admin/Form/Extensions.php(189): civicrm_api3("Extension", "enable", (Array:2))
#1 /home/lgsecrmo/hub.littlegate.org.uk/sites/all/modules/civicrm/CRM/Core/Form.php(527): CRM_Admin_Form_Extensions->postProcess()
#2 /home/lgsecrmo/hub.littlegate.org.uk/sites/all/modules/civicrm/CRM/Core/StateMachine.php(144): CRM_Core_Form->mainProcess()
#3 /home/lgsecrmo/hub.littlegate.org.uk/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Next.php(43): CRM_Core_StateMachine->perform(Object(CRM_Admin_Form_Extensions), "next", "Next")
#4 /home/lgsecrmo/hub.littlegate.org.uk/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Next->perform(Object(CRM_Admin_Form_Extensions), "next")
#5 /home/lgsecrmo/hub.littlegate.org.uk/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Admin_Form_Extensions), "next")
#6 /home/lgsecrmo/hub.littlegate.org.uk/sites/all/modules/civicrm/CRM/Core/Controller.php(352): HTML_QuickForm_Page->handle("next")
#7 /home/lgsecrmo/hub.littlegate.org.uk/sites/all/modules/civicrm/CRM/Core/Page/Basic.php(395): CRM_Core_Controller->run()
#8 /home/lgsecrmo/hub.littlegate.org.uk/sites/all/modules/civicrm/CRM/Core/Page/Basic.php(140): CRM_Core_Page_Basic->edit(32, NULL)
#9 /home/lgsecrmo/hub.littlegate.org.uk/sites/all/modules/civicrm/CRM/Admin/Page/Extensions.php(105): CRM_Core_Page_Basic->run()
#10 /home/lgsecrmo/hub.littlegate.org.uk/sites/all/modules/civicrm/CRM/Core/Invoke.php(313): CRM_Admin_Page_Extensions->run((Array:3), NULL)
#11 /home/lgsecrmo/hub.littlegate.org.uk/sites/all/modules/civicrm/CRM/Core/Invoke.php(69): CRM_Core_Invoke::runItem((Array:15))
#12 /home/lgsecrmo/hub.littlegate.org.uk/sites/all/modules/civicrm/CRM/Core/Invoke.php(36): CRM_Core_Invoke::_invoke((Array:3))
#13 /home/lgsecrmo/hub.littlegate.org.uk/sites/all/modules/civicrm/drupal/civicrm.module(458): CRM_Core_Invoke::invoke((Array:3))
#14 /home/lgsecrmo/hub.littlegate.org.uk/includes/menu.inc(527): civicrm_invoke("admin", "extensions")
#15 /home/lgsecrmo/hub.littlegate.org.uk/index.php(21): menu_execute_active_handler()
#16 {main}

```

I'm using latest Drupal and CiviCRM 5.41

Can anyone throw some light on this?

# Answer
For these type of errors that don't make lots of sense, i would check the following.

-Memory exhaustion (increase it via php.ini and restart your webserver then try).

-Also, you can try the CV commandline utility and run it with verbose to see more errors (cv -vv ext:enable extention-name)
> 0 votes

---
Tags: api, extension, error
---


title: new install on wordpress 6 fails

text:
# Question
Title: new install on wordpress 6 fails
Have tried 5.49.2 and 5.46. If I manually upload and extract doesn't appear in plugins list. If I upload zip file via wp plugin upload then extraction fails with message "Unpacking the package… Could not copy file. civicrm/civicrm/bower\_components/monaco-editor/min/vs/language/typescript/tsWorker.js"

not sure how to troubleshoot this...

# Answer
I was able to install 6.0 and upload the zip - but I have my server set to all 64 MB uploads.

The zip file is about 38 MB. I'd suspect that something went wrong trying the admin uploader. Can you add directly via your hosting account? The error sounds like the zip file was somehow corrupted on upload.
> 0 votes

---
Tags: wordpress, installation
---


# Question
Title: Why can't you make the selection of at least one tag required in a profile?
It is possible via the profile user interface to mark the tags field as required.

But, when the profile is displayed in user-create mode, the little red asterisk is absent and you can in fact add a record without entering a tag.

I've traced the problem to this function call, which allows you to make the group field required (provided it's displayed as check boxes). But there doesn't appear to be any code that would apply to tags.

This doesn't look like a programming error. So, I'm not sure if it simply was left out or if there is any underlying reason why you would not be able to do this?

# Answer
> 0 votes
Thanks Peter for the feedback, I'm coming to the conclusion that the inability to require a tag is simply an overlooked feature. I will try to put together a PR in the coming days to address it.

---
Tags: profile, tags
---


# Question
Title: How to save details in the New Individual Form, if the contact is Self Employed or is a Student
I was entering Contact Data and after Name details the next thing i noticed the Current Employer Field but I had Contacts who were

1. Self Employed/Freelancers
2. Students

How do I Save their data?

# Answer
> 1 votes
To create an individual contact the basic details you need are First Name and Last Name, or Email Address.

You should be able to leave the employer field blank and still create a contact.

---
Tags: individual, data
---


# Question
Title: How can I call api directly from external http?
According to https://docs.civicrm.org/dev/en/latest/api/v3/rest :

> "As of v5.47+, there should be no reason to use extern/rest.php - other end-points should be more compatible and more featureful. See APIv3 Changelog for migration notes."

but a simple http request like:

> https://agloa.org/wp-admin/admin.php?page=CiviCRM&q=civicrm/ajax/rest&entity=Contact&action=get&json=1&key=site\_key&api\_key=my\_key

results in

> Ajax requests can only be issued by JavaScript clients, eg. CRM.api3

Does this mean I need to create a JavaScript client as a front-end to my http call?

# Answer
> 2 votes
This URL lets me get contacts from my site externally (without logging in) and without creating a JavaScript client: https://agloa.org/wp-json/civicrm/v3/rest?entity=Contact&action=get&json=1&key=\<site\_key\>&apiKey=\<my\_key\>

---
Tags: api, ajax
---


title: Civix not working Joomla! 3.9.3

text:
# Question
Title: Civix not working Joomla! 3.9.3
Civix doesn't seem to work with Joomla! 3.9.3. According to this, Joomla! 3.9.3 doesn't allow loading of phar packed files. When I try to run civix, I get the following exception error in a red panel:

\[TYPO3\PharStreamWrapper\Exception\]
Unexpected file extension in "phar:///usr/local/bin/civix/bin/api/class.api.php"

I reverted to Joomla! 3.9.2 and civix works again.

# Answer
> 1 votes
1. A bug report was filed in https://github.com/totten/civix/issues/147
2. The issue specifically affects the normal PHAR build. Running from git works, eg

```
git clone https://github.com/totten/civix
cd civix
composer install
export PATH="$PWD/bin:$PATH"

```

# Answer
> 2 votes
OK, it looks like it's a problem with Joomla 3.9.3. See discussion here. Fix should be included in Joomla 3.9.4, which is out on 12th March.

---
Tags: joomla, civix
---


# Question
Title: Can I get ALL contact's emails in CiviCRM reports?
By default, CiviCRM Reports include only contact's **Primary email**.

How can I create a report which includes **all contact's emails**?

**Alternatively**, is there a way I can export ALL users with ALL emails? (There is with Search Kit, but an option with Reports would be much better for automatic processing.)

# Answer
It's simple with Search Kit: see here

You say: "There is with Search Kit, but an option with Reports would be much better for automatic processing" - what 'automatic processing' are you referring to? Search Kit surpasses Reports in many ways and will eventually replace them so far as I know so it's useful to understand what people are doing with reports that can't be done, or is harder, with Search Kit.
> 3 votes

# Answer
You could use SQL Tasks to generate the report you're looking for, which can automatically deliver a CSV to you via email. Depending on the format you're looking for, you'll want something like:

```
SELECT display_name, email
FROM civicrm_contact cc
JOIN civicrm_email ce ON cc.id = ce.contact_id;

```

OR

```
SELECT display_name, GROUP_CONCAT(email)
FROM civicrm_contact cc
JOIN civicrm_email ce ON cc.id = ce.contact_id
GROUP BY display_name;

```
> 0 votes

---
Tags: civireport, searchkit
---


title: Bounces not reaching bounce account

text:
# Question
Title: Bounces not reaching bounce account
CiviCRM 5.19.2 WP 5.3

Testing my bounce settings, and I'm not sure whether I actually have a problem or not. I've set up both 'bounce' and 'activity processing' accounts, and their respective scheduled jobs run without error (and CiviCRM has created the corresponding folders in both accounts).

Using the default 'from' address (info@mydomain), I've been sending a newsletter out to a small dummy group containing faulty addresses (one, for example, is an old work address of mine that's disabled). While I get an immediate message from the google mailer-daemon ("550 5.2.1 The email account that you tried to reach is disabled"), sent to info@mydomain. Shouldn't that go to bounce@mydomain, the account I've set up for bounce processing? Or am I misunderstanding something basic?

I can also confirm that I can send email to bounce+ (and receive it there), but the when I'm sending with CiviMail I only receive the bounce message in the reply-to (which is the sending) address. See the image below.

# Answer
> 0 votes
You may want to ensure that the mailbox you are using supports tagging. Send a me+123@domain.com email and see if it arrives.

Microsoft outlook365 servers generally do not. Gandi can be good, but there are also many other providers that do support tagging (the +123 bit).

Google isn't so good, as there can be issues with SPF records which can lead to your mails being marked as Spam and may lead to blacklisting etc.

in general, mail-tester.com is a good site to use to test integrity of email (and the likelyhood of them failing / being marked as 'junk'. If you send a mail from civi to the "address" provided by mail-tester it will flag a problematic reply address (in the sense of spf failing etc). It will also let you know if there are any other infrastructure issues to look into.

# Answer
> 2 votes
The key to getting bounces sent to the right account is the Email Domain of the Mail Account that you've configured for Bounce Processing. The emails that are sent out use that domain for the "envelope" from address (which is not the one you see as sender or recipient, but the one that's hidden in the smtp conversation between machines).

As more detailed explanation is here: https://docs.civicrm.org/sysadmin/en/latest/setup/civimail/inbound/

In summary:

The "envelope" From address for a civi message is built uniquely per message and recipient as "uniqueid-per-recipient-per-message@bouncedomain.org". When it bounces, the bounce processing will process it based on that from address to determine what to do with it.

So your bounce domain is usually NOT your from address domain, it's a special domain that can handle bounces. You normally would not want to do this yourself, though it's been done and there are instructions to do it using specially setup gmail addresses using some more involved addressing magic.

# Answer
> 0 votes
One possible cause for this is that the mail server software you're using assumes mail to your domain is for you.

In my example, using Postfix, I had the following line in `/etc/postfix/main.cf`:

```
mydestination = $myhostname, mysite.org, server1.mysite.org, localhost.mysite.org, localhost

```

That means that any mail sent through this server to an address ending in `@mysite.org` will be processed by this server. However, this is NOT the mail server for mysite.org! Removing `mysite.org` from `mydestination` fixed the problem.

The line that tipped me off was in `/var/log/mail.log` which read:

```
May 26 18:33:23 server1 postfix/local[120265]: 01CD0405FB: to=<bounces+b.46.5065.a6d20287ac364100@mysite.org>, relay=local, delay=0.02, delays=0/0.01/0/0.01, dsn=5.1.1, status=bounced (unknown user: "bounces")

```

The `unknown user: "bounces"` showed that Postfix was trying to deliver this email locally.

---
Tags: civimail, bounce
---


# Question
Title: Hybrid event with cap for the in-person space: setup suggestions?
We are setting up a "hybrid" event that has in-person cap at 20 participants due to the room size (with a waitlist), plus an unlimited (ideally no waitlist) Zoom option. We typically use scheduled reminders (to remind participants of the time, location and encourage them to cancel if they won't make it) one week and 3 days before events.

The only way I can think to do this is with two separate events with their own registration links, like "try this first and if it's full then click this link to register for the zoom", + sending the zoom link to those on waitlist status for the in-person...

Is there a better way to set this up than as two separate events? Thanks!

# Answer
> 1 votes
If you use a Price Set for your event, then you can put a cap on one option

Does that give what you need?

---
Tags: civievent, scheduled-reminders
---


title: Show all contributions from top donors

text:
# Question
Title: Show all contributions from top donors
I am trying to report on our top donors by year. I can see where to pull the top donor report, but that only aggregates the contributions per donor. That is part of what I need, but I am missing how to also show the individual donations made by each of the top donors. If I put the Top Donors for a given year into a group, then run Find Contributions on that group, that gives me the data I need on the individual donations, but I can't figure out how to sort it to match the "Top Donor" order. Manually rearranging the rows in Excel seems a... not great workaround. Would be so grateful for any guidance.

# Answer
> 3 votes
In Search Kit, try this

Create the search as:

Note the 'Group By' contact ID, and 'total amount' field added twice - once as 'sum', once as 'list'.

You might want additional 'where' clauses for 'status = completed', 'type = donation' etc.

Then add a table and sort by '(Sum) Contact Contributions: Total Amount' Descending. You might want to untick 'Use Pager' and then set Limit Results to eg 10.

Result:

---
Tags: contributions, reports, searchkit, donations
---


title: Is Authx really alpha?

text:
# Question
Title: Is Authx really alpha?
On the status page I get "To generate authenticated email links for custom forms, enable extended authentication services (AuthX) in Manage Extensions." Ok, but the AuthX description says that it is Alpha stage and "This is a new, undeveloped module." All the links just say http://FIXME. So what's the deal? I'm not excited about adding untested code to my site.

# Answer
Update: It's now marked as stable :)

https://github.com/civicrm/civicrm-core/pull/23601
> 2 votes

# Answer
There's a larger topic about who in the civi universe is responsible for testing and QA, but the short answer is yes it's alpha right now, but the reason you're seeing that message on the status page is because the "form core" extension is installed.
> 0 votes

---
Tags: core, formbuilder
---


# Question
Title: Issues with installing CiviCRM onto a Drupal 9 instance
I am currently having issues trying to install CiviCRM onto a Drupal 9.3.14 instance for a NPO website which is currently utilising the LocalGov Drupal Install Profile (https://www.drupal.org/project/localgov).

We are currently using a managed hosting service and have no SSH access to be able to install via composer. (I have emailed them and they will not provide us with access). I have tried to install via the "Add a module" method however it doesn't recognise the CiviCRM Drupal file and keeps showing an error "does not contain any .info.yml files.".

Is it possible to install CiviCRM without SSH access?

Setup Drupal Version: 9.3.14
Web Server: nginx1.14.2
PHP Version: 8.1.6 (Memory limit 256M)
Database Version: 10.6.7-MariaDB

Many thanks

# Answer
> 1 votes
You can try:

* back up the site and files
* copy the files to a local drive on your computer
* do the commands to download the civi files
* use the hosting provider's control panel to replace the files on the server
* now install the module in the UI

---
Tags: installation, drupal-9
---


# Question
Title: Allow deletion of contacts but not in trash?
I have the impression that many CiviCRM users share this scenario: They would like to allow everyday users to delete contacts and they are happy about the fact, that in case of mistakes these can be restored from the trash bin (permission *CiviCRM: delete contacts*). However they also want to grant many of them access to the trash bin to undo deletions, solve deduplication issues etc. (permission CiviCRM: *access deleted contacts*). Now there's one third thing they'd want but **cannot** do: Limit the permission to (permanently) delete contacts in trash to a smaller group of users.

Does anyone know a way to solve this scenario? Probably best would be to create one more permission *delete in trash*?

# Answer
**After having played with the system a bit more in response to Andreas' and Andy's comments. This answer is wrong. Considered deleting it- but keeping in place for the thread underneath**

**The "edit all contacts" permission although the description says it includes permission to delete- does not include permission to delete.**

Just played with our system (civi 5.47 in a D7 site)

If you give a contact the "CiviCRM: edit all contacts View, Edit and Delete ANY CONTACT in the CiviCRM database; Create and edit relationships, tags and other info about the contacts" permission

AND the CiviCRM: access deleted contacts permission

They can delete non-trash contacts, and see them in the trash. But not have permission to delete the from trash.

The Delete Contacts permission allows users to delete permanently from Trash.

The problems this might cause are if you haven't allocated the "edit all contacts" permission to a user in order to allow ACL control over access to contacts.

But if you're not restricting access to contacts via ACL, then the above settings should work fine.
> 1 votes

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


# Question
Title: When CiviMRF is used with Form Processor, how can I view the results of each transaction?
I am using CiviMFR on Drupal 7 as the public facing server and Form Processor on a Drupal 7/CiviCRM installation as the internal server. I see that when I use form processing locally on the CiviCRM installation (Try It), the results are shown on the page.

When a user submits a Webform from the public facing site and the data is sent to the CiviCRM installation, is there a way to view the results of each transaction on the Civi side? I'm interested in being able to know when a transaction has failed.

I appreciate the help. Thanks.

# Answer
> 2 votes
One can view the results of API calls within CiviCRM by using the extension API Rest Log. It contains the time, entity, action and parameters of the call. However, it does not contain the error responses for the call. But..

From the public site, one can view the result of each API call (request and response) by viewing the CiviMRF Call Log (admin/reports/civimrf\_calls). This can be accessed from the Reports menu. This log shows both failed and completed requests.

---
Tags: form-processor
---


# Question
Title: Duplicate Relationship error even though Contact B values are different
I want to create some Relationships of type "Case Coordinator" via API Call in CiviCRM.

When I create two relationships with the same contact\_id\_a, relationship\_type\_id, is\_active and case\_id values, but with a different contact\_id\_b value, I nevertheless get the error "Duplicate Relationship thrown in .../public/sites/all/modules/civicrm/api/api.php on line 134".

I have been checking the code in public/sites/all/modules/civicrm/CRM/Contact/BAO/Relationship.php and it seems to check the sameness of contact\_id\_a and contact\_id\_b correctly:

```
public static function checkDuplicateRelationship(&$params, $id, $contactId = 0, $relationshipId = 0) {
 ...
    $queryString .=
      " AND ( ( contact_id_a = " . CRM_Utils_Type::escape($id, 'Integer') .
      " AND contact_id_b = " . CRM_Utils_Type::escape($contactId, 'Integer') .
      " ) OR ( contact_id_a = " . CRM_Utils_Type::escape($contactId, 'Integer') .
      " AND contact_id_b = " . CRM_Utils_Type::escape($id, 'Integer') . " ) ) ";
...
  }

```

Only when I add a distinct start\_date to the API Create Relationship call, CiviCRM accepts the call and creates the relationship properly.

This is ok as a workaround, but I wonder if anybody knows why the check on Contact A and Contact B in the code is not working here? As obviously two relationships are not a duplicate if they exist between a different pair of contacts.

# Answer
I can't reproduce the fail. Both api3 and api4 seem to work fine using the params as described. Perhaps there is something else involved on that site?

e.g. both these work when there is already an existing relationship of the same type on the case with a different contact:

`cv ev --user=admin "civicrm_api3('Relationship','create', [contact_id_a => 8, contact_id_b => 9, relationship_type_id => 14, is_active =>1 , case_id => 1]);"`

`cv ev --user=admin "\Civi\Api4\Relationship::create()->addValue('contact_id_a', 8)->addValue('contact_id_b', 10)->addValue('relationship_type_id', 14)->addValue('case_id', 1)->execute();"`
> 1 votes

---
Tags: civicase, relationships
---


title: How to remove APIv4 extension

text:
# Question
Title: How to remove APIv4 extension
Sorry if this has been asked before, but I couldn't find it if so. How can I remove the obsolete APIv4 extension cleanly? There's no disable or uninstall uption on the Extensions page. Thanks.

# Answer
I would delete the extension folder from the extension directory.

You may need to run the below query to delete the entry from the extension table or sometimes it should delete automatically when you will hit refresh button on extension page

```
DELETE FROM civicrm_extension WHERE full_name = 'org.civicrm.api4';

```
> 1 votes

---
Tags: extension, apiv4
---


# Question
Title: Chasse plugin: can a user be on multiple journeys at the same time?
We are using the wonderful Chasse plugin to make it more intuitive for our administration team to run e-mail drip campaigns. As our community has grown and gotten more complex, we now have a need to put a user into multiple drip campaigns at the same time. I have tried to make this happen but have not been successful. Does anyone know if this is supported?

Here are the things I have tried:

* Putting the user in the mailing groups for two Chasse journeys.
* Searching for a user who is already on a Chasse journey, then selecting them from a user list and using the drop down option to set a Chasse journey/step for them. This seems to over-write the Chasse journey they were on previously.

If this is not possible with Chasse, does anyone have examples of configuring drip campaigns with CiviRules? I find CiviRules a bit complex and easy to screw up so it would be helpful to see some examples.

Thank you!

# Answer
> 5 votes
According to artfulrobot in the MM thread, Chassé enforces the concept that one contact can only be on one journey at once

---
Tags: email
---


# Question
Title: Cannot access CiviCRM Dashboard - TypeError thrown Argument 2 passed to CRM_Core_Resources
Tried logging in and accessing CiviCRM Dashboard of the organisation I work for this evening (to retreive some event participant contact details) however as soon as I try to log in to CiviCRM or try to access CiviCRM Dashboard I get the following error.

NOTE: I do not have any web developer skills LOL... I am just an employee, but quite urgently need to be able to access these participant details prior to our event!

Have never had this happen before, so please excuse my noobness if this is something that is easily fixed!

Thanks in advance :)

```
Argument 2 passed to CRM_Core_Resources::addVars() must be of the type array, null given, called in /home/touchingbase/public_html/wp-content/uploads/civicrm/ext/org.civicrm.recentmenu/recentmenu.php on line 114'''

```

# Answer
Welcome to SE CiviCRM. The issue you were facing was a known error of recentmenu extension and was fixed and merged 6 hours ago.

You can either apply the patch or replace the recentmenu-1.4 extension with recentmenu-1.5
> 1 votes

---
Tags: error
---


# Question
Title: Proximity search in a set of case results
When I used the advanced search screen, **displaying results as contacts** I can get proximity and case criteria to work together (for instance anyone 50 miles from zip code 12345 with an ongoing facility support case).

But when I change the results to **show the results as cases** it tells me there are no matches found. (Same exact criteria, I just want to see a list of facility support cases in the area).

I can combine other criteria in the address section, just not the "Find contacts within" field. Is this a bug? Is anyone else able to get this to work?

I'm using Civi 5.39.4 and Drupal 7

# Answer
> 1 votes
This should be available in 5.51 with this PR by @coleman: https://github.com/civicrm/civicrm-core/pull/23597. It works for me for the above criteria.

---
Tags: civicase, advanced-search
---


# Question
Title: How can I create a group containing all contacts with more than one email address?
I'd like to create such a group so that I can contact them to identify which of their multiple email addresses they want to have as their primary one.

# Answer
This is an old question but has a new solution using Search Kit:

See here

From the search, you could create a smart group.

The original solution looks for multiple addresses even if they are the same. To get the same results, untick 'distinct'. For the purpose described in the question, it is probably more useful to look at the number of distinct addresses.
> 4 votes

# Answer
Here's a hack that only works if you're not using the "Do not SMS" field for contacts, if you do, find a different one.

1. Use that field as a temporary flag to identify contacts in the group, using sql like this:

UPDATE civicrm\_contact set do\_not\_sms = 1 where id in (SELECT contact\_id FROM civicrm\_email group by contact\_id having count(id) \> 1)
2. Use that field via a search to select all the multi-email contacts.
3. Put 'em in a group.
> 3 votes

---
Tags: civimail, email, searchkit
---


title: Error with charset on MySQL

text:
# Question
Title: Error with charset on MySQL
Trying to modify a label for a relationship I got this error

```
   #1253 - COLLATION 'utf8mb4_bin' is not valid for CHARACTER SET 'utf8'

```

But the structure seems to be correct and not using utf8mb4\_bin. I compared with an other instance, and with the same structure I was able to modify the label

The table itself seems to also be properly defined:

What is wrong?

# Answer
> 3 votes
Your tables have utf8mb4 at the table level but the individual columns are utf8. This is causing a mismatch for the triggers that populate the relationship cache.

My suggestion would be to run the System.utf8conversion api call, either from api explorer or command line. Make a backup first.

---
Tags: mysql
---


title: Search kit display on user dashboard

text:
# Question
Title: Search kit display on user dashboard
Is it possible to add a search kit display on the CiviCRM user dashboard page and also filter the result based on the contact record?

# Answer
> 1 votes
it's possible with Form Builder. It allows you to show your custom search as a block or a tab in the contact summary or as a dashlet on the dashboard. And you can also add filters.

I don't know what you mean with 'filter the result based on the contact record' but SK + FB is a must!

---
Tags: searchkit
---


title: drupal 9 error guzzle

text:
# Question
Title: drupal 9 error guzzle
after installing civicrm 5.49.3 via composer on drupal 9.3.14, I have a problem with GuzzleHTTP. Can you advise me on how to fix this problem.

The website encountered an unexpected error. Please try again later. Error: Undefined class constant 'VERSION' in GuzzleHttp\default\_user\_agent() (line 136 of vendor/guzzlehttp/guzzle/src/functions.php). GuzzleHttp\default\_user\_agent() (Line: 52) Drupal\Core\Http\ClientFactory-\>fromOptions() call\_user\_func\_array(Array, Array) (Line: 258)

# Answer
What it sounds like is your site has a module or something that includes guzzle v7 somewhere, and the one in vendor is v6. So what's happening is that it loads src/functions.php from the v6 one, but loads ClientInterface from the v7 one, and so there is no VERSION property.

So you need to find where guzzle 7 is and decide what to do from there. You can try `find . -name BodySummarizer.php` which is a file in v7 that isn't in v6.
> 1 votes

---
Tags: drupal
---


# Question
Title: Rules/guidelines for email to activity processing?
CiviCRM 5.45.6, Drupal 7. Client is using email to activity processing but is having intermittent failures with it. I've reviewed the Civi docs and while they explain how to set up the functionality, there appear to be no real guidelines re whether to forward versus CC versus BCC, whether there is a limit on the number of contacts who can be included in the activity creation, and so forth. Are there specific guidelines somewhere, or even guidance based on your previous experience with the functionality? Any help/tips appreciated.

# Answer
> 1 votes
If your database is utf8 you can get failures with emojis in emails. I recommend utf8mb4 anyway for other reasons.

There's no known limit on contacts.

If you're using the method where you're cc'ing or forwarding to a dedicated email I usually recommend bcc because otherwise it gets harvested and it eventually ends up on spam lists. Similarly don't advertise it publicly. And name it something unusual that wouldn't get randomly hit, like civicrm\_email\_processor@example.com.

I don't really see a difference between forward and cc/bcc. When initially sending an email, you'd want to include the other recipients because otherwise it will only attach it to your own contact in civi. But if you've already received an email and want to file it, then forwarding to the email processor is the most straightforward way. There is also the other method where you have a separate civi mail account pointed at a folder in your mailbox, and then you can just drag received emails into that folder to file them in civi and autoattach to the other contacts, but then you need to put your personal mail password in civi.

Also note if using Cases then you can put `[case #1234]` in the subject and it will attach it to case 1234. I also recommend https://civicrm.org/extensions/replace-or-remove-case-hash-email-subject if you're using civi this way.

---
Tags: activity, inbound-email
---


title: How do I test CIVICRM_SIGN_KEYS?

text:
# Question
Title: How do I test CIVICRM_SIGN_KEYS?
I want to play with CIVICRM\_SIGN\_KEYS. I'm clear on how to set up a key, but how do I test it?

I guess I don't understand where Afform and Authx get invoked.

Cheers,

# Answer
Here is a tool to generate sign/cred keys, which CiviCRM 5.50 now nags about, when we upgrade:

https://civisettings.symbiotic.coop/

The examples are randomly generated, and can be copy-pasted in the civicrm.settings.php (somewhat copied of idea of the WordPress salt generator).
> 4 votes

---
Tags: crypto
---


title: cleanup caches changes file permissions

text:
# Question
Title: cleanup caches changes file permissions
My site (on a VPS running CPanel, CiviCRM 5.49.3, Drupal 9.3.14) currently has file permission issues. This hasn't always been the case, and I don't know the in initial cause for the problem.

Due to permission issues the caches are inaccessible and the site functionality is very limited.

I have come across advice for a script that set permissions in a way that supports the site functionality.

```
cd /home/user/www-sangha-drupal/web/
chown -R user:nobody .
find . -type d -exec chmod u=rwx,g=rx,o= '{}' \;
find . -type f -exec chmod u=rw,g=r,o= '{}' \;

cd /home/user/www-sangha-drupal/web/sites
find . -type d -name files -exec chmod ug=rwx,o= '{}' \;
for d in ./*/files
do
   find $d -type d -exec chmod ug=rwx,o= '{}' \;
   find $d -type f -exec chmod ug=rw,o= '{}' \;
done

```

the result is in paths such as

```
sites/default/files/civicrm/persist/contribute/dyn
sites/default/files/civicrm/templates_c

```

this produces this kind of permission:

```
-rw-rw---- 1 user nobody  7785 May 28 23:08 crm-l10n.8a45e015fbdc223596bebbac430cb078.js
-rw-rw---- 1 user nobody 10751 May 28 23:08 crm-menubar.d91a640f1e3a566248597efb8795f11b.css

-rw-rw---- 1 user nobody   202 May 28 23:25 .htaccess

```

respectively.

When I cleanup caches, this permission changes to

```
-rw-r--r-- 1 nobody nobody  7785 May 28 23:08 crm-l10n.8a45e015fbdc223596bebbac430cb078.js
-rw-r--r-- 1 nobody nobody 10751 May 28 23:08 crm-menubar.d91a640f1e3a566248597efb8795f11b.css

-rw-r--r-- 1 nobody nobody   202 May 28 23:25 .htaccess

```

Whereupon the the site doesn't work very well at all, as you might guess.

Here: \[https://civicrm.stackexchange.com/questions/4144/civicrm-does-not-have-permission-to-write-temp-files-on-new-server\]\[1\] it is suggested to modify

```
/etc/php-fpm.d/www.conf

```

I have tried updating what might be the right instance of this file (there are several with CPanel, so that makes it less certain), and restarting PHP-FPM server each time.

I have tried

```
listen.acl_users = apache,nginx,user
listen.acl_users = apache,nginx,nobody,user

```

Neither of these have changed the behavior or functioning of the site, as described above.

Please any suggestions for how to resolve this?

Thanks!

# Answer
> 0 votes
This normally happens when you clear cache as user other than the web server user ( like running drush cr as your own user ). I would do the following.

Substitute Apache and YourUser as your Webster and other user in your system (assumes Linux).

1. First correct current permissions

Sudo chown -R Apache:YourUser

Sudo chmod -R ug+rw /path-to-Drupal-root-/web/sites/yourSite/files/civicrm/
2. Now, clear cache as we server user or via weblink and not commandline If you want use commandline , run as Apache :: sudo -u apache drush cr..

# Answer
> 0 votes
Resolved my problem by changing the php apache module from mod\_mpm\_event which uses 'nobody'; to mod\_mpm\_itk which uses 'user'

---
Tags: permissions, cache
---


# Question
Title: CiviCRM 5.50 Fatal Memory Error on the Status page
I recently upgraded to CiviCRM 5.5 on an Apache2 server with PHP 7.4

Now, when I attempt to open the CiviCRM status page I get an HTTP error 500, and this also happens when trying to create a new mailing (either Mosaico or traditional)

I think also that Civi Cron is erroring, as every 5 minutes in Apache2 error.log I see:

```
[Fri Jun 03 19:05:02.797134 2022] [php7:error] [pid 2718] [client 95.172.20.13:54108] PHP Fatal error:  Allowed memory size of 268435456 bytes exhausted (tried to allocate 20480 bytes) in /var/www/XXX/wp-content/plugins/civicrm/civicrm/Civi/Token/Event/TokenRegisterEvent.php on line 67
[Fri Jun 03 19:05:02.797939 2022] [php7:error] [pid 2718] [client 95.172.20.13:54108] PHP Fatal error:  Allowed memory size of 268435456 bytes exhausted (tried to allocate 20480 bytes) in /var/www/XXX/wp-includes/class-wp-fatal-error-handler.php on line 73
[Fri Jun 03 19:05:02.798448 2022] [php7:error] [pid 2718] [client 95.172.20.13:54108] PHP Fatal error:  Allowed memory size of 268435456 bytes exhausted (tried to allocate 20480 bytes) in /var/www/XXX/wp-includes/plugin.php on line 189

```

(XXX not the real folder name) I have tried enabling CiviCRM logging but it doesn't reveal anything more useful. I've tried enabling PHP error notices but am still seeing a 'friendly' HTTP error 500 in Chrome.

I've also tried temporarily disabling Mosaico.

Would really appreciate any assistance in debugging this further, thank you!

# Answer
> 2 votes
Try running the extension upgrades. Go to the Manage Extensions page, and it should display a notice to upgrade extensions.

Alternatively, try going to https://example.org/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fadmin%2Fextensions&reset=1 (replace example.org with your website).

I think this is specific to CiviCRM 5.50, when SearchKit is enabled. There are discussions here on how to avoid this problem in the future.

---
Tags: civimail
---


# Question
Title: Webform event registration confirmation email
We are just starting to use Webform to register users for a specific event. When the confirmation email is sent, we would like to have the event information (name, date, location) in the email. Can this be done using tokens or will it have to be hard-coded? This is not anything the user submitted. It would be pulled from the event in Civi.

# Answer
> 2 votes
I've gotten as far as event name and date (and time, optionally) by setting Title Display to "Title + Start-Date-Time" for example, and ensuring that the confirmation email that sends to registrants includes the token \[submission:values\]. If you want to exclude the submitters' details and just the event info, under Webform \> E-mails, you can go to "Included e-mail values" and uncheck everything but "Event".

# Answer
> 1 votes
There may also be a way to do that with webform features but you may want to have a look a the extension "Custom Event Communication" which allows you to define specific emails for each event.

---
Tags: civievent, drupal, webform-civicrm
---


title: How do you delete a tag set?

text:
# Question
Title: How do you delete a tag set?
How do you delete a tag set? I created a tag set and only really needed to create a new tag.

# Answer
The documentation covering Groups and Tags is here at https://docs.civicrm.org/user/en/stable/organising-your-data/groups-and-tags/

To view tags, go to: Contacts \> Manage Tags (Categories) in the navigation menu. A tag can be edited or deleted using the respective links in its row. If it is a reserved tag, remember to first untick the reserved box. Hope this helps.
> 2 votes

# Answer
If you are running an older version of the CiviCRM, you won't see the delete links unless you right-click on the tag. It's nonintuitive and took me awhile to find that out.

Contacts \> Manage Tags (Categories) \> right click on the tag.
> 2 votes

# Answer
Administer \> Customize Data and Screens \> Tags, scroll to find the name of the tag set you wish to delete, then click on the "Delete" hyperlink to the right-hand side of it.

Hope this helps, Tamar
> 1 votes

# Answer
Hopefully, this will be helpful to someone else.

The answer to "how do you delete a **tag set**?"

Before you can delete a tag set, you must delete all tags in that tag set, which can be done by following the answers others have given: *Contacts \> Manage Tags (Categories)* \> click on a tag and then click "Delete" on the right-hand side. Or use the CTRL key to select all the tags and then delete all of them.

Once you have deleted all of the tags in a tag set, then the title on the right-hand side will say "Empty Tag Set" and the delete option will be "Delete Set."
> 1 votes

---
Tags: custom-fields
---


# Question
Title: How to get Price Sets related to a Contribution Page using API 4
I am trying to use the API 4 to get all the related Price Sets for a given Contribution Page. I am having a hard time with this, being new to the API and the join function. Any help? In API 3, Price Sets were returned with a list of related entities, and I was able to go through all of them to identify those related to the Contribution Page.

# Answer
Unfortunately, there isn't a way to get the price set used for the contribution or event page. The link is stored in civicrm\_price\_set\_entity, with entity\_table set as civicrm\_contribution\_page or civicrm\_event and entity\_id as contribution page or event id.

Or you can apply the patch to support for api3 and api4
> 2 votes

---
Tags: contribution-page, price-sets, apiv4
---


# Question
Title: Mailing labels witth membership status or expiration date
So we use Civi for a magazine subscription or rather we are intending to do that. The hiccup at the moment is since it is a magazine we cannot print a separate sheet for the subscribers expiration date as that is not possible, so we want to add that to the mailing label that we do print. We have tried adding the extension https://github.com/ginkgostreet/com.ginkgostreet.relatedmembershiptokens/ but that is for emails and does not work in the mailing label part. Unfortunately hundres of our subscribers have not updated us with their email and still send in checks, so we are trying to accommodate them while new subscribers we have email addresses for. In any case has anyone been able to add these features to a mailing label?

Thanks in advance.

# Answer
If you are referring to Membership end date than probably you could use Fuzion tokens extension, it should give you membership end date token, which you can insert in mailing label
> 3 votes

# Answer
We've been doing something similar for 5+ years on our Wordpress installation.

1. In your contact layout, create a custom field for expiration date.
2. At CiviCRM/Administer CiviCRM/Address Settings, add something like this as the first line of your labels (i.e., before the name and address tokens). Note that this first line is **standardized text combined with your CiviCRM-defined custom field number**.

Thanks for subscribing through {contact.custom\_52}
3. This will show your message and the date as the first line of their label.
> 1 votes

---
Tags: civimail, civimember, mailing
---


# Question
Title: Why do donors' names appear twice on the emailed acknoweldgement of their contribution?
From a previous question/answer (Why is the billing name missing from the contributions email receipt?) I gather that our duplicated Billing Name might be due to a mistake in the System Work Flow Messages. But we haven't done any customization on any of the System Work Flow Messages.(None of them show an option to "Revert" to original.) Where else should I be looking to find the source of the duplicate name?

CiviCRM 5.48.0 on WordPress Version 6.0

# Answer
> 2 votes
Based on the note from @pradeep-nayak, I would guess that the template has two tokens that have the possibility to contain duplicate information:

{$billingName} {$address}

The address token on your setup may be customized to also include the contact's name. In the comments, I see the display format but if you look at the mailing label format on that same screen, does it have {contact.addressee} in it? If so, that may be where the duplicate name information is popping up from.

---
Tags: civicontribute, receipts, system-workflow-messages
---


# Question
Title: What issues are there running CiviCRM under IIS in 2022?
What issues are there installing, running, and upgrading CiviCRM when using Microsoft IIS as the webserver in 2022?

# Answer
For general windows-based installs @demeritcowboy would say it mostly works just there's one or two things if you do custom code with CRM\_Core\_BAO\_File and friends where you have to fight with `/` and `\`. Buildkit does not work, although he did get it working with WSL at one point. There used to be an issue with some places showing monetary amounts with extra zeros, e.g. $20.00000000 but he doesn't recall seeing it recently (this is separate from the backend spots where this is on-purpose to allow very precise tax calculations or bitcoin to work out).

@Stephen Palmstrom says "We are running CiviCRM under Drupal 9 under IIS - it was quicker for me to set that up than climbing the LAMP learning curve. On the whole it works well. I use Git Bash to run Composer to do installs as PowerShell doesn't always work so well. I also had to remove bin from hidden segments for API Explorer 4 to work. I also run attrib -r /s /d after an update. I use MySQL Workbench to manage MySQL. We aren't using Buildkit, but install using Composer. Below is a shell script I use in my IIS development environment that you may want to tweak for your purposes - it comes 'as is' with no warranty. It takes the folder, the application, the version and whether to run update immediately. That is because sometimes you are updating both Drupal and CiviCRM at the same time and it is quicker to run Composer Update only once. We have a very light workload so I can't vouch for performance if you have large number of users.

```
#!/bin/bash
#
#   Script to run Composer to update Drupal and/or CiviCRM
#
#   Stephen Palmstrom 18 March 2021
#
echo Updating...
while getopts r:a:v:u: option
do
case "${option}"
in
r ) ROOT=${OPTARG};;
a ) APPLICATION=${OPTARG};;
v ) VERSION=${OPTARG};;
u ) UPDATE=${OPTARG};;
esac
done
if [ "$ROOT" == "" ]
  then
    echo You need to specify a root folder!
    exit 0
fi
set -x
cd "$ROOT"
case $APPLICATION in
    "CiviCRM") PARAMS="civicrm/civicrm-core:$VERSION civicrm/civicrm-drupal-8:$VERSION civicrm/civicrm-packages:$VERSION";;
    "Drupal") PARAMS="drupal/core:$VERSION drupal/core-composer-scaffold:$VERSION drupal/core-recommended:$VERSION";;
    *) echo "-a CiviCRM or -a Drupal"
    exit 0;;
esac
EXTRAPARAMS=" --update-with-all-dependencies --no-update"
composer self-update
composer require $PARAMS $EXTRAPARAMS
if  [ "$UPDATE" == "YES" ]
    then
    echo "Running update..."
    # Make sure folders are writable as rmdir sometimes times out.
    #chmod 775 * -R
    composer update
    # Make sure these folders are writable after the update.
    chmod 775 $ROOT\\web\\sites\\default\\files\\civicrm -R
    set +x
fi

```
> 1 votes

---
Tags: hosting
---


# Question
Title: Creating a report with specific individuals
I have an excel document of donors that are already in the system but I want to make a specific contribution report for them to see who hasn't given in the last 36 months.

I do not want to import this CSV to avoid duplicating contacts.

All I want to do is create a contribution report with specific contacts filtering their giving.

# Answer
> 0 votes
You can do an import of just the name/email, and use a Matching Rule that ensures you do not create duplicates, and on the last step of the import you can then add them to a new Group.

This should mean you can a/ then find all contacts in that Group and build your report b/ run a more liberal dedupe rule on just that Group to pick up any duplicates that might have snuck in due to name differences eg Tom v Thomas (eg by setting First Name in the dedupe rule to only be 1 character long)

---
Tags: contacts, civireport, contributions, reports
---


# Question
Title: Is there a way to translate front end forms/pages without translating the backend of Civi as well?
We are on Drupal 7 and running Civi 5.41.2. We added Spanish to our localization settings as we host several events in Spanish and have a few Spanish-speaking staff. We have been expanding recently and find the need to have other languages. From what we have read, adding languages through localization settings adds a new table for each language and can cause detrimental database bloat if you use 5+ languages. We are thinking we will need 8+ if we want to have language options for every country we are in.

Is there a way to only translate the public facing pages and forms? Using localization seems to add translations of all backend content, which we don't need.

# Answer
> 2 votes
You can avoid the cost of the full multi-language set-up in certain situations; I think you can do what you want with **language switcher URLs**.

See blog at https://civicrm.org/blog/ayduns/language-switcher for more info, but in summary:

1. Visit **Administer » Localisation » Language, Currency...** and list the languages you need in the **Available languages** selector. Hit save.
2. Then, say you want to send a link to (European) Spanish speakers for an event booking page, get the event booking URL and append `&lcMessages=es_ES` Likewise for German speakers append `&lcMessages=de_DE`.

Users of those links will see translated versions of all CiviCRM interface texts. The content you enter (e.g. event title, description) will be as you entered it though, so for a Spanish event, type in Spanish!

This method will also use translated versions of confirmation emails etc. too, which is a bonus. However please note that the events system (as of 5.49) only supports one timezone, so dates and times will be shown in that configured timezone, which may differ.

---
Tags: localisation, translation
---


# Question
Title: PHP 7.4 error, PHP 8 Fatal Error - TypeError: array_flip() related to Search Prefrences
I'm running against a fatal error when I attempt to update my user profile on a drupal9/civicrm5.49.5 setup (url path: /user/1/edit/profile/1).

The error message is as follows:

```
The website encountered an unexpected error. Please try again later.
TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in include() (line 15 of sites/default/files/civicrm/templates_c/en_US/%%4D/4DC/4DC76B26%%body.tpl.php).

include() (Line: 1914)
Smarty->_smarty_include(Array) (Line: 43)
include('/app/web/sites/default/files/civicrm/templates_c/en_US/%%0A/0AF/0AF6F87E%%Dynamic.tpl.php') (Line: 1273)
Smarty->fetch('CRM/Profile/Form/Dynamic.tpl', NULL, NULL, ) (Line: 185)
CRM_Core_Smarty->fetch('CRM/Profile/Form/Dynamic.tpl') (Line: 930)
CRM_Core_BAO_UFGroup::getEditHTML(203, 'Name and Address') (Line: 86)
Drupal\civicrm\Form\UserProfile->buildForm(Array, Object, Object, '1')
call_user_func_array(Array, Array) (Line: 531)
Drupal\Core\Form\FormBuilder->retrieveForm('civicrm_user_profile', Object) (Line: 278)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 564)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 158)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 80)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 708)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

```

I suspect a problem with PHP 8 support. The problem goes away after downgrading PHP to 7.4. to be more specific, the error is not FATAL on 7.4 and is fatal PHP 8+

Seems related to another PHP 7.4, PHP 8 TypeError I encountered when making adjustments to the search preferences, unchecking not needed fields and checking new custom fields, reordering or any change on the search preferences page. no autocomplete drop down anymore and when I TRY to go back into search preferences, 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..`

This is Fatal because of php 8? Not fatal on php 7.4.

This issue is related to CiviCRM 5.55.1 .2 and 5.56

I did create an issue of this and filed as bug.

# Answer
> 1 votes
This sounds the same as https://lab.civicrm.org/dev/core/-/issues/2301#note\_52815 but it's a bit hard to fix properly because there are multiple problems at once and the validation on that form is not correct to begin with.

---
Tags: profile, php
---


# Question
Title: civibooking fatal error -- need suggestions
I'm running Drupal 7.9, CiviCRM 5.50.1 and php 7.4 and am getting this error with CiviBooking:

```
Fatal error: Cannot make static method CRM_Contact_BAO_Query_Interface::from() non static in class CRM_Booking_BAO_Query in /home/mysite/www/www/sites/default/files/civicrm/civi_extensions/uk.co.compucorp.civicrm.booking/CRM/Booking/BAO/Query.php on line 270

```

I am not a PHP guru. Can someone explain what is wrong? And maybe a bit on how I might fix it?

The code starting at line 270 is:

```
function from($name, $mode, $side) {
    $from = NULL;
    switch ($name) {
      case 'civicrm_booking':
        $from = " $side JOIN civicrm_booking ON civicrm_booking.primary_contact_id = contact_a.id AND civicrm_booking.is_deleted = 0 ";
        break;
      case 'civicrm_booking_status':
        $from = " $side JOIN civicrm_option_group option_group_booking_status ON (option_group_booking_status.name = 'booking_status') ";
        $from .= " $side JOIN civicrm_option_value civicrm_booking_status ON (civicrm_booking.status_id = civicrm_booking_status.value AND option_group_booking_status.id = civicrm_booking_status.option_group_id ) ";
        break;
      case 'civicrm_booking_payment_status':
        $from .= " $side JOIN civicrm_booking_payment on civicrm_booking_payment.booking_id = civicrm_booking.id ";
        $from .= " $side JOIN civicrm_contribution contribution on contribution.id = civicrm_booking_payment.contribution_id ";
        $from .= " $side JOIN civicrm_option_group option_group_booking_payment ON option_group_booking_payment.name = 'contribution_status' ";
        $from .= " $side JOIN civicrm_option_value civicrm_booking_payment_status ON (contribution.contribution_status_id = civicrm_booking_payment_status.value AND option_group_booking_payment.id = civicrm_booking_payment_status.option_group_id ) ";
        break;
      case 'civicrm_booking_associated_contact':
        $from = " $side JOIN civicrm_contact civicrm_booking_associated_contact ON (civicrm_booking_associated_contact.id = civicrm_booking.secondary_contact_id) ";
        break;
    }
    return $from;
  }

```

# Answer
That changed as part of civigrant changes in 5.47. https://github.com/civicrm/civicrm-core/commit/adde8f5eb1443a5048e5bf01dcb3fb7035fe557c#diff-b48ef419b5be8483fd4f9d6eaba0a30e7ae575001b25d554bef4331724518699R32

Just put the word static in front of line 270, i.e.

`public static function from`...
> 2 votes

# Answer
We have been using forked repo, it has fatal error fixes.
> 2 votes

---
Tags: civibooking
---


# Question
Title: How to charge a credit card that was already used on file via iATS
A donor requested I charge their card for a donation with their card that is already on file. It's not a recurring contribution. I tried to view their card number from their previous donations, but it won't let me because it's tied to the payment processor. Do I need to ask them for their card number again?

# Answer
> 1 votes
yes you need to ask them again. For obvious security reason, you're not supposed to see the credit card number. The payment gateway (IATS, Stripe...) will itself not record the full credit card number. You would actually only see the last 4 digits if you would have access to it.

---
Tags: civicontribute
---


# Question
Title: Contact Layout Editor side by side columns
When setting up a custom layout for contacts with the Contact Layout Editor extension, is there a way to setup certain fields (within a tab) side by side instead of on top of each other?

So this is how it looks now:

But this is what I want it to look like:

# Answer
I think you can do it using Search Kit and form builder.

Create a search using a search kit with a display as a grid, include the search in a form and enable the in a tab.
> 1 votes

---
Tags: wordpress, contacts, contact-view, contact-layout-editor
---


# Question
Title: will be fixed in 5.50.2 : No more receipt_text_renewal field in notification mail of a renewal in v. 5.50.1
After upgrading to v. 5.50.1 (Joomla!), we don't find anymore the field texarea to add some word in the notification email of a renewal.

Step to reproduce :

1. Go to membership
2. click on renew
3. tick Send Confirmation and Receipt?
4. there is no field ta add some text

I try to change receipt\_text\_renewal to receipt\_text in MembershipRenewal.tpl on line 127 but the written text wasn't sent by email.

Is this an issue ?

# Answer
> 1 votes
See https://github.com/civicrm/civicrm-core/pull/23726. It will be fixed in 5.50.2

---
Tags: civimember, joomla, issues
---


title: Putting Contact Tags in Email Template

text:
# Question
Title: Putting Contact Tags in Email Template
I would like to add the tags/groups of a contact into the email body of a template. Is there a shortcode that can do this?

Thanks in advance!

# Answer
Welcome to CiviCRM SE.

I have contact group token extension which provides a list of group users added to, but not for tags.
> 4 votes

---
Tags: groups, templates, tags
---


# Question
Title: BUG Update Contacts in Search Results, Relationship to Organization, Employee of, deleted Employee of Relationship Type
ERROR "appears you have deleted the employee relationship type" BUT that is not the case, and now the summary view can't display/modify employer since doing a relationship update via search results/action. So is something amiss in the code for doing relationship updates from search results? This never happened to us before. Didn't find anything similar on search in stackexchange.

This comes after the site was upgraded to CiviCRM 5.50.1 on Wordpress 6.0 site, mysql 5.7.36-39, php 7.4 on CiviHosting: A fairly simple search by contactType (individual subtype). Selected all results. Clicked on ACTION dropdown, Add relationship to organization. Selected Employee of, entered organizationName of employer (existing contact), selected radio button of employer's contact record organization name. Under relationships we can see the "employee of" and the "employer" but in summary view it did not show up, it is blank; every time we try to edit employer on the summary page it says connection with server failed and/or pops up with "it appears you deleted employee of relationship type". It one time also displayed a message above employer selection like "another user edited this record." We checked the relationship types table in Civi and the database, it's in there as its default. When we click to edit the contact's employer in summary view we see the employer's name, but trying to save it, says it failed to connect with server, say it appears employee relationship type was deleted, click save, and it shows up empty again.

Any help appreciated. We want the employer to show up in summary view and relationships tab like it should, like it did.

# Answer
possible issue is that 'employer of' and 'current employer' are not the same thing.

'employer of' is purely a relationship

'current employer' is an additional field on the relationship which is what then causes that Organisation to show on the Contact Summary screen
> 0 votes

---
Tags: error, relationships, upgrade, deleted
---