# Question
Title: Event sign up offline, without payment: the $totalAmount tag is empty
When sending the email for offline registration, the total amount does not appear in the email if no payment has been recorded.

Once a payment is recorded, the total appears (even if the payment is only partial - subsidiary question: how to record a second payment, e.g. for the balance?)

However, in the civicrm\_participant table, the fee\_level field is saved. In addition, I cannot find the amount entered in another table. So it seems that the $totalAmount tag captures this information well.

Also, I don’t see any conditions in the code that would impact the display or not.

As suggested on this post, Event fees not showing correctly, I went back to the default system message and the problem is the same.

What can I do to fix this? We want registrants to receive the total amount to be paid when the secretary registers them in CiviCRM.

Would there be any similarity to the problem described here: Event email receipt doesn't have Total amount data ?

Thank you in advance for your help.

CiviCRM 5.43.2 / Joomla! 3.10.6

Thank you in advance for your help.

The content of the message template is as follows:

```
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
 <title></title>
</head>
<body>

{capture assign=headerStyle}colspan="2" style="text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;"{/capture}
{capture assign=labelStyle }style="padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;"{/capture}
{capture assign=valueStyle }style="padding: 4px; border-bottom: 1px solid #999;"{/capture}

<center>
  <table id="crm-event_receipt" style="font-family: Arial, Verdana, sans-serif; text-align: left; width:100%; max-width:700px; padding:0; margin:0; border:0px;">

  <!-- BEGIN HEADER -->
  <!-- You can add table row(s) here with logo or other header elements -->
  <!-- END HEADER -->

  <!-- BEGIN CONTENT -->

  <tr>
   <td>
    <!--{assign var="greeting" value="{contact.email_greeting}"}{if $greeting}<p>{$greeting},</p>{/if}-->

    {if $event.confirm_email_text AND (not $isOnWaitlist AND not $isRequireApproval)}
     <p>{$event.confirm_email_text|htmlize}</p>
    {/if}

    {if $isOnWaitlist}
     <p>{ts}You have been added to the WAIT LIST for this event.{/ts}</p>
     {if $isPrimary}
       <p>{ts}If space becomes available you will receive an email with a link to a web page where you can complete your registration.{/ts}</p>
     {/if}
    {elseif $isRequireApproval}
     <p>{ts}Your registration has been submitted.{/ts}</p>
     {if $isPrimary}
      <p>{ts}Once your registration has been reviewed, you will receive an email with a link to a web page where you can complete the registration process.{/ts}</p>
     {/if}
    {elseif $is_pay_later}
     <p>{$pay_later_receipt}</p> {* FIXME: this might be text rather than HTML *}
    {/if}

   </td>
  </tr>
  <tr>
   <td>
    <table style="border: 1px solid #999; margin: 1em 0em 1em; border-collapse: collapse; width:100%;">
     <tr>
      <th {$headerStyle}>
       {ts}Event Information and Location{/ts}
      </th>
     </tr>
     <tr>
      <td colspan="2" {$valueStyle}>
       {$event.event_title}<br />
       {$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:"%Y%m%d" == $event.event_start_date|date_format:"%Y%m%d"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|crmDate}{/if}{/if}
      </td>
     </tr>

     {if $event.participant_role neq 'Attendee' and $defaultRole}
      <tr>
       <td {$labelStyle}>
        {ts}Participant Role{/ts}
       </td>
       <td {$valueStyle}>
        {$event.participant_role}
       </td>
      </tr>
     {/if}

     {if $isShowLocation}
      <tr>
       <td colspan="2" {$valueStyle}>
        {$location.address.1.display|nl2br}
       </td>
      </tr>
     {/if}

     <!--{if $location.phone.1.phone || $location.email.1.email}
      <tr>
       <td colspan="2" {$labelStyle}>
        {ts}Event Contacts:{/ts}
       </td>
      </tr>
      {foreach from=$location.phone item=phone}
       {if $phone.phone}
        <tr>
         <td {$labelStyle}>
          {if $phone.phone_type}
           {$phone.phone_type_display}
          {else}
           {ts}Phone{/ts}
          {/if}
         </td>
         <td {$valueStyle}>
          {$phone.phone} {if $phone.phone_ext} {ts}ext.{/ts} {$phone.phone_ext}{/if}
         </td>
        </tr>
       {/if}
      {/foreach}
      {foreach from=$location.email item=eventEmail}
       {if $eventEmail.email}
        <tr>
         <td {$labelStyle}>
          {ts}Email{/ts}
         </td>
         <td {$valueStyle}>
          {$eventEmail.email}
         </td>
        </tr>
       {/if}
      {/foreach}
     {/if}-->

     {if $event.is_public}
      <tr>
       <td colspan="2" {$valueStyle}>
        {capture assign=icalFeed}{crmURL p='civicrm/event/ical' q="reset=1&id=`$event.id`" h=0 a=1 fe=1}{/capture}
        <a href="{$icalFeed}">{ts}Download iCalendar File{/ts}</a>
       </td>
      </tr>
     {/if}

     <!--{if $email}
      <tr>
       <th {$headerStyle}>
        {ts}Registered Email{/ts}
       </th>
      </tr>
      <tr>
       <td colspan="2" {$valueStyle}>
        {$email}
       </td>
      </tr>
     {/if}-->

     {if $event.is_monetary}

      <tr>
       <th {$headerStyle}>
        {$event.fee_label}
       </th>
      </tr>

      {if $lineItem}
       {foreach from=$lineItem item=value key=priceset}
        {if $value neq 'skip'}
         {if $isPrimary}
          {if $lineItem|@count GT 1} {* Header for multi participant registration cases. *}
           <tr>
            <td colspan="2" {$labelStyle}>
             {ts 1=$priceset+1}Participant %1{/ts}
            </td>
           </tr>
          {/if}
         {/if}
         <tr>
          <td colspan="2" {$valueStyle}>
           <table> {* FIXME: style this table so that it looks like the text version (justification, etc.) *}
            <tr>
             <th>{ts}Item{/ts}</th>
             <th>{ts}Qty{/ts}</th>
             <!--<th>{ts}Each{/ts}</th>-->
             {if $dataArray}
              <th>{ts}SubTotal{/ts}</th>
              <th>{ts}Tax Rate{/ts}</th>
              <th>{ts}Tax Amount{/ts}</th>
             {/if}
             <th>{ts}Total{/ts}</th>
       {if $pricesetFieldsCount }<th>{ts}Total Participants{/ts}</th>{/if}
            </tr>
            {foreach from=$value item=line}
             <tr>
              <td>
        {if $line.html_type eq 'Text'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description}<div>{$line.description|truncate:30:"..."}</div>{/if}
              </td>
              <td>
               {$line.qty}
              </td>
              <!--<td>
               {$line.unit_price|crmMoney}
              </td>-->
              {if $dataArray}
               <td>
                {$line.unit_price*$line.qty|crmMoney}
               </td>
               {if $line.tax_rate != "" || $line.tax_amount != ""}
                <td>
                 {$line.tax_rate|string_format:"%.2f"}%
                </td>
                <td>
                 {$line.tax_amount|crmMoney}
                </td>
               {else}
                <td></td>
                <td></td>
               {/if}
              {/if}
              <td>
               {$line.line_total+$line.tax_amount|crmMoney}
              </td>
        {if  $pricesetFieldsCount }
        <td>
    {$line.participant_count}
              </td>
        {/if}
             </tr>
            {/foreach}
           </table>
          </td>
         </tr>
        {/if}
       {/foreach}
       {if $dataArray}
        <tr>
         <td {$labelStyle}>
          {ts}Amount Before Tax:{/ts}
         </td>
         <td {$valueStyle}>
          {$totalAmount-$totalTaxAmount|crmMoney}
         </td>
        </tr>
        {foreach from=$dataArray item=value key=priceset}
          <tr>
           {if $priceset || $priceset == 0}
            <td> {$taxTerm} {$priceset|string_format:"%.2f"}%</td>
            <td> {$value|crmMoney:$currency}</td>
           {else}
            <td> {ts}No{/ts} {$taxTerm}</td>
            <td> {$value|crmMoney:$currency}</td>
           {/if}
          </tr>
        {/foreach}
       {/if}
      {/if}

      {if $amount && !$lineItem}
       {foreach from=$amount item=amnt key=level}
        <tr>
         <td colspan="2" {$valueStyle}>
          {$amnt.amount|crmMoney} {$amnt.label}
         </td>
        </tr>
       {/foreach}
      {/if}
      {if $totalTaxAmount}
       <tr>
        <td {$labelStyle}>
         {ts}Total Tax Amount{/ts}
        </td>
        <td {$valueStyle}>
         {$totalTaxAmount|crmMoney:$currency}
        </td>
       </tr>
      {/if}
      {if $isPrimary}
       <tr>
        <td {$labelStyle}>
        {if $balanceAmount}
           {ts}Total Paid{/ts}
        {else}
           {ts}Total Amount{/ts}
         {/if}
        </td>
        <td {$valueStyle}>
{if !empty($totalAmount)}{$totalAmount|crmMoney:$currency}{/if} {if !empty($hookDiscount.message)}({$hookDiscount.message}){/if}
<!--         {$totalAmount|crmMoney} {if $hookDiscount.message}({$hookDiscount.message}){/if}-->
        </td>
       </tr>
      {if $balanceAmount}
       <tr>
        <td {$labelStyle}>
         {ts}Balance{/ts}
        </td>
        <td {$valueStyle}>
         {$balanceAmount|crmMoney}
        </td>
       </tr>
      {/if}
       {if $pricesetFieldsCount }
     <tr>
       <td {$labelStyle}>
   {ts}Total Participants{/ts}</td>
       <td {$valueStyle}>
   {assign var="count" value= 0}
         {foreach from=$lineItem item=pcount}
         {assign var="lineItemCount" value=0}
         {if $pcount neq 'skip'}
           {foreach from=$pcount item=p_count}
           {assign var="lineItemCount" value=$lineItemCount+$p_count.participant_count}
           {/foreach}
           {if $lineItemCount < 1 }
           assign var="lineItemCount" value=1}
           {/if}
           {assign var="count" value=$count+$lineItemCount}
         {/if}
         {/foreach}
   {$count}
       </td>
     </tr>
     {/if}
       {if $is_pay_later}
        <tr>
         <td colspan="2" {$labelStyle}>
          {$pay_later_receipt}
         </td>
        </tr>
       {/if}

       {if $register_date}
        <tr>
         <td {$labelStyle}>
          {ts}Registration Date{/ts}
         </td>
         <td {$valueStyle}>
          {$register_date|crmDate}
         </td>
        </tr>
       {/if}

       {if $receive_date}
        <tr>
         <td {$labelStyle}>
          {ts}Transaction Date{/ts}
         </td>
         <td {$valueStyle}>
          {$receive_date|crmDate}
         </td>
        </tr>
       {/if}

       {if $financialTypeName}
        <tr>
         <td {$labelStyle}>
          {ts}Financial Type{/ts}
         </td>
         <td {$valueStyle}>
          {$financialTypeName}
         </td>
        </tr>
       {/if}

       {if $trxn_id}
        <tr>
         <td {$labelStyle}>
          {ts}Transaction #{/ts}
         </td>
         <td {$valueStyle}>
          {$trxn_id}
         </td>
        </tr>
       {/if}

       {if $paidBy}
        <tr>
         <td {$labelStyle}>
          <!--{ts}Paid By{/ts}-->Informations pour le paiement
         </td>
         <td {$valueStyle}>
         {$paidBy}
         </td>
        </tr>
       {/if}

       {if $checkNumber}
        <tr>
         <td {$labelStyle}>
          {ts}Check Number{/ts}
         </td>
         <td {$valueStyle}>
          {$checkNumber}
         </td>
        </tr>
       {/if}

       {if $billingName}
        <tr>
         <th {$headerStyle}>
          {ts}Billing Name and Address{/ts}
         </th>
        </tr>
        <tr>
         <td colspan="2" {$valueStyle}>
          {$billingName}<br />
          {$address|nl2br}
         </td>
        </tr>
       {/if}

       {if $credit_card_type}
        <tr>
         <th {$headerStyle}>
          {ts}Credit Card Information{/ts}
         </th>
        </tr>
        <tr>
         <td colspan="2" {$valueStyle}>
          {$credit_card_type}<br />
          {$credit_card_number}<br />
          {ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:''|crmDate}
         </td>
        </tr>
       {/if}

      {/if}

     {/if} {* End of conditional section for Paid events *}

     {if $customPre}
      <tr>
       <th {$headerStyle}>
        {$customPre_grouptitle}
       </th>
      </tr>
      {foreach from=$customPre item=value key=customName}
       {if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields}
        <tr>
         <td {$labelStyle}>
          {$customName}
         </td>
         <td {$valueStyle}>
          {$value}
         </td>
        </tr>
       {/if}
      {/foreach}
     {/if}

     {if $customPost}
      <tr>
       <th {$headerStyle}>
        {$customPost_grouptitle}
       </th>
      </tr>
      {foreach from=$customPost item=value key=customName}
       {if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields}
        <tr>
         <td {$labelStyle}>
          {$customName}
         </td>
         <td {$valueStyle}>
          {$value}
         </td>
        </tr>
       {/if}
      {/foreach}
     {/if}

     {if $customProfile}
      {foreach from=$customProfile item=value key=customName}
       <tr>
        <th {$headerStyle}>
         {ts 1=$customName+1}Participant Information - Participant %1{/ts}
        </th>
       </tr>
       {foreach from=$value item=val key=field}
        {if $field eq 'additionalCustomPre' or $field eq 'additionalCustomPost'}
         <tr>
          <td colspan="2" {$labelStyle}>
           {if $field eq 'additionalCustomPre'}
            {$additionalCustomPre_grouptitle}
           {else}
            {$additionalCustomPost_grouptitle}
           {/if}
          </td>
         </tr>
         {foreach from=$val item=v key=f}
          <tr>
           <td {$labelStyle}>
            {$f}
           </td>
           <td {$valueStyle}>
            {$v}
           </td>
          </tr>
         {/foreach}
        {/if}
       {/foreach}
      {/foreach}
     {/if}

     {if $customGroup}
      {foreach from=$customGroup item=value key=customName}
       <tr>
        <th {$headerStyle}>
         {$customName}
        </th>
       </tr>
       {foreach from=$value item=v key=n}
        <tr>
         <td {$labelStyle}>
          {$n}
         </td>
         <td {$valueStyle}>
          {$v}
         </td>
        </tr>
       {/foreach}
      {/foreach}
     {/if}

    </table>
   </td>
  </tr>

 </table>
</center>

</body>
</html>

```

# Answer
Try changing the total amount section to:

```
<tr>
<td {$labelStyle}>
{ts}Total Amount{/ts}
</td>
<td {$valueStyle}>
{if !empty($totalAmount)}{$totalAmount|crmMoney:$currency}{/if} {if !empty($hookDiscount.message)}({$hookDiscount.message}){/if}
</td>
</tr>

```
> 0 votes

---
Tags: civievent, email, system-workflow-messages
---


# Question
Title: Deleted contacts are showing up in the recipients list for New Email
Wanting to check in here before creating a Issue at GitLab...

I've discovered when creating a New Email (not a Mailing), deleted contacts are available as Recipients. They are not available in the CC or BCC fields. This is different, but perhaps related to this SE Question: Mailing to contacts in a group - deleted contacts were included to the list of recipients.

Sounds like a bug, right? It's certainly not the behavior I expected.

CiviCRM 39.5.0, Joomla 3.10.6

# Answer
> 2 votes
Assumed a bug. Issue created on GitLab

---
Tags: email
---


# Question
Title: User receives "lifetime" error when renewing membership
He have multiple memberships available. Some are a 1 year duration and some are lifetime memberships. Recently, some users who have a lifetime membership A try to renew annual membership B and get the following message: "You already have a lifetime membership and cannot select a membership with a shorter term." This has happened twice in the last few weeks. We have had the same memberships set up for quite a while so we're not sure why we are seeing this now. Does anyone have a recommendation for preventing this?

# Answer
The system won't allow users to change their membership type if they already have a lifetime membership. Also, the system can only have one membership for a contact of each organization. In case you want to have a lifetime membership and regular membership for a contact, you will need to create a membership type for a different organization i.e life time membership type belonging to Org A and Regular membership type to Org B.
> 2 votes

---
Tags: civimember, renewals
---


# Question
Title: Scheduled Job -- Mail report - cannot find InstanceID
Set up schedule job for mail reports. the following error is in the log:

---

Finished execution of Mail Reports with result: Failure, Error message: Report Mail Triggered... Required parameter missing: instanceId

Details

Parameters raw (from db settings): instanceID=1 format=csv

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

Full message: Finished execution of Mail Reports with result: Failure, Error message: Report Mail Triggered... Required parameter missing: instanceId

---

Have tried multiple options for parameters and spelling - i.e. lower case and different report IDs that are known to exist. All give the same error.

# Answer
You have instanceID with a capital D. It wants instanceId.
> 3 votes

# Answer
I got this error after upgrading (was very many versions behind).

I had trouble finding where to enter the parameter in the dashboard, but it's in "Settings - Scheduled Jobs", Mail reports. Then I edited and added "instanceId=1 format=csv" to the Command Parameters and saved. Went to more \> Execute now and it worked.
> 2 votes

---
Tags: civireport, reports, scheduled-job
---


# Question
Title: Upgrade to 5.47.x fails with error: Exception: "API error: DB Error: constraint violation on ReportTemplate.create"
On running an upgrade to 5.47.1 I get the following

\[Error: Finish core DB updates 5.47.1\] Exception: "API error: DB Error: constraint violation on ReportTemplate.create"

Partial stacktrace

```
#0 [civicrm-root]/CRM/Core/ManagedEntities.php(375): CRM_Core_ManagedEntities->onApiError("ReportTemplate", "create", (Array:8), (Array:6))
#1 [civicrm-root]/CRM/Core/ManagedEntities.php(187): CRM_Core_ManagedEntities->updateExistingEntity(Object(CRM_Core_DAO_Managed), (Array:10))
#2 [civicrm-root]/CRM/Core/ManagedEntities.php(167): CRM_Core_ManagedEntities->reconcileEnabledModule("nz.co.fuzion.extendedreport")
#3 [civicrm-root]/CRM/Core/ManagedEntities.php(128): CRM_Core_ManagedEntities->reconcileEnabledModules()
#4 [civicrm-root]/CRM/Core/Invoke.php(413): CRM_Core_ManagedEntities->reconcile()
#5 [civicrm-root]/CRM/Upgrade/Form.php(818): CRM_Core_Invoke::rebuildMenuAndCaches(FALSE, TRUE)
#6 [civicrm-root]/CRM/Queue/Task.php(73): CRM_Upgrade_Form::doCoreFinish(Object(CRM_Queue_TaskContext), "5.47.1", "5.47.1", "5.47.1", "/tmp/civicrm-post-upgradeRgUuuC")
#7 [civicrm-root]/CRM/Queue/Runner.php(215): CRM_Queue_Task->run(Object(CRM_Queue_TaskContext))
#8 [civicrm-root]/CRM/Queue/Page/AJAX.php(36): CRM_Queue_Runner->runNext(TRUE)
#9 [civicrm-root]/CRM/Queue/ErrorPolicy.php(89): CRM_Queue_Page_AJAX::{closure}()
#10 [civicrm-root]/CRM/Queue/Page/AJAX.php(38): CRM_Queue_ErrorPolicy->call(Object(Closure))
#11 [civicrm-root]/CRM/Core/Invoke.php(285): CRM_Queue_Page_AJAX::runNext()
#12 [civicrm-root]/CRM/Core/Invoke.php(69): CRM_Core_Invoke::runItem((Array:13))
#13 [civicrm-root]/CRM/Core/Invoke.php(36): CRM_Core_Invoke::_invoke((Array:5))
#14 [civicrm-root]/civicrm/src/Civicrm.php(88): CRM_Core_Invoke::invoke((Array:5))
#15 /civicrm/src/Controller/CivicrmController.php(80): Drupal\civicrm\Civicrm->invoke((Array:5))
#16 [internal function](): Drupal\civicrm\Controller\CivicrmController->main((Array:5), "queue:ajax:runNext")

```

# Answer
> 10 votes
The problem here was the Extension Extended Reports - however it's possible that you have a different extension causing the problem.

In 5.47.0 CiviGrant component was transferred to an extension. You need to upgrade to at least the 5.12.1 version of CiviCRM Extended reports.

If you have hit this you should be able to finish the upgrade tasks manually:

You will need to Flush Caches Rebuild all triggers (If you haven't turned them off for the upgrade) and force a rebuild of the CiviCRM Asset Cache

To do via the UI you will want to clear caches and toggle logging on and off - If you didn't turn it off for the upgrade.

The PHP to do this if you prefer can be found at https://github.com/civicrm/civicrm-core/blob/1754e1752eb8e516ec846a438005f6fcb55be247/CRM/Upgrade/Form.php#L818

where you want to run everything until the end of that method.

# Answer
> 2 votes
There few other alternate approaches to proceed with Civi 5.47 upgrade if you have an Extended report extension enabled

1. Upgrade CiviCRM to 5.46.2 -\> Upgrade Extended report to 5.13 -\> Upgrade CiviCRM to 5.47.1
2. Upgrade Extended report to 5.13 -\> Upgrade CiviCRM to 5.47.1
3. Comment the line 127 in CRM/Upgrade/Incremental/php/FiveFortySeven.php -\> Upgrade CiviCRM to 5.47.1 -\> Upgrade Extended report to 5.13

---
Tags: extension, upgrade
---


title: Enabling emailing from civi

text:
# Question
Title: Enabling emailing from civi
I am probably missing something glaringly obvious but I've been running in circles in the past days.

I've been unable to send emails to recipients (usual mailing, mosaico..) and after a lot of tuning the system supposedly sends the email (doesn't show any errors) but the mailing is stuck on scheduled and won't budge.

In the outbound mail I've tried the mail() and SMTP options to no avail. For the latter I added my work gmail account with its username and password. In the mail accounts settings I have two items, both on the same server with Maildir protocol and not using SSL. One is used for Email-to-activity and the other for Bounce processing.

The environment instance of civiCRM is set to production.

The FROM addresses I added were my work e-mail just to test it (it was added for SMTP settings) and a few addresses that are gmail routing addresses (it's not a "proper account" where you have a username/password but you choose the name of your e-mail and it routes into inboxes of people who are recipients of such routing address).

None of the e-mails go past the scheduled point.

I enabled the Send Scheduled Mailings in the Scheduled Jobs settings but it seems that cron jobs have not been enabled so that could possibly be the culprit? If cron jobs are the problem, can I use the mentioned routing addresses as from addresses and what should I add as SMTP settings if that's what I'm supposed to use (we use gmail for our communication). I really don't want my username/password to be associated with it.

Civi is on Wordpress 5.9.2.

# Answer
> 0 votes
If you haven't set up a cron job then none of the shceduled jobs you enabled are going to run automatically, so that is definitely necessary. Pradeeps suggestion is a quick way to check if this will solve your problem.

---
Tags: wordpress, civimail
---


title: Stripe Error Popup

text:
# Question
Title: Stripe Error Popup
During a test of the system, I am trying to run the card and Test cards do not work as it says the link either test or live the stripe demo cards do not work. I have to test on my own card. I type all information in and I click the button upon doing so I am greeted with a popup that says error. It is using stripe payment, and I added the extension in via file manager and also setup stripe with both API keys as well. I have install all apporiate extensions from CIVI as I logged into the System Check and fixed all that. Firewall, Stripe 6.6.3, Sweet Alert. The orignal issue was ajax

My New Error is Configuration error - unable to process paymentInten

# Answer
Stripe requires 'CiviCRM access ajax API' permission for anonymous and authenticated users, could you check if they are in place?
> 0 votes

# Answer
The list of extensions you gave doesn't include "Payment Shared", aka "mjwshared". Please install that, it's required for Stripe.
> 0 votes

---
Tags: stripe, payment, renewals
---


# Question
Title: Is there a cv command to update extensions?
Silly question I guess but I can't find in `list` an option to perform extension update with `cv`.

Is that possible?

EDIT 1: is there a possibility for a `ext:update` option that would perform individual update such as `cv ext:update my-extension` or a bulk update `cv ext:update all`?

# Answer
> 5 votes
An "update all" option doesn't exist. For myself, I have a PHP script (below) that returns a JSON file with the extensions that need upgrading.

This is part of a larger Ansible role which takes that JSON and runs `cv ext:upgrade` on each extension and commits them to version control individually (which is why I return the version number and human-friendly name as well).

Instead of using my Ansible, if you have `jq` and `xargs` installed, you can run this instead to upgrade every extension:

```
upgradeable-civi.php | jq '.[] | .key' | xargs cv ext:download --force

```

This is slightly more complicated, but will upgrade all extensions in one shot, which is faster (clear cache/reconcile managed entities only once, instead of between each extension)

```
upgradeable-civi.php | jq '.[] | .key' | tr '\n' ' ' | xargs cv ext:download --force

```

My script:

```
#!/usr/bin/php
<?php
eval(`cv php:boot`);

$e = new CRM_Admin_Page_Extensions();
$localExtensionList = $e->formatLocalExtensionRows();
$remoteExtensionList = $e->formatRemoteExtensionRows($localExtensionList);
$upgradeableExtensions = [];
$i = 0;
foreach ($remoteExtensionList as $e) {
  if ($e['upgradelink'] ?? FALSE) {
    $upgradeableExtensions[$i]['key'] = $e['file'];
    $upgradeableExtensions[$i]['name'] = $e['name'];
    $upgradeableExtensions[$i]['version'] = $e['version'];
    $i++;
  }
}
print_r(json_encode($upgradeableExtensions));

```

# Answer
> 0 votes
You will need to update the extension folder and run

```
cv ext:upgrade-db

```

---
Tags: cv
---


# Question
Title: Can I allow users to update their registration?
I have a non-profit that runs an event once a month where the users leave their cars at home to walk, bike, or ride public transit for their daily commute. I'm testing the online registration function of CiviCRM to allow them to record their transit method and mileage for that day, but they need to be able to update the record in case their method changes. For example, if they said they were going to ride a bike but instead took the subway because of rain.

If they attempt to register twice they'll get the message that they're already registered. If I allow multiple participants, they can record a new route but they show up as multiple entries with the same name (obviously).

I can't seem to find a configuration setting to allow registration updates. Am I missing something?

# Answer
> 5 votes
Drupal Webforms currently have this functionality, so if you set up your Civi event registration page using Drupal Webform-Integration, your users will be able to revisit the form and update their contact info, registration details, or even cancel their registration.

# Answer
> 4 votes
This feature is being discussed as part of this Make It Happen initiative: Self service view, update and cancel for CiviEvent.

# Answer
> 1 votes
To my mind you haven't given enough detail about how you intend to set up your events.

If the method of transportation is built into the actual event registration (that is people register to ride a bike , or they register to catch the train, or they register to walk) then they won't be able to change their registration for the event if they used a different mode of transport.

However, you could set it up so that people register to participate in the alternative transport event and then collect details on their proposed mode of transport via custom fields. Once the event is over you can send them a personalised (checksum) link to a profile containing those custom fields and they can update them if necessary.

# Answer
> 1 votes
There was a recent blog post about this Make It Happen that davidjenx refers to: https://civicrm.org/blog/zorga-lina/civievent-self-service-canceltransfer-for-participant

You said that allowing multiple participants was one approach you had tested, but which obviously led to 2 listings. One approach might be to allow multiple participants, and then try to dedupe them or only show the latest of the bookings.

# Answer
> 1 votes
Expanding on JoAnne's answer: You can expose the profile you used to collect the information (using custom fields) during the event registration and participants can edit their information using that profile.

On the profile page, click More. Click on "Use Profile-Create mode". Copy that url, change the create to edit. Then share that with participants, using checksum or simply a link (that will require them to login).

# Answer
> 1 votes
This extension lets participants update their registration: edit event fee. It basically exposes the form that is available in the backend (with some access restrictions, or checksum validation).

It has not yet been tested with completed payments, only with pending payments.

---
Tags: civievent
---


title: Force Batch Merge All Duplicates

text:
# Question
Title: Force Batch Merge All Duplicates
I have around 900 pairs of contacts I want to force merge. From my attempts to do this, if you click "merge all duplicates", it will simply display "900 pairs skipped" and not give you the "force batch merge" option that you do get when manually selecting contacts to merge.

I am matching on external id's that I've already rigged to ensure consistency, I am sure I want these merged.

Right now my only option is to select 100 contacts at a time and go through "batch merge", then "force batch merge" for each page.

How can I do this most easily?

# Answer
> 5 votes
I ran into a similar problem today. My solution requires some tech chops, but was very effective:

* Install cv on the server if you haven't already.
* Create a text file named `forcemerge.php` on the server anywhere in your webroot with the following contents:

`<?php
eval(`cv php:boot`);
// Set the dedupe rule
$rgid = 13;
$return = CRM_Dedupe_Merger::batchMerge($rgid, NULL, 'aggressive', 1, 2, array(), FALSE);`

* Change the `13` above to the dedupe rule ID you want to use for deduping. You can also change the `NULL` to a group ID if you only want to dedupe a particular group.
* Set that file as executable and run it!

You should be able to see your progress a number of ways, by periodically doing one of the following:

* `select count(*) from civicrm_contact WHERE is_deleted = 0;` in a SQL client;
* Finding duplicates through the CiviCRM UI and then pressing "Refresh Duplicates" to see the number decrease.

# Answer
> 2 votes
Using the "process\_batch\_merge" Scheduled Job is an easy option. Plus, you can schedule the job to run at an interval or use it as a one-time solution.

https://docs.civicrm.org/user/ca/latest/initial-set-up/scheduled-jobs/#job\_process\_batch\_merge

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


# Question
Title: CiviCRM users and migration from Drupal to WordPress
I am working on migrating a CiviCRM database from Drupal to WordPress. Right now I'm working on a development site in WordPress so I at this stage I am trying to test everything out in preparation for the real migration down the road. I am using this guide: https://docs.civicrm.org/sysadmin/en/latest/misc/switching-cms/drupal-to-wordpress/

I have a couple of questions about this tip:

> When you set up WordPress, make sure you use the same Administrator account name as the Drupal Administrator account. Otherwise, you might encounter DB errors and/or Foreign Constraint issues due to the WordPress account not being associated with the CRM Accounts. If you have no choice, make sure you synchronize your accounts prior to trying to edit anything else.

In our WordPress installation we currently have four users with admin privileges. Does the above tip mean we just need to make sure we have an admin account in WordPress that matches they primary admin account in Drupal and that we should be logged in using that account when we install CiviCRM in WordPress or does it mean something more complicated?

Also, I am less familiar with Drupal: is there one primary admin in Drupal that is the admin name we need to match?

# Answer
> 1 votes
I've done WP-to-Drupal (and many other CMS migrations) with Civi, and I don't think that note is accurate.

I believe it should say, "Make sure the administrator account you're logged in to WP with at the time of migration has an email that matches an administrator account in Drupal."

There's a CiviCRM table `civicrm_uf_match`, which links CiviCRM contacts (in `civicrm_contact`) with the CMS users. When migrating, you should remove all entries except for the administrator user you're using in that moment.

With regard to installing CiviCRM on WordPress - it doesn't really matter, as soon as you complete the installation you'll import your current database.

Note that when a WP user visits CiviCRM for the first time, Civi will check the user's email against the existing contacts in Civi and link the account to a contact record. That's why clearing out `civicrm_uf_match` is a good choice, it will be regenerated as folks log in.

---
Tags: civicrm-home
---


# Question
Title: Contribution dashlet Network error / internal server 500 error / CRM_Report_Form::getRowCount() must be of the type int
My site currently at 5.39.1, error did not occur at 5.35.2 .

I'm getting an error loading the latest contribution / donor dashlets. The case and news dashlet loads without issues.

Results are showing up fine at contributions dashboard **wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fcontribute&reset=1**

I don't know why the getRowCount is null from the stacktrace below.

Please advise?

**CiviCRM error popup**:

```
Network Error
Unable to reach the server. Please refresh this page in your browser and try again.

```

**Traffic response**:

```
500 Internal Server Error
/wp-admin/admin.php?page=CiviCRM&q=civicrm/report/instance/13&reset=1&section=2&context=dashlet&rowCount=10&snippet=json

```

**Your Site is Experiencing a Technical Issue** \- automated email from Wordpress (i replaced the folder names as they are not relevant)

```
Error Details

An error of type E_ERROR was caused in line 535 of the file /<folder names>/public_html/wp-content/plugins/civicrm/civicrm/CRM/Report/Form.php.

Error message: Uncaught TypeError: Return value of CRM_Report_Form::getRowCount() must be of the type int, null returned in /<folder names>/public_html/wp-content/plugins/civicrm/civicrm/CRM/Report/Form.php:535

Stack trace:

#0 /<folder names>/public_html/wp-content/plugins/civicrm/civicrm/CRM/Report/Form.php(3611): CRM_Report_Form->getRowCount()

#1 /<folder names>/public_html/wp-content/plugins/civicrm/civicrm/CRM/Report/Form/Contribute/Detail.php(522): CRM_Report_Form->limit()

#2 /<folder names>/public_html/wp-content/plugins/civicrm/civicrm/CRM/Report/Form.php(3586): CRM_Report_Form_Contribute_Detail->buildQuery()

#3 /<folder names>/public_html/wp-content/plugins/civicrm/civicrm/CRM/Report/Form.php(930): CRM_Report_Form->postProcess()

#4 /<folder names>/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php(621): CRM_Report_Form->preProcess()

#5 /<folder names>/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Display.php(76): CRM_Core_Form->buildForm()

#6 /<folder names>/public_html/wp-co

```

# Answer
> 1 votes
With help from a friend, we guess it has something to do with default\_pager\_size.

$this-\>setRowCount(\Civi::settings()-\>get('default\_pager\_size'));

So i went to set the "Default Search Pager size" in "Settings - Search Preferences" to another value in an attempt to refresh the value and it worked. Dashlets are populating fine now.

---
Tags: contributions, dashlet
---


title: CiviCRM Integration wtih WhatsApp

text:
# Question
Title: CiviCRM Integration wtih WhatsApp
CiviCRM SMS integration is a powerful feature. However, with many people moving to use instant messaging services like WhatsApp, has there been any move to integrate CiviCRM with and instant messenger, in particular, WhatsApp? Our organization has recently moved its bulk SMS database over to WhatsApp, as 90% of our members use WhatsApp. Being a non-profit, we gain from not having to pay for sending bulk SMS's.

# Answer
This is an old topic but still a good one. It seems that it moved a bit in the messaging environment and that one can actually communicate through third-part services with Whatsapp:
> 2 votes

# Answer
They haven't been any to my knowledge, but assuming whatsapp as an api to post messages, it shouldn't be too complicated to implement.

If you are interested, you could write an extension and use the searchtask hook to add a "send via whatsapp" action http://wiki.civicrm.org/confluence/display/CRMDOC/hook\_civicrm\_searchTasks
> 3 votes

# Answer
Regarding whatsapp I have been looking into that recently and I discovered that WhatsApp doesn't offer an API. So it is not possible to send or receive messages to/from whatsapp in CiviCRM.

However it is possible to hack around this. You could create your own android app for sending whatsapp messages and then you run this app on your phone and this app talks to whats app on your phone. And CiviCRM talks to this app. This is how it might work however it is against the policy of whats app. So there is a risk that your whats app account might be blocked.
> 3 votes

# Answer
Looks like bulk SMS via WhatsApp is excluded from their Terms of Service and that doing so will result in disconnection.

Free messaging services are popular with spammers for obvious reasons, and WhatsApp will be doing their utmost to avoid their service being used in a way that doesn't suit their profile.

I predict that any bulk WhatsApp integration implemented can anticipate a game of "cat and mouse" with the WhatsApp developers. If pursuing that path, budget accordingly - paid SMS may not be so expensive after all.

If WhatsApp decide in future to allow promoted messages, they'll price it accordingly. The lack of bulk messaging in the platform (notwithstanding infrequent abuse attempts & hasty shutdown) is a feature to them.
> 1 votes

# Answer
Clickatell (for which there is already an sms integration with civicrm) also offers whatsapp support.

It would be great if the existing civicrm extension (https://github.com/veda-consulting/org.civicrm.sms.clickatell) could be extended for whatsapp support!
> 0 votes

---
Tags: civimail, sms
---


# Question
Title: What is the `cv` command to set default language?
Looking in the API V3, I can find the default language in Setting but not how to set it to `fr_FR`.

I've tried commands like `cv api Setting.create lcMessages="FR"` but they return nothing or errors.

Is that possible?

# Answer
> 2 votes
It should be

```
cv api Setting.create lcMessages="fr_FR"

```

Make sure you use the correct language code.

Note: Sometimes you need to clear CiviCRM cache to apply changes.

---
Tags: cv, default-settings
---


# Question
Title: Caldera form, civi case and custom fields integration
I've set up a caldera form which collects information and creates a Civicase.

I've managed to set up the form which is collecting information as a particular case type called 'Get involved'.

I've created a couple of custom fields to collect check box information:

'Governing\_council\_check' and 'Standing Committee'.

I've connected the custom fields to the form questions in the Custom Fields section of the form processors section.

When I come to export the case however, from my case dashboard, the fields are returned blank regardless of how the form was filled out.

I'm not sure what to try and would appreciate any advice or areas to check.

Here are the custom fields in caldera forms.

Here are the custom fields in civi custom data

And here is the case export returning those fields as blank/unanswered

# Answer
> 1 votes
Thank you for your help. There was an error with the data types which meant they weren't mapping properly - namely that 'checkbox' in form maps to 'drop down select' in civi if you want to allow more than one option selected.

---
Tags: custom-fields, civicase, caldera-forms
---


title: Custom Fields - Tab with table

text:
# Question
Title: Custom Fields - Tab with table
I defined some custom fields with multiple records. The records are not shown in the data-table. Open tab in new Window produces an error : DataTables warning: table id=records-4 - Invalid JSON response.

Environment : civicrm 5.47.1 on Wordpress

# Answer
Could you check in the browser console what is the JSON response? Sometimes there might be a space left out in one of your PHP or template files or print statements which causes a space added to JSON response or illegal output created
> 0 votes

---
Tags: contacts, custom-fields, datatables
---


title: Upgrade Error 5.35 to 5.47

text:
# Question
Title: Upgrade Error 5.35 to 5.47
```
$ManagedEntities_failed = Array
(
    [entity] => SearchDisplay
    [action] => create
    [params] => Array
        (
            [version] => 4
            [values] => Array
                (
                    [name] => AfAdmin_Submission_List_Display
                    [label] => Form Submissions Table
                    [saved_search_id.name] => AfAdmin_Submission_List
                    [type] => table
                    [actions] => 1
                    [acl_bypass] =>
                    [settings] => Array
                        (
                            [actions] => 1
                            [limit] => 50
                            [classes] => Array
                                (
                                    [0] => table
                                    [1] => table-striped
                                )
...
            [checkPermissions] =>
        )

    [result] => Array
        (
            [error_code] => not-found
            [entity] =>
            [action] =>
            [is_error] => 1
            [error_message] => API (SearchDisplay, create) does not exist (join the API team and implement it!)
        )

)

```

# Answer
> 1 votes
Looks like you do not have a Search kit extension installed which is required by the Form Builder extension.

Can you do the following?

1. Install Search Kit extension
2. Upgrade CiviCRM 5.47

HTH

Pradeep

---
Tags: upgrade
---


# Question
Title: Include a CiviCRM role into Drupal View (custom dashboard)
I want to create a custom Dashboard with Drupal Views to substitute the built-in CiviCRM dashboard (because CiviCase dashboard shows cases for invisible contacts ).

I want to set a contextual filter on this logged in user's ID (`CiviCRM Drupal match table: Drupal User ID`). Then, I want to create several Relationships to access all the Case IDs of the cases this user coordinates: The currently logged in user is the "Case Coordinator". In the "Relationships" section of Drupal Views, I include all of their Clients. Then I include all Case IDs on this Client.

The problem is: This includes **all** Cases on a Client, no matter if the Case Coordinator of that case is the logged in user, or not. In other words: A Case Coordinator can see all the cases of one client in my custom dashboard, as soon as he coordinates one case on that client. This is undesired behavior. Every case coordinator should only see the cases he actually manages. This also distorts the numbers.

Afaik, this behavior appears because the specific connection between Case Coordinator and Case ID is a **CiviCRM Role** instead of a **relationship** between entities. Only relationships can be included in a Drupal View. I can access the CiviCRM role as an array per API Call (`get Case`) though:

```
"contacts": [
                {
                    "contact_id": "76",
                    "sort_name": "client name",
                    "display_name": "client name",
                    "email": "client@email.org",
                    "phone": "0000",
                    "birth_date": "",
                    "role": "Client"
                },
                {
                    "contact_id": "49",
                    "display_name": "coordinator name",
                    "sort_name": "coordinator name",
                    "relationship_type_id": "9",
                    "role": "Case Coordinator is",
                    "email": "coordinator@email.org",
                    "phone": "",
                    "creator": "1",
                    "manager": "1"
                }
            ],

```

Does anybody know how I can access this CiviCRM Role in Drupal Views? Can I "convert" it into a relationship? Or can I code a custom relationship that contains an API Call to that CiviCRM Role (where I am able to access the fields included by Relationships in my code, at least the Case ID)?

I thought that maybe this could be a solution, but it turns out the accepted answer only does the same solution that I tried above, except that it starts from the other end of the relationship chain (Case ID -\> Client -\> Case Coordinator). The problem that this returns too many entries remains (here: returns **all** Case Coordinators of that Client for each Case ID, not only Case Coordinator of this specific Case ID).

I think it is an essential function that Case Coordinators can only view their "own" cases in a dashboard. That's why I wouldn't like to make any compromise here, if possible.

# Answer
> 4 votes
I'd start with a case relationships view.

Filter by relationship type, and case type.

Bring in the case details via a views relationship And bring in the two contacts (A and B, from the relationship) again from views relationships

And then apply the contextual/ drupal id filter to the B contact of the relationship

Then you get Case Details and Contact A (client) Details for any case the logged in user has the specific role in.

---
Tags: drupal-views, relationships, civicrm-entity, roles
---


# Question
Title: Is CiviCRM the best platform for a very small nonprofit for data management?
Good Day, I am working with a small nonprofit with the mission of capacity building at food pantries and creating more access to health care initiatives. We are expanding and want to be able to track data in order to monitor and evaluate our impact. I am investigating CivicCRM for this purpose and not sure if this is the best platform. Would anyone have any advice?

# Answer
> 0 votes
the phrase 'best platform' depends on context, what might be best for you is not always best for other organizations.

CiviCRM is a database used by non profits to track donors, members, cases (such as debt relief), volunteers, buddy projects, etc...

So to help us answering your question you can help us by explaining and expanding what organizations issues have lead to a search for a platform, what your needs are and what you think your future needs are.

It also helps if you explain what you organization is doing and why it is doing. I am not sure if stack exchange is the right place for this as there is no easy answer. Its answer can be found by having a conversation, exploring, and sharing knowledge (you from your organization, me from helping other organization using CiviCRM).

# Answer
> 0 votes
Hi Wade and welcome on SE, usually there's a kind of correlation in terms of complexity between the size of database and the kind of tools to manage it. Having 50 / 500 / 5000 / 50000 contacts involves different processes and interactions between the organization and its contacts.

Try to contact some agencies/developers/integrators close to you to have a meeting and discuss about your needs. I'm sure you'll get personalized informations, advises and maybe a quotation.

What I can say is that CiviCRM is tremendous when it's adapted to organization :-)

---
Tags: database
---


# Question
Title: How can I create a membership renewal link for organisations?
I'm creating a scheduled reminder email that is sent to members six weeks before their membership expires. I want the email to link to the membership page with the contact details of the organisation filled in.

I have managed to do this successfully for individuals by using the following link in the email:

```
[site.com]/civicrm/contribute/transact?reset=1&id=1&{contact.checksum}&cid={contact.contact_id}

```

However, this doesn't work for organisations. It only fills in the email address of the organisation but not the organisation's name, address and postcode.

I presume that this is something to do with the fact that the organisation membership form is filled out *on behalf of* the organisation.

Is there a way I can change this link to ensure that the organisation's full details are filled in when the user clicks on the link?

I am using CiviCRM 4.6.10 on Drupal 7.41.

# Answer
> 1 votes
I have a partial answer to this question. The link above works fine, but you have to ensure that the organisation's membership is inherited by staff.

To do this you need to edit the membership type and set 'Relationship Type' to 'Employer of' (**not** 'Employee of' which is what I had previously).

Once this is done a renewal reminder will be sent to the organisation's email address **and** the email address of the member of staff who subscribed on behalf of the organisation.

The link in the email that is sent to the member of staff works correctly. However, the link in the email sent to the organisation doesn't work unfortunately.

# Answer
> 2 votes
I got round this by creating a group for the non-primary memberships. I then set up a membership scheduled reminder and limited the emails to the group I created.

# Answer
> 2 votes
It seems to me like part of the problem with organization renewals, is that the page does not know that the individual already has an "onbehalf of" membership, so it does not display, for example, information about the membership expiration, and I'm not sure how the membership is updated afterwards (implicitly, it should update the existing membership).

My solution was to use the membership renewal link extension, which generates tokens with the checksum and membership ID (mid) in the URL.

However, for that to work, I had to apply this patch to CiviCRM core (pending review, as of CiviCRM 5.48).

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


# Question
Title: Migration from CiviCRM (Drupal 7) to Salesforce
I'm a Drupal engineer with plenty of migration experience, but I have never migrated data out of Civi. Before I start trying to reverse engineer the database from source, maybe someone can give me some pointers or provide an overview of where to start?

Which are the important tables?

Is there some mapping from ERD to database tables?

# Answer
> 3 votes
I would take a different approach to what your trying to do. If you want to extract data from CiviCRM you probably want to use something like the Data Processor extension and CSV out everything you need. Its very rare that you would try and built the entire extract from the database directly as you're probably going to have different destinations etc so would be much easier to use a tool to get what you need rather than trying to learn the ERD just for extraction.

We often write queries against the CiviCRM database but thats much more for data insights or data denormalisation. Its not our approach for extracting data.

Just my thoughts!

# Answer
> 2 votes
I don't think there is a real ERD or Object documentation. There is https://doc.symbiotic.coop/dev/civicrm/latest/schema/index.html but by itself doesn't tell you what is what.

You might want to use the built-in export feature to get a feel for the various entities: Search - Find XXX - then from the actions dropdown on the results page choose Export.

The main table is civicrm\_contact. Almost everything is connected to it in some way.

---
Tags: migration
---


# Question
Title: Template for changing text on membership confirmation
There's this text that shows on the membership confirmation page that says: "Select a Membership Level"

It looks odd since you're not selecting anything on this page, it's just the confirmation. It should say something like "Chosen Membership Level". However, I can't seem to find which template is creating that text so I can change it out.

# Answer
> 1 votes
You can probably use Word Replacement from the Adminstration menu (unless exactly the same text appears elsewhere in the sign up process).

# Answer
> 1 votes
Agree that word replacements is an option but to find it just do

`grep -r "Select a Membership Level" templates`

It shows up twice in templates/CRM/Contribute/Form/Contribution/MembershipBlock.tpl

Note that sometimes it is a radio since the block is used elsewhere.

---
Tags: drupal, civimember, custom-templates
---


title: Email List Management

text:
# Question
Title: Email List Management
We are working to find the best way to handle our contacts for our newsletter.

1. Is there any way to integrate Ninja Forms with CiviCRM so that they can send information with each other?
2. Does CiviCRM have a native email sign-up form that we can use that would also work?
3. What are the CiviCRM best practices for email list management, including sign-up forms? We are trying to find a way to have contacts added to Civi and the appropriate groups to receive our newsletter in an automated way if possible. If that's not possible, how are others handling this?

# Answer
> 2 votes
If you set your Groups to be 'public' then they can appear at a link like this

https://civicrm.org/civicrm/mailing/subscribe

You can also use a Profile with a Custom Field, and then build a Smart Group based on that field, and use that for your Mailing List

# Answer
> 1 votes
Welcome to SE! To answer your first question, Ninja forms are developing an integration with CiviCRM. They took over Caldera forms and are migrating it to Ninja forms and this is part of that process. Its not quite finished yet. See https://calderaforms.com/2021/12/2-important-announcements-for-caldera-forms

On the wider question there are quite a lot of ways of doing the sign-up for the newsletter and that depends on how you want to identify who gets it, but one simple way is a group and use a profile to allow people to join the group. I think this also allows unscribing from the group from a link in the email but I haven't tried this. Worth looking at the mailing documentation.

# Answer
> 1 votes
You're receiving many answers because there are *many* ways to handle newsletter signup, and the "correct" answer depends mainly on you.

* Do you have just one "newsletter" group? The Profiles documentation discusses using profiles for that purpose. Make sure to check out the double opt-in options available in **Administer » CiviMail » CiviMail Component Options**.
* You can also use Profiles with multiple groups by adding the "Groups" field and marking your public groups as such (per Pete's answer).
* Do you want to embed the signup page into another page? On WordPress you would need to use Caldera Forms, WPForms (some assembly required), or (soon) Ninja Forms.

These are just the simplest approaches. You might also use CiviRules, and you may also have to account for GDPR and/or CCPA. Rest assured that many organizations are using CiviCRM to manage their newsletters.

---
Tags: email, forms, best-practice, integration
---


# Question
Title: CiviCRM database restore fails on new server
We are attempting to move off an old machine and onto a new but restoration of CiviCRM constantly fails with the error:

Sorry, due to an error, we are unable to fulfill your request at the moment. You may want to contact your administrator or service provider with more details about what action you were performing when this occurred. DB Error: no such field

Here are the details

Old Machine: Drupal: 7.78 CiviCRM: 5.19 MySQL 5.5 PHP: 7.2

New Machine Drupal 7.89 CiviCRM: 5.47.1 MySQL: 8 PHP: 7.4

Moving Drupal was a breeze. No major issues. But Civi seems to require more intervention or skill that I do not yet possess.

I am dumping the old data using (where the Civi database is called civicrm)

mysqldump -u root -p --ignore-table=civicrm.civicrm\_domain --ignore-table=civicrm.civicrm\_acl\_cache --ignore-table=civicrm.civicrm\_acl\_contact\_cache --ignore-table=civicrm.civicrm\_group\_contact\_cache civicrm \> civi-sql-dump.sql

And ingesting the data using mysql -u root -p civicrm \< civi-sql-dump.sql

But this fails to work. I've followed the instructions at https://docs.civicrm.org/sysadmin/en/latest/misc/switch-servers/ but after a few tries, no success.

Is it possible to move between the two machine noted above? Would it just be faster to export data and re-import it and just re-setup Civi? I've check the log file /var/www/drupal/sites/default/files/civicrm/ConfigAndLog and it's a huge mess.

What are my options here? Thanks in advance for any tips or advice.

# Answer
It's been so long since I looked at that docs page - the numbering has got messed up I think and in any case it's a difficult read. First, do NOT use `--ignore-table` when moving an existing site with live data. It does say that in 7b but it's hard to see.

Then second, it stops at step 8 and then starts at 1 again, but it should really be continuing on. You need to do those other steps too.
> 1 votes

---
Tags: drupal, civicrm-home
---


# Question
Title: Are single timezone countries affected by security release 5.47.2 event date problem?
Reading this note it's not clear to me whether to go ahead with the 5.47.2 release. I have several clients using events, but all are in the UK which has a single timezone. I'm assuming the date problem won't affect UK users, but I'd like to check my assumption. Can anyone help?

# Answer
> 2 votes
Even for a single timezone site it depends on the timezone of the user running the CiviCRM upgrade and your CMS (if you use Drupal or Wordpress - and if you have regional settings configured in your CMS). On my live test site all my lunch and learns (past present and future) were displayed as 1pm UTC post 5.47 upgrade. That would be early breakfast for me. It was because the Drupal Regional setting was at its default UTC.

# Answer
> 1 votes
reading around the subject I think it depends more on if your UK customers are running events across the world. If they aren't, and the events are purely UK based, then I would not expect to see any issues and I don't think the upgrade is critical for events timezones.

This is just my thoughts from reading around, someone else may have a more background on it.

---
Tags: civievent, security
---


# Question
Title: WordPress group assignment from CiviCRM member signup not working
Edit: I was missing something basic. I was mapping role to role, not capability, and forgot to hit Save Settings on the main WordPress Member Sync plugin settings page.

Once I did that, and added the mappings *correctly*, it worked.

I must be missing something basic. Looked at similar questions and answers and went through the online docs, but have not found what I’m doing wrong / forgot to do. I’ve got a WordPress 5.9.2 / CiviCRM 5.43.2 set up with the Members and WordPress Member Sync plugins. WordPress has existing roles (call them A, B, C). CiviCRM has the same Membership Types defined.

I have a working (using dummy payment processor at least, this is in a sandbox environment) membership contribution page, which creates a new CiviCRM user, contribution, and WordPress user. But the WordPress user gets created with the default Subscriber role, and I want it to be the A/B/C role chosen at member signup on the contribution page.

I’ve defined the association rules in the member sync plugin, but I don’t understand how that maps the Membership Type A to the WordPress Role A. Is what I’m trying to do even possible? And what am I missing to make it work?

Thanks for any pointers / assistance here.

Michael

# Answer
> 1 votes
Be sure to save your settings in the member sync plugin to Roles before trying to add Roles association mappings.

---
Tags: wordpress, contribution-page, roles
---


# Question
Title: How can I search contacts removed from a specific group?
I need to find contacts that have been removed from a specific group to add them back again in. I can find using custom search if they're *not* in a group, but not if they *were* in a specific group.

Is there a way to find them?

# Answer
> 5 votes
I authored Subscription History Report and it's a good choice, but these days I would use Search Kit (an extension which ships with CiviCRM - **Administer menu » System Settings » Extensions**.

From there, you can use this (change the domain name):

```
https://example.org/civicrm/admin/search#/create/Contact?params=%7B%22version%22:4,%22select%22:%5B%22id%22,%22display_name%22,%22Contact_GroupContact_Group_01.title%22%5D,%22orderBy%22:%7B%7D,%22where%22:%5B%5B%22Contact_GroupContact_Group_01.title%22,%22%3D%22,%22Newsletter%20Subscribers%22%5D%5D,%22groupBy%22:%5B%5D,%22join%22:%5B%5B%22Group%20AS%20Contact_GroupContact_Group_01%22,%22INNER%22,%22GroupContact%22,%5B%22id%22,%22%3D%22,%22Contact_GroupContact_Group_01.contact_id%22%5D,%5B%22Contact_GroupContact_Group_01.status:name%22,%22%3D%22,%22%5C%22Removed%5C%22%22%5D%5D%5D,%22having%22:%5B%5D%7D

```

If you'd prefer to do it yourself, here's a screenshot of the same search:

# Answer
> 3 votes
How about using Subscription History Report

---
Tags: custom-search, searchkit
---


title: How do I access Mosaico in my CiviCRM?

text:
# Question
Title: How do I access Mosaico in my CiviCRM?
Here is the issue. When I select the "Mosaico Templates” in the drop down menu in Civi under “Mailings” I get a “Safari can’t open the page” message. Any ideas around how to fix this? I get the same message when I select "New Mailing" in the Civi drop down as well. What is wrong? Trevor

# Answer
> 1 votes
Welcome Flyingbow! I encourage you to edit your question to provide the version of CiviCRM and Mosaico so people can help you better. It would also help to see the URL that generates the "Safari can't open the page" error.

There's a known issue with Mosaico 2.9 that is fixed in CiviCRM 5.47.2. So if you're using Mosaico 2.9, make sure you're on the very latest CiviCRM.

You might also get an error if this is a copy of an existing CiviCRM site (perhaps a test site) and you're using a template generated on another site. If so, the Mosaico README has a note to run this in MySQL:

```
UPDATE civicrm_mosaico_template SET metadata = replace(metadata, 'old-domain.org', 'new-domain.org');

```

If this is a "migrated" site and MySQL isn't an option, please comment on my answer and we can use a workaround.

---
Tags: mosaico
---


# Question
Title: Attempt to re-install Civi 5.46 results in 'CiviCRM Installed'
I am attempting to re-install Civi 5.46 on Drupal 7.89. I have wiped out and re-created the database, deleted Civi files, caches etc. The civicrm.settings.php file has been wiped out. I can find no trace of CiviCRM yet when I attempt to re-install it, when I click on 'You must configure CiviCRM' I get a screen that says CiviCRM is installed.

What am I missing?

CiviCRM 5.4.6 Drupal 7.89 MySQL 8 PHP 7.4

CiviCRM is definitely not installed. Why does it think that it is?

# Answer
> 3 votes
It looks like a couple of tables were hiding in the drupal database. Some easy MySQL and the problem was fixed

```
use drupal;
drop table civicrm_group_roles_rules;
drop table civicrm_member_roles_rules;
flush privileges;

```

---
Tags: installation, civicrm-home
---


title: Problem setting up OAuth for Google

text:
# Question
Title: Problem setting up OAuth for Google
I am getting an error while trying to set up OAuth. when I click on **Add (Auth Code)** button on *CiviCRM \>\> Admin \>\> OAuth2 Client Administration* I get the following error from Google:

`Error 400: redirect_uri_mismatch You can't sign in to this app because it doesn't comply with Google's OAuth 2.0 policy. If you're the app developer, register the redirect URI in the Google Cloud Console. Learn more The content in this section has been provided by the app developer. This content has not been reviewed or verified by Google. If you’re the app developer, make sure that these request details comply with Google policies. redirect_uri: https://***.org/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Foauth-client%2Freturn`

On the CiviCRM side, it's all set up as follows:

And on the Google Cloud Platform I've set up the following.

I have the OAuth extension installed and activated, and I'm running CiviCRM 7.47.2 on WordPress. Advice welcome!

# Answer
> 3 votes
Yeah the Add Authcode button is a little confusing and meant for other types of Oauth implementations. The way to do it is not from that screen but from the Mail Accounts screen. Go add your google account there.

See https://docs.civicrm.org/sysadmin/en/latest/setup/civimail/#adding-an-incoming-email-account-for-processing-bounces-andor-email-to-activities and click on the "Adding an account via OAuth" that looks like a section header but is really a hidden set of instructions.

---
Tags: civimail, oauth
---


# Question
Title: CiviCRM on WordPress crashes when I select ZMK as default currency
A clean install of CiviCRM on Wordpress crashes whenever I select ZMK as default currency. My installation details are:

> WordPress version 5.9.2
> Current theme: Twenty Twenty-Two (version 1.1) Current plugin: CiviCRM (version 5.47.2)
> PHP version 8.0.16

=============
An error of type E_ERROR was caused in line 19 of the file /home/monkey/public_html/civic/wp-content/plugins/civicrm/civicrm/vendor/brick/money/src/Exception/UnknownCurrencyException.php. Error message: Uncaught Brick\Money\Exception\UnknownCurrencyException: Unknown currency code: ZMK in /home/monkey/public_html/civic/wp-content/plugins/civicrm/civicrm/vendor/brick/money/src/Exception/UnknownCurrencyException.php:19
Stack trace:
#0 /home/monkey/public_html/civic/wp-content/plugins/civicrm/civicrm/vendor/brick/money/src/ISOCurrencyProvider.php(120): Brick\Money\Exception\UnknownCurrencyException::unknownCurrency()
#1 /home/monkey/public_html/civic/wp-content/plugins/civicrm/civicrm/vendor/brick/money/src/Currency.php(91): Brick\Money\ISOCurrencyProvider->getCurrency()
#2 /home/monkey/public_html/civic/wp-content/plugins/civicrm/civicrm/vendor/brick/money/src/Money.php(189): Brick\Money\Currency::of()
#3 /home/monkey/public_html/civic/wp-content/plugins/civicrm/civicrm/CRM/Utils/Money.php(209): Brick\Money\Money::of()
#4 /home/monkey/public_html/civic/wp-content/plugins/civicrm/civicrm/CRM/Utils/Money.php(88): CRM_Utils_Money::formatUSLocaleNumericRounded()
#5 /home/monkey/public_html/civic/wp-content/plugins/civicrm/civicrm/CRM/Core/Resources/Common.php(219): CRM_Utils_Money::format()
#6 /home/monkey/public_html/civic/wp-content/plugins/civicrm/civicrm/CRM/Core/Resources/Common.php(128): CRM_Core_Resources_Common::coreResourceList()
#7 /home/monkey/public_html/civic/wp-content/uploads/civicrm/templates_c/CachedCiviContainer.a02b080bd0d8fdf7053d123f1aecc5d2.php(807): CRM_Core_Resources_Common::createFullBundle()
#8 /home/monkey/public_html/civic/wp-content/plugins/civicrm/civicrm/vendor/symfony/dependency-injection/Container.php(306): CachedCiviContainer->getBundle_CoreResourcesService()
#9 /home/monkey/public_html/civic/wp-content/plugins/civicrm/civicrm/Civi.php(174): Symfony\Component\DependencyInjection\Container->get()
#10 /home/monkey/public_html/civic/wp-content/plugins/civicrm/civicrm/CRM/Core/Resources.php(214): Civi::service()
#11 /home/monkey/public_html/civic/wp-content/plugins/civicrm/civicrm/CRM/Core/Resources.php(382): CRM_Core_Resources->addBundle()
#12 /home/monkey/public_html/civic/wp-content/plugins/civicrm/civicrm.php(1087): CRM_Core_Resources->addCoreResources()
#13 /home/monkey/public_html/civic/wp-content/plugins/civicrm/includes/civicrm.admin.php(761): CiviCRM_For_WordPress->add_core_resources()
#14 /home/monkey/public_html/civic/wp-includes/class-wp-hook.php(307): CiviCRM_For_WordPress_Admin->admin_page_load()
#15 /home/monkey/public_html/civic/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters()
#16 /home/monkey/public_html/civic/wp-includes/plugin.php(474): WP_Hook->do_action()
#17 /home/monkey/public_html/civic/wp-admin/admin.php(237): do_action()
#18 {main}
  thrown```

After this, I can't do anything else under the CiviCRM menu.

# Answer
> 0 votes
Yes this seems like a bug. Can you make a ticket at https://lab.civicrm.org/dev/financial/-/issues/new ?

Looks like it changed to ZMW in 2013.

If you have access to the mysql database you can get your site back by doing `UPDATE civicrm_setting SET value='s:3:"USD";' WHERE name='defaultCurrency';`

---
Tags: wordpress, currency
---


# Question
Title: Rebuild Smart Group Cache - One of parameters (value: 28,55,57) is not of the type Int
Running 5.47.1 at the moment on latest version of WP. I've been getting this error repeatedly:

Finished execution of Rebuild Smart Group Cache with result: Failure, Error message: One of parameters (value: 28,55,57) is not of the type Int

What do I do to resolve this issue? Asking as the most recent answers are from 2015.

# Answer
> 3 votes
The issue is that one of your smart groups is broken.

The low-tech approach to figuring out which is to disable half of your smart groups, run the "Rebuild Smart Group Cache" scheduled job (**Administer menu » System Settings » Scheduled Jobs**) and check its job log to see if the problem group is in the disabled half or enabled half. Keep eliminating half the groups at a time until you've found the troublesome group.

Review its criteria (in **Contacts menu » Manage Groups**) and see if there's an obvious alternative (or if you even need the group anymore).

If you have more tech skills, you can download my smart group profiling script. This requires you have cv installed. Its original purpose is to find smart groups that are slow, but if you have a failure like the one you describe, it will fail on that group, and the last group listed is the one that failed.

---
Tags: smartgroups, cache
---


title: fetch_bounces Cron Problem

text:
# Question
Title: fetch_bounces Cron Problem
I have been having errors with the authentication for CiviMail's fetch\_bounces. The error on the log for fetch\_bounces reads:

```
Fetch Bounces
Entity: Job Action: fetch_bounces
Summary
Finished execution of Fetch Bounces with result: Failure, Error message: Could not connect to MailStore for return@****.org@imap.gmail.comError message: An error occured while sending or receiving mail. Could not selec (...)
Details

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

Full message:
Finished execution of Fetch Bounces with result: Failure, Error message: Could not connect to MailStore for return@****.org@imap.gmail.com

Error message:

An error occured while sending or receiving mail. Could not select mailbox 'CiviCRM': A0002 NO [NONEXISTENT] Unknown Mailbox: CiviCRM (Failure).

```

When I look at the setup for the CiviCRM return account, I have the following setup:

When I click 'Save and Test' I again get the message

`An error occured while sending or receiving mail. Could not select mailbox 'CiviCRM': A0002 NO [NONEXISTENT] Unknown Mailbox: CiviCRM (Failure). (See log for more details.)`

However, the email does exist on G-Suite and I am using an app password for a 2FA Google Account. This was working ok in the past. Any advice?

I am using the most revent version of CiviCRM (5.47.2) on Wordpress.

# Answer
Ah, I've figured it out. In the option for *Source*, it was set to *CiviCRM* but I'd not set up the corresponding email box in Gmail. When I deleted it, it worked.
> 0 votes

---
Tags: wordpress, civimail, g-suite, bounce-processing
---


title: Event times not stored in UTC in 5.47

text:
# Question
Title: Event times not stored in UTC in 5.47
Just upgraded to CiviCRM 5.47 on WordPress, and some of my plugins are now displaying the incorrect time because they don't know how to interpret the start\_date or end\_date of an event.

My server has its timezone set to America/Edmonton, as do my events.

After upgrading, I tried creating two events: one this week (Mountain Standard Time, -0700), and one next week (Mountain Daylight Time, -0600). Both events have their time zone set to America/Edmonton.

I created both for 9am-12pm.

Looking at the database, both have their times recorded as 16:00 to 19:00.

1600 UTC is 0900 MST (America/Edmonton) which is correct for the event this week.

For the event next week, 1600 UTC converts to 1000 MDT (America/Edmonton) (and my plugin therefore displays the event time as 10am). This of course is not what I expect: I expect the event to start at 9am, and CiviCRM does display 9am everywhere. It's just my plugin that is failing to understand the start time, because it's not stored as UTC.

I've implemented a workaround at the moment to just ignore the timezone and subtract 7 hours to display the time, but this of course is a hack.

I would expect all times to be stored in UTC.

`mysql> select title,id,start_date,end_date,event_tz from civicrm_event \g
+-------------+-----+---------------------+---------------------+------------------+
| title | id | start_date | end_date | event_tz |
+-------------+-----+---------------------+---------------------+------------------+
| test1 | 295 | 2022-03-10 16:00:00 | 2022-03-10 19:00:00 | America/Edmonton |
| test2 | 296 | 2022-03-16 16:00:00 | 2022-03-16 19:00:00 | America/Edmonton |
+-------------+-----+---------------------+---------------------+------------------+`

My plugin display is wrong:

But CiviCRM display is correct:

# Answer
> 3 votes
See the analysis by haystack on https://lab.civicrm.org/dev/core/-/issues/2122.

Basically 5.47 is reading and writing event dates using the daylight savings offset at the time of reading/writing, not the offset applicable to the event date. That's badly broken since you would need to know the offset applicable when the event time was saved to work out the intended time!

For anyone using Events who hasn't upgraded yet to 5.47 - don't do it until this is fixed.

If you have, then follow progress on the issue above. You might want to revert to a backup. At the very least, make sure you keep hold of a backup from before you upgraded. Some hosting only keeps backups for a few days.

# Answer
> 0 votes
FYI, my website admins have updated the times of events in summer time to use the Europe/London timezone and the correct time.

I have a Wordpress extension that displays forthcoming events. These times were now out by an hour for events in summer time. I've updated the extension smarty template to fix this up for now. I'll double-check as-and-when CiviCRM issues a fix. The list of events is obtained elsewhere using civicrm\_api3('Event'...

Without this change, I think the dates were being converted into summer time twice. Previously my code did {$event.event\_start\_date|crmDate}

The event has 'event\_tz', 'event\_start\_date' and 'event\_end\_date' string fields. The dates are already in the local timezone ie in summer time. This code converts the dates back to UTC. They are then converted back into local (server) timezone as part of DateTime format(). Writing this up now, I realise that I probably could have done it differently...

```
{php}
$event = $this->get_template_vars('event');
$tz = $event['event_tz'];
$tz = new DateTimeZone($tz);
$utc = new DateTimeZone('UTC');
$startdate = new DateTime($event['event_start_date'], $tz);
$startdate->setTimezone($utc);
$this->assign('startdate',$startdate->format('jS F Y, g:iA'));
$enddate = new DateTime($event['event_end_date'], $tz);
$enddate->setTimezone($utc);
$this->assign('enddate',$enddate->format('jS F Y, g:iA'));
$this->assign('enddateshort',$enddate->format('g:iA'));
{/php}

```

---
Tags: civievent, timezone
---


# Question
Title: Why are some tabs missing from one of our Administrator's home page?
We have three Administrators. I'm one. Another administrator has the "Contributions" and "Events" tabs missing from her CiviCRM home page. Mine aren't, and neither is the other Administrator's. Why is that? Don't all Administrators see the same set of tabs?

# Answer
Update based on feedback:

Go to Administer - Users and Permissions - Permissions, and then about half-way down there's a link to the CMS access control which assigns permissions based on their role in the CMS (drupal/wordpress/etc). If these admins have different "roles" assigned in the CMS then they might see different things because they might have different permissions.

So you either need to update their roles on their user record in the CMS, or update which permissions are assigned to various roles.

---

---

If by home page you mean the dashboard (url `/civicrm/dashboard?reset=1`) and by tabs you mean dashlets, then every user sees something different because they have control over which dashlets appear.

If that's not what you meant, can you clarify which page is the "home page" and what "tabs" means?
> 1 votes

---
Tags: civicrm-home, menu
---


title: Date format for token {domain.now}

text:
# Question
Title: Date format for token {domain.now}
How can I configure the token {domain.now} to use the short date format? Currently it uses the "Complete Date and Time" format.

The site is running 5.45.3. on Drupal 9

# Answer
You could do something like this in the template:

`{capture assign=notime}{domain.now}{/capture}{$notime|date_format:'%m/%d/%Y'}`

Also there is this in recent versions but it may be iffy how well it works depending on the exact civi version:

`{domain.now|crmDate:'shortdate'}`

https://docs.civicrm.org/user/en/latest/common-workflows/tokens-and-mail-merge/#date
> 2 votes

---
Tags: tokens, date-preferences
---


# Question
Title: How to hide these 'deprecated' type messages when implementing PHP 7.4?
Having just upgraded a site to 5.47.2 and noting that PHP 7.4 is recommended I rashly took this seriously :) and ended up with 3 messages that splat themselves over the top of the majority of screensm making it unusable. Here's one: *"Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/dcmadmin/public\_html/sites/default/files/civicrm/ext/org.civicrm.flexmailer/flexmailer.civix.php on line 246"* So I'm back with PHP 7.3 as I couldn't find a way to suppress them. So can these messages be supressed? This is a Drupal 7 install with error logging set to 'None' which obviously doesn't include these.

# Answer
> 2 votes
For the flexmailer one, note that flexmailer is now a core extension so you shouldn't have that copy in sites/default/files since it's outdated.

For other warnings, it's pretty much just extensions that have that curly braces warning now. Any extension that hasn't updated its `*.civix.php` files yet.

---
Tags: drupal, php
---


# Question
Title: Upgrade to 5.47.2 now cron does nothing - how to fix?
Since upgrading to 5.47.2 cron has stopped doing anything. It's running as I have redirected the output to a file (which shows zero bytes) but nothing is happening. The cron user is authorised and the password OK - nothing was changed from previous release. In the course of upgrading I had to restore the database back to 5.45.3 after a failed upgrade - then I upgraded to 5.46.3 and then to 5.47.2 successfully. All seems OK except for cron. This is a Drupal 7 install, I changed to PHP 7.4 but reverted back to 7.3 after this problem (it didn't help). There are no messages in ConfigandLog. I'm out of ideas on what to do! Suggestions please.

# Answer
> 3 votes
The cause was a folder permissions problem. The folders at the 2 bottom levels of www.mysite.com/sites/all/modules/civicrm/bin/cron.php had got changed from 755 to 777. When I tried to execute the cron command on another working install as a logged in user (but without the username etc) I got a nice message saying I needed to put the user name etc. On the problem install I got 'cannot find the page', which led me down that track. I spent ages on this... This may have been caused by the upgrade to 5.47.2 crashing. Now back at 5.46.3

---
Tags: cron
---


# Question
Title: Is it possible to pre-fill a checkbox field using URL parameters? Fields are from CiviCRM
Looking for tips on how to pre-select a checkbox (or anything besides a textfield) in a webform using URL parameters. We have pre-filled a textfield with URL params. We also found this article that explains how to pre-select a field created in webforms. The problem we have is pre-selecting a field brought in from CiviCRM. Does anyone have any tips or know of other nodes that will enable this? We are running Drupal 7 and CiviCRM 5.41.2.

# Answer
> 2 votes
I have done this via two different methods.

One method is using a 'pass-thru' field. I create a webform only text field (it does not need to exist in CiviCRM custom data) and have it pre-fill based on a URL parameter. Then I use conditionals to say if that text field equals "X" set this CiviCRM select field to "X". (I hide this field on the front-side of the form.)

The other method is jquery. You can load a javascript file through a custom module (or I've also used the Javascript injector https://www.drupal.org/project/js\_injector). In jQuery you can get the URL parameters and then in some if statements adjust the value/property of fields on the form. Happy to expound if you need.

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


# Question
Title: Upgrade to 5.47.2 failed on several systems - workaround?
In attempting to upgrade several 5.45.3 system to 5.47.2 I ran into this problem with 3 of them - "\[info\] $CRM\_Queue\_Page\_AJAX\_runNext\_error = Exception: "API error: DB Error: constraint violation on ReportTemplate.create" This happened when the upgrade had almost completed, but left the database still thinking it was at 5.45.3. This looks like a problem with the 'Extended Reports' extension - should this be reported as a bug against the extension? The upgrade from 5.45.3 to 5.46.3 works OK, by the way, this problem occurs on the upgrade to 5.47.2. So, I updated systems to 5.46.3 and am avoiding 5.47.2! - Trace back attached.

# Answer
> 1 votes
This is not fully resolved still: https://lab.civicrm.org/dev/core/-/issues/3101

# Answer
> 1 votes
You will need to upgrade civicrm extended report to 5.13 prior to CiviCRM 5.47.2

---
Tags: extension, upgrade
---


title: CRM.loadForm into div without popup

text:
# Question
Title: CRM.loadForm into div without popup
I create page where I want dynamically load different page into div. Jquery function CRM.loadForm dynamically load form, but it loads into popup. It is possible not create popup, but put the content to the div? Something like in contact summary page, when you click on relationship tab and it loads into *mainTabContainer* div.

# Answer
In the end I use popup to copy content from it and put it to div and it works just fine. All javascript in form works.

I use 2s timeout, because `.on('crmFormSuccess', function(event, data) {});` did not work.

This will works if you not open it from another popup.

```
CRM.loadForm(CRM.url('civicrm/contact/add', 'action=update&cid='+id));
$('.ui-dialog').hide();
$('.ui-widget-overlay').remove();
setTimeout(function(){
  $('#test').html($('.ui-dialog-content').get());
  $('.ui-dialog').remove();
  $('body').removeClass('ui-dialog-open');
}, 2000);

```
> 1 votes

# Answer
I don't think loadForm is really what you want. You could just do it with regular jquery .get, e.g.

```
CRM.$.get('/civicrm/contribute/add?reset=1&action=add&context=standalone&snippet=4',
  null,
  function(response) {
    CRM.$('#mything').html(response);
  }
);

```

Note the snippet=4 to strip off the CMS surrounding content, but you may need to add styling since it won't get the css.

Or if you have control over whether the target is a div or not and the url is for the same site, you can just use iframe instead:

`<iframe src="/civicrm/contribute/add?reset=1&action=add&context=standalone&snippet=4"></iframe>`
> 0 votes

---
Tags: ajax, jquery, summaryfields, custom
---


title: Disable active events

text:
# Question
Title: Disable active events
Is there a setting/scheduled job/something else, that can automatically set events in the state of inactive automatically after the event has ended?

# Answer
> 1 votes
I am not if there is any but it's an easy one to develop via an extension or MySQL event or running MySQL via cron job.

**MySQL query via cron job**

using https://stackoverflow.com/questions/21196613/run-a-mysql-query-as-a-cron-job

```
UPDATE civicrm_event
SET is_active = 0
WHERE end_date IS NOT NULL
  AND  DATE_ADD(end_date, INTERVAL 2 DAY) < now()
  AND is_active = 1;

```

**Mysql Event that will run everyday at 1:00 am**

```
CREATE EVENT disable_civicrm_events
  ON SCHEDULE
    EVERY 1 DAY
    STARTS (TIMESTAMP(CURRENT_DATE) + INTERVAL 1 DAY + INTERVAL 1 HOUR)
  DO
  UPDATE civicrm_event
  SET is_active = 0
  WHERE end_date IS NOT NULL
    AND  DATE_ADD(end_date, INTERVAL 2 DAY) < now()
    AND is_active = 1;

```

---
Tags: civievent
---


# Question
Title: How to add an action in the contacts list action drop down menu
I need to add actions in the contacts list drop down action menu. As an example, if I make a contacts search I got a contacts list result. Then on the contacts list I can choose an action like export contacts. I would like to add actions on thé action list. Does someone has an idea on how to do that ?

# Answer
> 1 votes
Welcome Bruno. You would have to modify the action menu functionnality. Have you looked into the dev documentation?

---
Tags: contacts, custom, actions
---


# Question
Title: SPF records to send from different domains
We have Civi installed on the main non profit domain (example.com) but have a project related to the non profit on its own domain (projectexample.com).

We need to be able to send emails to the sponsors from the sponsors@projectexample.com domain and all the sponsors are in the Civi install at example.com.

I know with Mailchimp, I can set it up to grab the CNAME records and apply it to the DNS records of the domain I want to validate but how would one go about it in this scenario?

Thank you.

# Answer
I feel like you're mistaking different settings. In CiviCRM you can declare different accounts. Go to Administer \> CiviMail \> Mail settings & From email Address. There you set what you need to use different accounts to send e-mailings. Have you looked at the documentation?

The SPF setting has to be done where you manage your domains, on the registrar or server side, not in CiviCRM. And once again you can edit your DNS zone to add txt or SPF entries for the domains you want to use. Also add DKIM keys to improve delivrability.
> 2 votes

---
Tags: email, domain
---


# Question
Title: Where is the 'Event Time Zone' option field in 5.47.2?
I'm setting an Event and am asked to set the Time zone in order to save/update the event but I don't see this field on 5.47.2.

Should this be activated somewhere?

# Answer
> 1 votes
Deactivate Advanced evvent extension and it works (even though the Time Zone in CiviEvent still need to fixed)

---
Tags: civievent
---


# Question
Title: How to find available CiviCRM release versions?
we're working on a bash script to upgrade CiviCRM and we try to get a list of the available released version.

Use case is if you're running on for example 5.45 and want to upgrade then you could see all available options and maybe choose the version you want

# Answer
Sourceforge has an rss feed you can parse: https://sourceforge.net/projects/civicrm/rss?path=/civicrm-stable

Or you can use the local cache which is updated by the version\_check job and parse that: sites/default/files/civicrm/upload/version-msgs-cache.json
> 1 votes

---
Tags: system-status
---


# Question
Title: What is the meaning of Intended, bounce and delivered mailing report stats
On a mailing report, there are, amongst other data:

* Intended recipients
* Successful deliveries
* Bounces

I know (from scouring the code) that Intended recipients is a count from the mailing *recipients* table for that mailing; this is populated, I believe, at the point you submit the mailing to the queue (even if you schedule it for a future date). I think that means that the figure has already ruled out exclusions, including unsubscribes, emails-on-hold, bulk-opt-out.

I know that the mailer process takes the recipients table and creates a parent 'job' with a set of child 'jobs' indicating batches (first 2000, next 2000...). I know that when the child jobs are created, the Mailing Event Queue table is populated from the Mailing Recipients table.

I know that Successful deliveries is a count of mailing event queue items *minus* any of those records that have a bounce record.

From this I would assume that

*Intended = Successful + Bounces*

However this is not what I'm seeing. I'm regularly seeing reports where the Intended figure is a significant amount *higher* than *successful + bounces* and I need to understand why.

Can anyone explain this?

(I've seen this at least on 5.36.1 and 5.47.2, with FlexMailer installed and using Mosaico for the mailings.)

# Answer
> I know that when the child jobs are created, the Mailing Event Queue table is populated from the Mailing Recipients table.

This is true, but those emails from the mailing recipients table are filtered *again* when the child job populates the email tasks queue to rule out any

* that are on hold
* that no longer exist
* that belong to a deceased or deleted contact
* that belong to a contact with `do_not_email` or `is_opt_out`

So if you submit/schedule your mailing, *then* an email gets put on hold, *then* the mailer gets around to sending it, you can get a gap between intended (the original mailing recipients count) and delivered+bounces.
> 4 votes

---
Tags: civimail, reports, mailing
---


title: Advanced Search - no results

text:
# Question
Title: Advanced Search - no results
I have an intermittent issue with advanced search giving no results. This seems to only happen in Chrome and looks like it might be something to do with PHP sessions.

On submitting the form, there are no results and the form has the focus on the Complete OR Partial Name field - now empty. No error is logged. It is as though the name field isn't being submitted somehow and the user is being urged to put in a correct name.

If the user logs out and logs in again, it works OK.

Is anybody else getting a similar issue? It's very hard to reproduce, but my user is getting it a lot!

# Answer
Welcome to SE!

You might get that if you have a mix of http / https and www / no www

Use your browser's developer tools to check what URL's are being accessed under the Network tab. (Ctrl-Shift-E on firefox)

They should all be the same - eg https://example.org/... not a mix of http://example.org, https://www.example.org, http://www.example.org

If that is the problem, check your settings in civicrm.settings.php and at `Administer > System Settings > Resource URLs` and make sure they are consistent.
> 2 votes

---
Tags: advanced-search
---


# Question
Title: Error when editing any contact: Malformed token parameters ({contact.first_name|truncate:1:"":true})
Running latest CiviCRM on latest Drupal 7, php 7.4.28. This error was reported by one of our volunteers when trying to edit a contact yesterday. Logged in as Admin I can replicate on any contact, and have confirmed that our testing version of the site does exactly the same. Having checked recent records added to the contacts table, disabled all extensions, cleared caches, etc. the problem does not go away. I've rolled back to 5.47.0, which was the previous version we were running and it is on there too, so I'm not sure when this issue first appeared (small organisation and it is very possible that this was simply not noticed by our volunteers - I don't regularly use the system myself except to change settings.)

I'm also seeing the same message in an alert from time to time, for example I just got it when loading the Dashboard.

Enabling debugging and backtrace, then looking in the logs, I get this, but am unclear what it is telling me or where to go next \[server path redacted\]. Any suggestions?

```
Mar 24 07:14:13  [error]
$Fatal Error Details = array:3 [
  "message" => "Malformed token parameters ({contact.first_name|truncate:1:"":true})"
  "code" => null
  "exception" => CRM_Core_Exception {#1862
    -errorData: array:1 [
      "error_code" => 0
    ]
    #cause: null
    -_trace: null
    #message: "Malformed token parameters ({contact.first_name|truncate:1:"":true})"
    #code: 0
    #file: "/[myserverpath]/public/sites/all/modules/civicrm/Civi/Token/TokenProcessor.php"
    #line: 444
    trace: {
      /[myserverpath]/public/sites/all/modules/civicrm/Civi/Token/TokenProcessor.php:444 {
        › if ($unmatched) {
        ›   throw new \CRM_Core_Exception('Malformed token parameters (' . $m[0] . ')');
        › }
      }
      Civi\Token\TokenProcessor->Civi\Token\{closure}() {}
      /[myserverpath]/public/sites/all/modules/civicrm/Civi/Token/TokenProcessor.php:431 { …}
      /[myserverpath]/public/sites/all/modules/civicrm/Civi/Token/TokenProcessor.php:156 { …}
      /[myserverpath]/public/sites/all/modules/civicrm/CRM/Core/TokenSmarty.php:56 { …}
      /[myserverpath]/public/sites/all/modules/civicrm/CRM/Contact/Form/Edit/CommunicationPreferences.php:95 { …}
      /[myserverpath]/public/sites/all/modules/civicrm/CRM/Contact/Form/Contact.php:804 { …}
      /[myserverpath]/public/sites/all/modules/civicrm/CRM/Core/Form.php:689 { …}
      /[myserverpath]/public/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Display.php:76 { …}
      /[myserverpath]/public/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php:203 { …}
      /[myserverpath]/public/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php:103 { …}
      /[myserverpath]/public/sites/all/modules/civicrm/CRM/Core/Controller.php:355 { …}
      /[myserverpath]/public/sites/all/modules/civicrm/CRM/Utils/Wrapper.php:98 { …}
      /[myserverpath]/public/sites/all/modules/civicrm/CRM/Core/Invoke.php:292 { …}
      /[myserverpath]/public/sites/all/modules/civicrm/CRM/Core/Invoke.php:69 { …}
      /[myserverpath]/public/sites/all/modules/civicrm/CRM/Core/Invoke.php:36 { …}
      /[myserverpath]/public/sites/all/modules/civicrm/drupal/civicrm.module:471 { …}
      /[myserverpath]/public/includes/menu.inc:527 { …}
      /[myserverpath]/public/index.php:21 { …}
    }
  }
]

Mar 24 07:14:13  [debug] $backTrace = #0 /[myserverpath]/public/sites/all/modules/civicrm/CRM/Core/Error.php(433): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 /[myserverpath]/public/sites/all/modules/civicrm/CRM/Core/Invoke.php(39): CRM_Core_Error::handleUnhandledException(Object(CRM_Core_Exception))
#2 /[myserverpath]/public/sites/all/modules/civicrm/drupal/civicrm.module(471): CRM_Core_Invoke::invoke((Array:3))
#3 /[myserverpath]/public/includes/menu.inc(527): civicrm_invoke("contact", "add")
#4 /[myserverpath]/public/index.php(21): menu_execute_active_handler()
#5 {main}

```

Thanks, Steve

# Answer
> 2 votes
Have you customised the greetings or addressee formats? Go to `Administer > Communications > Email Greeting Formats, Postal Greeting Formats, Addressee Formats` and compare your values with those on https://dmaster.demo.civicrm.org

---
Tags: contacts, error, tokens
---


title: Search Kit with an auto toggle

text:
# Question
Title: Search Kit with an auto toggle
Wondering how to get the auto search toggle enabled for search kit Is it a option by default or does it take customization...

here are two images side by side two diff systems both run on drupal 7

# Answer
> 3 votes
I think you're looking for the Auto-run setting that appears on the search *display* edit page (not the compose search page).

Add a display to that search (using the Add dropdown at the left) and then you should see something like this:

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