title: How to export to excel from a dashlet?

text:
# Question
Title: How to export to excel from a dashlet?
I can't remember how to add the `excel` button at the bottom of a dashlet. I'm pretty sure I had it previously but I can't find any more how and where to set it back.

I have the CiviCRM Export to Excel extension installed and now I need to export directly from the dashlet.

Any advices?

# Answer
> 0 votes
Searchkit + Form builder do perfectly the job! An upgrade to 5.44 was the solution (previous recent version are also enough)

---
Tags: export
---


# Question
Title: What are the steps for changing the amount for a recurring payment when using PayPal - Website Payments Standard
Scenario is a membership / subscription. The amount to be charged has increased.

Does this require the amount to be updated just at the PayPal end, or are changes also needed at the civi end to ensure that the new amount is specified in the receipt which civi sends out

# Answer
Depends upon the recurring contribution, if the recurring contribution has a single line item for membership type than its not needed if not then yes its needed so that the line items for subsequent payment are added correctly.

How I did for Paypal Standard is

1. Updated the subscription amount at Paypal.
2. Using sql queries

2.1 Update the total\_amount in contribution recur table

**For Single Line item:**

```
1. Find for the template contribution:
     SELECT id FROM civicrm_contribution
     WHERE contribution_recur_id = 123
       AND is_template = 1
     ORDER BY id DESC
2. If found update the total_amount field for the contribution and line item line total
    UPDATE civicrm_contribution
    SET total_amount = 100
    WHERE id = 122;

    UPDATE civicrm_line_item
    SET line_total = 100
    WHERE contribution_id = 122;
3. Incase there isn't the template contribution create one using the last contribution for recurring contribution and also line item.
     SELECT id FROM civicrm_contribution
     WHERE contribution_recur_id = 123
     ORDER BY id DESC;

```

**For Multiple Line item:**

```
1. Find for the template contribution:
     SELECT id FROM civicrm_contribution
     WHERE contribution_recur_id = 123
       AND is_template = 1
     ORDER BY id DESC
2. If found update the total_amount field for the contribution and line item line total
    UPDATE civicrm_contribution
    SET total_amount = 120
    WHERE id = 122;

    UPDATE civicrm_line_item
    SET line_total = 100
    WHERE contribution_id = 122 AND membership_type_id = 2;

3. Incase there isn't the template contribution create one using the last contribution for recurring contribution and also line item.
     SELECT id FROM civicrm_contribution
     WHERE contribution_recur_id = 123
     ORDER BY id DESC;

```

HTH

Pradeep
> 3 votes

---
Tags: civimember, recurring-contributions, paypal
---


# Question
Title: How to send Participant-Specific information via CiviMail
We are running a hybrid event where some participants are virtual via Zoom and some participants attend in person. We need to send out reminders and the zoom link to virtual attendees, and also want to send reminders to "in person" attendees along with the link so that if they change their minds, they can attend virtually.

So we want to send different messages to the two kind of attendees, and in addition, we would like to include other participant-specific information, such as the number of raffle tickets purchased, etc.

I know that I can do an advanced search for virtual attendees of the specific event, and send a civimail message to that group, then do another advanced search for in person attendees of the same event, and then send a different civimail message to that group. But if I wanted to extend to telling them the number of raffle tickets they have purchased, I would be dealing with more and more searches and unique mail messages to each of many groups.

Is it possible to include participant specific info in a CiviMail message? Sort of a mail-merge capability as with current contact-specific tokens, but extended to participant-specific tokens.

Thanks in advance for any pointers! Rick

# Answer
There is a rather new extension called "Custom Event Communivation" that allows you to sent emails to participants both automated (e.g. on registration / status change) or based on a participant search. Have a look at the documentation: https://docs.civicrm.org/eventmessages/en/latest/

Also have a look at the event invitation Extension in case you want to invite participants to an event: https://docs.civicrm.org/eventinvitation/en/latest/
> 2 votes

# Answer
OK, so this is a partial answer to my question - don't use CiviMail but use Scheduled Reminders instead - a reminder about a specific event will have access to tokens such as event summary, event start date, etc. so I can send a reminder to those signed up for an event and use tokens to specify the event. The reminder can be reused for other events without changing the body.

That's the gist, here's more detail

So there aren't tokens specific to events available from CiviMail (except that the Fuzion Tokens Extension has lots of things that are close - such as a list of upcoming events, etc., and it adds tons of tokens about latest membership start, end, fee level, etc. THANK YOU EILEEN, and @petednz for pointing me there) However Scheduled Reminders DOES have information about events. It doesn't necessarily have tokens for some custom fields that we use during registration, but it does have lots of information as detailed below. So whereas I can't seem to get a list of attendees for an event and then email their particular registration, I CAN cause an email to automatically be sent to attendees of a particular event via scheduled reminders.

https://docs.civicrm.org/user/en/latest/email/scheduled-reminders/#tokens-available-to-scheduled-reminders *Tokens available to scheduled reminders¶ In addition to the standard tokens that are available in CiviMail, messages sent via scheduled reminders can also contain tokens representing information about events, activities, contributions and memberships that the scheduled reminder pertains to. This allows you to use one scheduled reminder template for various events, membership, contribution or activity types. In event messages, tokens such as event location will be replaced with the specific location of the event. In membership messages, you have access to each individuals expiry date, and so on. Membership and event ID tokens are also available and can be used to create links to specific pages (such as the membership renewal page). Note that you also have access to the checksum token which allows you to authenticate people to specific pages without them needing to log in, and show forms with details already filled in.*
> 1 votes

---
Tags: civievent, civimail, custom-fields, tokens
---


# Question
Title: How can I enable self-serve sign in / check in to an Event?
I'm using Civi 5.31 on Drupal 7.

I want to enable self-serve check-in / sign in for an Event. Attendees should be able to click a link (and/or scan a QR code) to either RSVP for the Event, and receive a Status of Attended, or, update a previous RSVP with a Status of Registered to Attended.

Only attendees physically present at the meeting, or participating via Zoom, Jitsi etc will be given the link/shown the QR code to scan.

There is an *existing* self-service capability for participants to Cancel or Transfer a registration, and to set time limits for a 'window' within which to cancel or transfer. Self-serve check in / sign in could work similarly.

I know there are various ways for 'staff' or a meeting organizer to do this for all attendees, but I want to avoid the manual tedium of updating multiple attendees from Registered to Attended by allowing self-serve check-in/sign-ins.

Thanks!

# Answer
I had the same process in place before started using civi - zoom integration. The process looked like this:

1. Create webform to update participant (an existing contact) with checksum.
2. Use google qr to generate the QR code with token so that by scanning the qr code takes you to https://your.org/node/2?cid1={contact.contact\_id}&{contact.checksum}
3. They can click submit to mark themselves as attended (or you can even make this form auto submit with simple javascript).
4. You can set that thank you page after submission is actually a redirect to the online conference link or wherever.

It's a bit hacky, but it works.
> 2 votes

# Answer
There are a couple of newish extensions that aim to help with the process described by you. First of all you may want to have a look at the Event-Checkin Extension which allows to generate QR-Checkin-Codes.

The Event Invitation extension allows you to invite contacts via a unique link / QR-Code incl. a RSVP-Form.

Finally the extension Custom Event Communication allows you to automate/support sending out event emails with the relevant links, QR codes and other information.
> 2 votes

---
Tags: civievent
---


# Question
Title: Message template token no longer available / relevant
After updating to Civi version 5.45.1 we have this notice:

You are using tokens that have been removed or deprecated.

Please review your contribution\_online\_receipt message template and remove references to the token `{$contributeMode}` as it has been replaced by `{no longer available / relevant}`

I have found the `$contributeMode` in the edited plaintext version of contribution\_online\_receipt:

```
{if $contributeMode eq 'direct' AND !$is_pay_later AND $amount GT 0}

===========================================================
{ts}Credit Card Information{/ts}.....

```

Is there a different token to replace this with, or is it safe to remove?

I was not able to find much documentation on this issue

# Answer
Yes its safe to remove, so replace

```
{if $contributeMode eq 'direct' AND !$is_pay_later AND $amount GT 0}

```

with

```
{!$is_pay_later AND $amount GT 0}

```
> 6 votes

---
Tags: wordpress, tokens, system-workflow-messages
---


# Question
Title: How to extend session -- public facing profile times out too soon
We have a profile that we invite our members to complete on a bi-annual basis. We don't want them to have to log in to our site (powered by Joomla), so instead we send them an email using the hash and contactID tokens, like this:

https://example.org/index.php?option=com\_civicrm&task=civicrm/contribute/transact&reset=1&id=10&cs=cfdd8cbc30fca3d30aea66796f4a3b29\_1643317391\_320&cid=4579

Joomla is set to have a session of 240 minutes and the server is set to a 3 hour session lifetime.

What we have encountered is that people click on the link to update their profile, they aren't logged in to the site, and some folks take a while to complete the form (at least, more than 30 minutes -- because they have to research some answers). When they submit the form, they are told that their session expired, the form reloads empty, they lose the information they entered.

Upon submitting the form at the 21 minute mark, I get the error:

> Your browser session has expired and we are unable to complete your form submission. We have returned you to the initial step so you can complete and resubmit the form. If you experience continued difficulties, please contact us for assistance.

Can anyone suggestion a solution to prevent the session timing out for non-logged in users while they are completing the profile form?

# Answer
Add this override into your civicrm.settings.php file and change the parameter as you wish:

```
// Extend the session cache timeout to 240 minutes
// the default is 20 minutes, but this seems to cause quickform cache issues.
$civicrm_setting['core']['secure_cache_timeout_minutes'] = 240;

```

You can also install the qfsessionwarning extension to warn users that their form session is about to expire.
> 4 votes

---
Tags: profile
---


# Question
Title: how do I install an extension in wordpress
I downloaded master .zip from the civi website, and it is in my download box. How do I get it to a folder in my website to put the zip into my program

# Answer
If you have CiviCRM installed on your WordPress installation as a plugin and you are inside CiviCRM trying to install a CiviCRM Extension. This is what I do to had an extension that is not automatically available with CiviCRM Extension manager. I go to my server manager CPanel and use the file manager to upload the extension zip file. I place the extension zip file in to the folder; public\_html/wp-content/plugins/files/civicrm/extensions. Extract the zip file and the new CiviCRM extension will become available to install within the CiviCRM Extension Manager.
> 2 votes

# Answer
The new wordpress directories is: public\_html\wp-content\plugins\civicrm\civicrm\ext Upload the zip files here and then extract them into the folder. you then have to go to the extension page and click refresh for them to show and to be able to install.
> 0 votes

---
Tags: wordpress, installation
---


# Question
Title: Out of memory and Civi errors relating to templates following upgrade from 5.35.2 to 5.45.1
Wordpress 5.8.3, shared server from SiteGround.

We decided to upgrade from CiviCRM 5.35.2 to 5.45.1 in the hope of resolving an issue preventing supporter registration on website. I'm now stuck on some issues from the upgrade which may not be related to underlying issue but must be resolved first. Seems to be about templates and tokens but I've tried most suggestions I've found on StackExchange. There are also log entries dating back some time about *\[warning\] The system has data from both old+new conventions. Please use civicrm.settings.php to set civicrm.files explicitly.*

There were a bunch of warnings on completing the update script about changes to system templates. Taken copies of the modified text and html versions of the following before reverting to default and clearing out the templates\_c folder Contributions - Receipt (on-line); Contributions - Receipt (off-line); Memberships - Signup and Renewal Receipts (off-line); Memberships - Receipt (on-line).

Civi admin opens OK and shortcode forms on web pages appear ok but the following actions bring errors:

1. Opening the **System Status** page gives yellow 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. call\_user\_func() expects parameter 1 to be a valid callback, class 'Closure' does not have a method 'onRegisterTokens'*
2. New Email from Contacts menu causes an out of memory error from Wordpress
3. Message Templates are listed OK, and System Workflow Messages all show just the edit option meaning all using default, but click edit on any of the System or User-driven templates brings out of memory error.

Tried turning on debug and using Directory Cleanup option &directoryCleanup=3 which seems to successfully flush out the templates\_c folder.

I've tried changing civicrm.settings.php override // Override the custom templates directory. $civicrm\_setting\['Directory Preferences'\]\['customTemplateDir'\] = '/home/customer/www/xxx.org.uk/public\_html/wp-content/uploads/civicrm/templates\_c/';

What else might I try? Thanks!

# Answer
As with any long established installation that has been through lots of updates, drilling down through the various symptoms lead down many alleys and dead ends. In the end it came down to a conflict with the Wordpress theme and the Gantry plugin it depended on. Rather than spending further time with providers support and patching, it was easier (!) to switch themes, and then reset and recreate the CiviCRM customised templates.

This doc was helpful in testing using fresh installs and staging copies https://docs.civicrm.org/sysadmin/en/latest/misc/switch-servers/ In particular:

* checking the paths in civicrm.settings.php,
* deleting content of /wp-content/plugins/files/civicrm/templates\_c/\*,
* checking paths (or deleting) /wp-content/plugins/files/civicrm/ConfigAndLog/Config.IDS.ini
> 1 votes

---
Tags: wordpress, upgrade, tokens, message-templates
---


# Question
Title: Can you do Radios & Other Amounts for Contributions using D9 Webform CiviCRM?
When total amount is added to a Webform CiviCRM it comes in default as type = CiviCRM Number. How do I make this into a Radios & Other Amounts field?

# Answer
From the Build tab:

* Edit the Element
* Change CiviCRM Number -\> CiviCRM Options
* Add some Options
* Save

That will give you Radio buttons - if you want to add an Other Amount option -\>

From the Build tab:

* Edit the Element
* Change CiviCRM Options -\> Radios other
* Save

To ensure your Other Amount appears underneath the Radios -\> add this -\> From the Settings tab -\> select CSS/JS copy this into the Javascript box -\>

```
jQuery('.js-webform-radios-other-input').insertAfter(jQuery('#edit-civicrm-1-contribution-1-contribution-total-amount-radios'));

```

Save

End result:
> 4 votes

---
Tags: webform-civicrm
---


# Question
Title: SEPA Mandate not visible on Contact anymore
I have recurring sepa mandates on contacts (Members) but I can't see them while looking at the contacts. The mandates are working and I can create the XML Export for the bank. From the contact I can select the 'create SEPA mandate' Action but i can't see existing mandates. I think the problem started after updating civicrm.

# Answer
Welcome to Stack Exchnage Hans-Christian.

The latest version of CiviCRM contains changes regarding the display of custom tabs in the contact view that also affect CiviSEPA. You should be able to fix the described issue by upgrading to the latest CiviSEPA version (1.5): https://github.com/Project60/org.project60.sepa/releases
> 1 votes

# Answer
we're having the same issue even with 1.5 on CiviCRM 5.44 (see this issue)
> 0 votes

---
Tags: permissions, roles
---


# Question
Title: EntityBatch with no ID error when removing items from Accounting Batches
I have an error when working with Accounting Batches. It's kind of hard to pin down - the front end gives the default / standard / very helpful. What I did was:

* add a new accounting Batch (Contributions \> Accounting Batches \> New Batch)
* Assign a contribution to the batch
* try to remove the contribution from the batch

at this point I get:

> No response from the server. Check your internet connection and try reloading the page.

message, but ConfigAndLog does give a bit more, i.e.:

```
$Fatal Error Details = array:3 [
  "message" => "Cannot delete EntityBatch with no id."
  "code" => null
  "exception" => CRM_Core_Exception {#2039
    -errorData: array:1 [
      "error_code" => 0
    ]
    #cause: null
    -_trace: null
    #message: "Cannot delete EntityBatch with no id."
    #code: 0
    #file: "/var/www/html/drupal7/sites/all/modules/civicrm/CRM/Core/DAO.php"
    #line: 958
    trace: {
      /var/www/html/drupal7/sites/all/modules/civicrm/CRM/Core/DAO.php:958 {
        › if (empty($record['id'])) {
        ›   throw new CRM_Core_Exception("Cannot delete {$entityName} with no id.");
        › }
      }
      /var/www/html/drupal7/sites/all/modules/civicrm/CRM/Batch/BAO/EntityBatch.php:39 { …}
      /var/www/html/drupal7/sites/all/modules/civicrm/CRM/Financial/Page/AJAX.php:207 { …}
      /var/www/html/drupal7/sites/all/modules/civicrm/CRM/Utils/REST.php:266 { …}
      /var/www/html/drupal7/sites/all/modules/civicrm/CRM/Utils/REST.php:550 { …}
      /var/www/html/drupal7/sites/all/modules/civicrm/CRM/Core/Invoke.php:279 { …}
      /var/www/html/drupal7/sites/all/modules/civicrm/CRM/Core/Invoke.php:69 { …}
      /var/www/html/drupal7/sites/all/modules/civicrm/CRM/Core/Invoke.php:36 { …}
      /var/www/html/drupal7/sites/all/modules/civicrm/drupal/civicrm.module:458 { …}
      /var/www/html/drupal7/includes/menu.inc:527 { …}
      /var/www/html/drupal7/index.php:21 { …}
    }
  }
]

Jan 21 15:24:29  [debug] $backTrace = #0 /var/www/html/drupal7/sites/all/modules/civicrm/CRM/Core/Error.php(433): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 /var/www/html/drupal7/sites/all/modules/civicrm/CRM/Core/Invoke.php(39): CRM_Core_Error::handleUnhandledException(Object(CRM_Core_Exception))
#2 /var/www/html/drupal7/sites/all/modules/civicrm/drupal/civicrm.module(458): CRM_Core_Invoke::invoke((Array:3))
#3 /var/www/html/drupal7/includes/menu.inc(527): civicrm_invoke("ajax", "rest")
#4 /var/www/html/drupal7/index.php(21): menu_execute_active_handler()
#5 {main}

```

I'm at a bit of a loss where to go with this - could anyone give any pointers?

I've just realised that this is also happening on a local buildkit drupal-clean. is this a bug?

This is on CiviCRM 5.41.1

Thanks in Advance

# Answer
Looks like a regression from commit#99f7626

Could you try below patch?

```
diff --git a/CRM/Financial/Page/AJAX.php b/CRM/Financial/Page/AJAX.php
index ac2a002c4c..a314f5e736 100644
--- a/CRM/Financial/Page/AJAX.php
+++ b/CRM/Financial/Page/AJAX.php
@@ -170,13 +170,24 @@ class CRM_Financial_Page_AJAX {
         switch ($op) {
           case 'assign':
           case 'remove':
-            if ($op == 'remove' || $op == 'assign') {
-              $params = [
-                'entity_id' => $recordID,
-                'entity_table' => 'civicrm_financial_trxn',
-                'batch_id' => $entityID,
-              ];
+            $params = [
+              'entity_id' => $recordID,
+              'entity_table' => 'civicrm_financial_trxn',
+              'batch_id' => $entityID,
+            ];
+
+            if ($op == 'remove') {
+              try {
+                $id = civicrm_api3('EntityBatch', 'getvalue', $params + [
+                  'return' => 'id',
+                ]);
+                $params = ['id' => $id];
+              }
+              catch (Exception $e) {
+                $errorMessage = $e->getMessage();
+              }
             }
+
             break;

           case 'close':
@@ -214,9 +225,9 @@ class CRM_Financial_Page_AJAX {
               'status_id' => $redirectStatus,
             ];
           }
-          if ($errorMessage ?? FALSE) {
-            $response = ['status' => $errorMessage];
-          }
+        }
+        if ($errorMessage ?? FALSE) {
+          $response = ['status' => $errorMessage];
         }
       }
     }

```
> 2 votes

---
Tags: batches
---


# Question
Title: How to get email summary report via civiCRM API?
I am trying to get summary of email reports via civiCRM API. Unfortunately I am not able to find exact entities to get those data. Currently I am getting `Mailing`, `MailingRecipients` and `Contact` entities. With these entities the only thing I am getting is `Intended Recipients` for the report below by counting the email recipients per email\_id.

I have checked `Activity`, `Job` and `Event` entities too to get the information I need but they was not clear enough to collect information about deliveries, opens, click-throughs, bounces etc...

Could you please help about how to get this report via API? Which entities I need to use and which fields to get the related data?

Thank you

Hazal

# Answer
```
$result = civicrm_api3('Mailing', 'stats', [
  'mailing_id' => 10,
]);

```
> 4 votes

---
Tags: email
---


# Question
Title: Why is this CiviCRM with wordpress so slow to import data?
I'm testing CiviCRM on a home, not-web-linked, machine. Hence I haven't set up a way to get admin-directed emails. Importing less than 20,000 records with less than 40 mostly-custom fields each has taken more than an hour. I'm importing from a db within the folder hosting this installation, using import contacts via SQL. I've successfully imported ~5,000 records, and with extreme patience, about 20,000 more. Goal: 2.7x million records. I expanded upload size and memory limits in wordpress using .htaccess and php.ini. I've tried multiple times to import data - only insignificant test portions work. Huge civicrm-tmp files get created, but nothing resolves unless it's tiny. I have to delete the civicrm-tmp file through phpmyadmin and restart apache2 to get the website to show up again after aborting import. LAMP stack Ubuntu 20.04 LTS Apache Mariadb PHP 7.4.3 Wordpress 5.9 CiviCRM 5.45.1 "All extensions are up-to-date:

```
CKEditor4: Version 5.45.1
Contribution cancel actions: Version 5.45.1
Custom search framework: Version 5.45.1
Event Cart: Version 5.45.1
Financial ACLs: Version 5.45.1
FlexMailer: Version 5.45.1
Form Builder: Version 5.45.1
Form Code Editor: Version 5.45.1
Form Core: Version 5.45.1
reCAPTCHA: Version 5.45.1
Search Kit: Version 5.45.1
Sequential credit notes: Version 5.45.1
Theme: Greenwich: Version 5.45.1 "

```

edit: processor type: Intel® Pentium(R) CPU G850 @ 2.90GHz × 2 250 Gb HD, 7.7 Gb RAM, graphics: Intel® HD Graphics 2000 (SNB GT1)

Edit 2022Feb6 I should have noted that the records are being chosen from a table with 4.7 million rows.

# Answer
> 1 votes
Seems slower than I'd expect, you'll want to figure out where your bottleneck(s) is(are).

Most of machine resource use is likely in Disk I/O from mysql (to create the new records, especially with the custom fields). You could use a standard resource monitoring program to confirm that. If that's the case, getting yourself SSD disks is likely your best way to speed things up. You might be getting short on memory for mysql as well (though importing contacts isn't a hugely memory intensive process and caches are almost counter productive), depending on what else is using up memory on your machine.

I do see that you've got a couple of extensions that might be generating unnecessary work for your machine (profile and member sync) - those extensions might be kicking in for each contact created in order to see if they need to do something. You could try disabling them (and any other ones you can) and see if that makes a difference.

> "Huge civicrm-tmp files get created, but nothing resolves unless it's tiny"

Not sure how to interpret this, that does suggest something is not optimal.

On a different note, and not what you're asking, but in your position, I'd be tempted to try it on a different machine, perhaps some kind of large-instance db that you could use on a temporary basis to do the import, which is a specialty task that uses different resources from actually running a civicrm db in production. The 40 custom fields is a bit of a red flag for both architecture and performance. 2.7 million records with 40 custom fields is a bit of a mismatch with a home machine.

---
Tags: import
---


# Question
Title: New membership price set not being used for manual (back-office) renewals
Our organization recently updated membership prices for the first time in a while and the first time since going to CiviCRM. We updated and renamed the price set and attached it to our online joining and renewals page. It works fine there. New joiners get the new prices and renewals are getting the new prices.

However, when we went to process some offline renewals, the pre-filled renewal price in the 'Renew Membership' pop-up window is showing the old prices. In fact, experimenting by selecting a different membership level confirms that it is drawing on the old price set.

We are completely unable to determine where this form is getting its prices from. The old price set still exists on the system, but it does not appear to be taking it from the old price set since we experimented by changing some values in that with no change in the pop-up renewal form.

We are flummoxed. Can anyone point us to where to look to get this sorted out? Thanks.

Also, should be be concerned that the auto-renew option will pick up the old prices as well?

We are on 5.35.2

# Answer
You should check that you have changed the prices on the Membership Types themselves as they have a 'minimum amount' field which is what will apply as default, ie in situations where a Price Set is not overriding them
> 0 votes

---
Tags: civicontribute, civimember
---


# Question
Title: CiviBanking: CSV importer not reading the config as expected
Unfortunately, even after several attempts, we have not managed to configure the CiviBanking plugin so that the csv file can be imported. We use a file from "Deutsche Skatbank" but the importer is not reading our configuration as expected.

**Previous procedure**

At first, we followed the examples from Project60. But no matter what we do, we always get the message `No valid booking date detected. Not imported!` for all rows.

Since we did not find any detailed documentation on the individual parameters, we looked directly at the code and tried to understand what was happening. According to our understanding, the `skip` specification should skip a number of lines during import, so that the code that gives the above mentioned error is not called for these lines at all. However, since the message appears for all lines and does not change even when the `skip` parameter is changed, we assume that there is a profound problem in the interpretation of the file.

**Technical data**

We have read the encoding of the file and set it to `iso-8859-1`. The line breaks in the file are set to `CRLF, LF`. But even if we write the contents of the file into a new one, with uniform line breaks and different coding, the error remains the same.

We are currently using CiviCRM 5.36.xx on Drupal with, among others, CiviBanking and CiviSEPA.

We saw a related StackExchange post but it seems like that was a different issue.

**The csv file**

```
"VR-Bank Altenburger Land eG / Deutsche Skatbank"

"Umsatzanzeige"

"BLZ:";"12345678";;"Datum:";"12.02.2021"
"Konto:";"1234567";;"Uhrzeit:";"15:48:21"
"Abfrage von:";"Anne Anne";;"Kontoinhaber:";"Otto Otto"

"Zeitraum:";;"von:";"05.02.2021";"bis:";
"Betrag in EUR:";;"von:";" ";"bis:";" "
"Sortiert nach:";"Buchungstag";"absteigend"

"Buchungstag";"Valuta";"Auftraggeber/Zahlungsempfänger";"Empfänger/Zahlungspflichtiger";"Konto-Nr.";"IBAN";"BLZ";"BIC";"Vorgang/Verwendungszweck";"Kundenreferenz";"Währung";"Umsatz";" "
"09.02.2021";"09.02.2021";"Otto Otto";"Berta Berta";;"DE12345678901234567890";;"GENODEXXXXX";"Blabla";;"EUR";"1,00";"H"
"08.02.2021";"08.02.2021";"Otto Otto";"Chris Chris";;"DE12345678901234567890";;"GENODEXXXXX";"Blabla";;"EUR";"1,00";"H"
"05.02.2021";"05.02.2021";"Otto Otto";"Dora Dora";;"DE12345678901234567890";;"GENODEXXXXX";"Blabla";;"EUR";"1,00";"H"
"05.02.2021";"05.02.2021";"Otto Otto";"Emil Emil";;"DE12345678901234567890";;"GENODEXXXXX";"Blabla";;"EUR";"1,00";"H"

"05.02.2021";;;;;;;;;"Anfangssaldo";"EUR";"100,00";"H"
"09.02.2021";;;;;;;;;"Endsaldo";"EUR";"104,00";"H"

```

**Configuration JSON**

Some fields are not yet configured, this is simply because we did not get that far, as there were already these problems at the beginning.

```
{
  "plugin_type_name": "import",
  "plugin_class_name": "importer_csv",
  "name": "CSV Kontoauszug",
  "description": "Importiert CSV Kontoauszüge",
  "weight": "1000",
  "config": {
    "delimiter": ";",
    "encoding": "iso-8859-1",
    "skip": 11,
    "header": 13,
    "title": "Test",
    "defaults": [],
    "rules": [
      {
        "from": "Buchungstag",
        "to": "booking_date",
        "type": "strtotime:d.m.Y"
      },
      {
        "from": "Valuta",
        "to": "value_date",
        "type": "strtotime:d.m.Y"
      },
      {
        "from": "Auftraggeber/Zahlungsempfänger",
        "to": "name",
        "type": "set"
      }
    ]
  },
  "state": []
}

```

It would be really great if someone could help us with the appropriate plugin configuration or tips on the error message.

# Answer
> 2 votes
I faced the same problem and double-checked date settings in Civi. All well.

My solution was to delete the "head" and "footer" rows from the csv file, marked yellow in this screenshot:

The result is a clean csv spreadsheet with 1 row for header and a rows for every transaction. This file was imported as expected to CiviBanking.

# Answer
> 3 votes
I encountered the same problem with very similar data and searched for the mistake longer then I would like to admit.

To my big disappointment it was not caused by a wrong configuration per se, but by stupid copy-and-paste without thinking. Into the config-part on the web interface you should only copy the config-part of the json and not the 'name,description,weight,...'-part , i.e

```
{
 "delimiter": ";",
 "encoding": "iso-8859-1",
 "skip": 11,
 "header": 13,
 "title": "Test",
 "defaults": [],
 "rules": [
   {
     "from": "Buchungstag",
     "to": "booking_date",
     "type": "strtotime:d.m.Y"
   },
   {
     "from": "Valuta",
     "to": "value_date",
     "type": "strtotime:d.m.Y"
   },
   {
     "from": "Auftraggeber/Zahlungsempfänger",
     "to": "name",
     "type": "set"
   }
 ]
}

```

I also found out that the 'skip' parameter denotes numbers of line to skip which is less important than the 'header' parameter which denotes the line number of the header in the csv. Setting the right 'header' and not setting the 'skip' parameter still worked for my case as civiBanking did not find the right information in those lines and skiped them automatically.

Hope that helped. This is my first entry on any StackOverflow site.

---
Tags: drupal, csv, civibanking
---


title: CiviMobile Only Shows Events

text:
# Question
Title: CiviMobile Only Shows Events
I set up a test domain to try CiviMobile. I got it to work but it only shows the test event I set up. Drupal 9.1.9 / CiviCRM 5.37.2 / CiviMobileAPI 5.6.1 / PHP 7.4.14 / Android 8.0.0

I have administrative rights. When I logout of CiviMobile it presents the login screen. When I login it spins a bit then stays on the login screen, showing my username and password and above it, it says You are connected to https://xxx.dreamhosters.com. If I mess up the password it gives me an error message. I touch "Back" on the login screen and it says 'There are no events'. If I touch \<-- Back at the top of the screen, I get the 'Change server' message. If I say OK, it shows the Civi URL and a Connect button. Touch that and it shows the test event I set up, but there's no other menu items along the bottom of the screen. I can't see any of the contacts in the database. I installed the CiviCalendar Extension too, but it doesn't show up. The CiviMobile Checklist looks good, except it says the **Rest url and the Rest Path are not correct. What's that?** Please advise...thanks!

**UPDATE**: I found rest.php, but it was in .../ffv.dreamhosters.com/vendor/civicrm/civicrm-core/extern. Then I realized Civi Directories & Resource URLs had different \[civicrm.root\] directories, so I posted Resource URLs Screen has the wrong \[civicrm.root\] Then I moved my Extensions directory to the preferred location: .../sites/default/files/civicrm/ Reinstalled CiviMobile, Updated Paths, emptied the Civi cache and my browser cache. But it's still complaining that the Rest Path is wrong, so I copied the Extern directory to where CiviMobile wants it to be .../libraries/civicrm/core/ but it's still not happy...Please Help!

# Answer
I'm having the same problem with a fresh install of Drupal 9.

I've managed to get rid of the "REST url path incorrect" message at /civicrm/civimobile/checklist in a very hacky way, but still when I use the app on my phone the only thing that is visible is Events.

Here is how I got REST working:

1. Added "RewriteCond %{REQUEST\_URI} !/libraries/civicrm/core/extern/rest.php$" to .htaccess in web root (note this gets overwritten when you use "composer require").
2. created web/libraries/civicrm/core/civicrm.config.php file by copying it from an older installation, as this file is missing in a fresh D9 + Civi install.
3. copied the directory vendor/civicrm/civicrm-core/extern to web/libraries/civicrm/core.
4. Edited civicrm.config.php and added the following at line 86: $confdir = '../../../sites/default';
> 1 votes

# Answer
Please make sure **permission settings** are correct:
https://civimobile.org/permissions/
In order to **view the calendar**, they should be
CiviCRM: access CiviCRM backend and API
CiviCRM: view my contact
CiviEvent: access CiviEvent
CiviEvent: view event info

**View contacts:**
CiviCRM: access CiviCRM backend and API
CiviCRM: view my contact
CiviCRM: view all contacts

---

Please also check the calendar settings in **Administration/CiviMobile/CiviMobile Calendar Settings**:

Did you check "Synchronize with CiviCalendar"?

---

Did you **clear the cache** afterwards?
> 0 votes

---
Tags: drupal, civimobile
---


# Question
Title: Can CiviCRM be used to record student attandance?
A school thinks CiviCRM can be used for keeping their pupil's details including their attendance for each semester. Later that attendance would be used for a report. I am not able to figure out how the attendance part can be achieved!

Did you ever implemented a similar feature, if so, please share how you have acheived it. Or if have an idea, please feel free to share. Thanks

# Answer
> 3 votes
We have done this. The approach was as follows

* use Activities with custom fields including 'week commencing', Term, etc
* one field for each day (or half day) of the week with the options for attendance (eg justified absence, unjustified absence, present, etc)
* each week an Admin selects 'all current students' and create an Attendance activity for the next week
* each Teacher is 'related' to the class which is 'related' to the student and we use 'permissioned relationships' to restrict each teacher to only seeing 'their' students
* attendance is recorded via a custom report which allows the 'attendance' to be edited in bulk for 'their' students (that customisation is available in our Extended Reports extension I believe)
* each Teacher can therefore access only their students and run down the list marking as Present/Absent etc
* we then use Drupal Views to build reports and do eg Monthly calculations to give the percentage attendance

---
Tags: custom-fields, custom-reports
---


# Question
Title: Afform and Contact Layout Editor for contact summary
We have been using Form Builder a lot lately to build reports for our teams. We recently saw that Form Builder integrates with Contact Layout Editor. If I use Form Builder to create a form with basic contact info and add it to Contact Summary, will it show the information from those fields or will it just be added to the Contact Summary page to collect data for those fields?

Essentially, we are looking for a good way to simplify the view on the Contact Summary page. We aren't sure if we will should that with Contact Layout Editor alone or if we need to also be using Afform/Form Builder.

# Answer
> 2 votes
We found a solution that works for our needs. I created a List Display from SearchKit. Using Form Builder, I was able to use that List Display and create a new tab on the contact page. This gave us a new tab with only the information we wanted to to be available in a quick glance. SearchKit allowed us to set what could be edited in-place from that view.

---
Tags: contact-layout-editor, contact-summary-editor, formbuilder
---


# Question
Title: Cannot Load Civi - Unknown column in civicrm_cache Select
After making configuration changes to the Parameter Group for both the database and cluster of my Amazon Aurora database I can no longer access CiviCRM. I get the following error: Error code 19, "DB Error: no such field". It has this for debug info:

`SELECT path, data, UNIX_TIMESTAMP(expired_date) AS expires FROM civicrm_cache WHERE group_name = "2c60b3a2e8a19ac496e9716cc54d45a8" [nativecode=1054 ** Unknown column '2c60b3a2e8a19ac496e9716cc54d45a8' in 'where clause']`

Before I made the changes to my server the entire Drupal site was only loading the install page with issues with the cache. I believe this was because the max\_allowed\_packets was not large enough. I have now set the max\_allowed\_packets to the highest size using *Parameter Groups.*

Drupal cannot bootstrap and *cv flush* will not work either because it appears to be attempting to bootstrap Drupal. I have truncated the civicrm\_cache table. Before I did that there was a group\_name value of *2c60b3a2e8a19ac496e9716cc54d45a8* in the table.

I have Drupal 9.3.3. We have been running 9.3.3 for about a week before we have had problems. We have CiviCRM 5.45.2. We have been running this for about a week as well.

I am not sure what to do to get CiviCRM to correct this query so that I can bootstrap everything.

Thanks,

Josh

# Answer
> 1 votes
When you made your config changes did you turn on ANSI or ANSI\_QUOTES in your sql\_mode?

It prevents using `"` as a string quoting character which is not a standard string quoting character in sql, and so will break civi since civi does nonstandard things.

---
Tags: database, core
---


# Question
Title: Table 'fthdc_civi.civicrm_translation' doesn't exist
This is likely an error that has come about as part of an upgrade. We went from CiviCRM 5.31 to 5.44 about a month ago and everything appeared to go well with the incremental database updates, etc.

However, when merging contacts in Civi, we now get a traceback with the following error:

`[nativecode=1146 ** Table 'fthdc_civi.civicrm_translation' doesn't exist]`

I won't paste the whole trace, but the start of the SQL query is:

`(SELECT 'civicrm_translation' as civicrm_table, 'entity_id' as field_name FROM civicrm_translation WHERE entity_table = 'civicrm_contact' LIMIT 1) UNION (SELECT ...`

Checking the database, it's true that the *civicrm\_translation* table doesn't appear to exist.

Questions are:

1. When did the *civicrm\_translation* table appear in Civi?
2. Is this something that should have been created in the upgrade process?
3. Is there anything that I can do to create this table and the necessary data in order to make merging contacts start working again?

Also, is this a bug that needs reporting?

Thanks in anticipation.

# Answer
It sounds like the upgrade didn't fully work. It gets created as part of 5.39: https://github.com/civicrm/civicrm-core/blob/bbc91a6b38e98b488867a3438d0ac0ee3f4f03c6/CRM/Upgrade/Incremental/sql/5.39.alpha1.mysql.tpl#L3

```
CREATE TABLE IF NOT EXISTS `civicrm_translation` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Unique String ID',
  `entity_table` varchar(64) NOT NULL COMMENT 'Table where referenced item is stored',
  `entity_field` varchar(64) NOT NULL COMMENT 'Field where referenced item is stored',
  `entity_id` int NOT NULL COMMENT 'ID of the relevant entity.',
  `language` varchar(5) NOT NULL COMMENT 'Relevant language',
  `status_id` tinyint NOT NULL DEFAULT 1 COMMENT 'Specify whether the string is active, draft, etc',
  `string` longtext NOT NULL COMMENT 'Translated string',
  PRIMARY KEY (`id`),
  INDEX `index_entity_lang`(entity_id, entity_table, language)
)
ENGINE=InnoDB ROW_FORMAT=DYNAMIC;

```
> 4 votes

---
Tags: upgrade, duplicate-contacts, translation
---


# Question
Title: email error message stating missing or invalid fields
Mailing cannot be sent. There are missing or invalid fields (body\_html:action.optOutUrl or action.unsubscribeUrl).

# Answer
Unless you override this, CiviMail requires a token to be included either for folk to Opt Out or Unsub

Hopefully you will find what you need in the documentation at https://docs.civicrm.org/user/en/latest/email/what-you-need-to-know/
> 1 votes

---
Tags: error, unsubscribe
---


# Question
Title: What link/token would work in a Scheduled (renewal) Reminder that would allow a person with an existing recurring payment to click and cancel it
Scenario - scheduled reminders for auto-renew membership goes out

It notifies folk that 'hey your membership will auto renew in xx days'

but what if we want to include a link so they can cancel it?

Can this be done? What would it look like? Would it require a special token to be able to send the right crid?

# Answer
Technically it's possible to do using a token processor hook. Each membership is linked to contribution recur via civicrm\_membership.contribution\_recur\_id so if you are using Membership entity for sending reminders you could use membership id to fetch contribution recur id and build the cancel subscription URL.

You could also use smarty to add logic inside the reminder message using the above logic if you don't want to go via hook implementation.

Note: Not all payment processor allows to cancel the subscription from Civi, however, the common ones do. In case it doesn't you will need to exclude the cancel subscription URL or build the cancel subscription URL of the payment gateway.

Edited: Also I found out now that you could generate cancel subscription using mid i.e membership id, `civicrm/contribute/unsubscribe?reset=1&mid=123`

HTH

Pradeep
> 5 votes

---
Tags: tokens, auto-renew
---


title: CIVICRM plugin leads to database error

text:
# Question
Title: CIVICRM plugin leads to database error
When downloading civicrm it immediately shuts down the website due to error database

Any help is much appreciated and is something I have been struggling with for MONTHS to figure out. This is the error my host says popped up:

https://paste.websitehostserver.net/text\_2022-01-22\_05-03-16\_gDI32TmKk2 or "\[13-Jan-2022 04:51:44 UTC\] PHP Warning: include(): Failed opening '' for inclusion (include\_path='.:/opt/alt/php74/usr/share/pear') in /home/greenp18/public\_html/wp-content/plugins/woocommerce/includes/wc-template-functions.php on line 53 \[16-Jan-2022 11:24:25 UTC\] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') AND meta\_key LIKE 'attribute\*%'' at line 1 for query SELECT post\_id as variation\_id, meta\_key as attribute\_key, meta\_value as attribute\_value FROM wp73nj\_postmeta WHERE post\_id IN () AND meta\_key LIKE 'attribute\*%' made by require('wp-blog-header.php'), require\_once('wp-includes/template-loader.php'), include('/themes/one-page-express/page.php'), get\_template\_part, locate\_template, load\_template, require('/themes/one-page-express/template-parts/content-page.php'), the\_content, apply\_filters('the\_content'), WP\_Hook-\>apply\_filters, do\_blocks, render\_block, WP\_Block-\>render, Automattic\WooCommerce\Blocks\BlockTypes\AbstractBlock-\>render\_callback, Automattic\WooCommerce\Blocks\BlockTypes\AbstractProductGrid-\>render, Automattic\WooCommerce\Blocks\BlockTypes\AbstractProductGrid-\>get\_products, Automattic\WooCommerce\Blocks\BlockTypes\AbstractProductGrid-\>prime\_product\_variations \[16-Jan-2022 11:37:57 UTC\] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') AND meta\_key LIKE 'attribute\*%'' at line 1 for query SELECT post\_id as variation\_id, meta\_key as attribute\_key, meta\_value as attribute\_value FROM wp73nj\_postmeta WHERE post\_id IN () AND meta\_key LIKE 'attribute\*%' made by require('wp-blog-header.php'), require\_once('wp-includes/template-loader.php'), include('/themes/one-page-express/page.php'), get\_template\_part, locate\_template, load\_template, require('/themes/one-page-express/template-parts/content-page.php'), the\_content, apply\_filters('the\_content'), WP\_Hook-\>apply\_filters, do\_blocks, render\_block, WP\_Block-\>render, Automattic\WooCommerce\Blocks\BlockTypes\AbstractBlock-\>render\_callback, Automattic\WooCommerce\Blocks\BlockTypes\AbstractProductGrid-\>render, Automattic\WooCommerce\Blocks\BlockTypes\AbstractProductGrid-\>get\_products, Automattic\WooCommerce\Blocks\BlockTypes\AbstractProductGrid-\>prime\_product\_variations \[16-Jan-2022 18:35:46 UTC\] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') AND meta\_key LIKE 'attribute\*%'' at line 1 for query SELECT post\_id as variation\_id, meta\_key as attribute\_key, meta\_value as attribute\_value FROM wp73nj\_postmeta WHERE post\_id IN () AND meta\_key LIKE 'attribute\*%' made by require('wp-blog-header.php'), require\_once('wp-includes/template-loader.php'), include('/themes/one-page-express/page.php'), get\_template\_part, locate\_template, load\_template, require('/themes/one-page-express/template-parts/content-page.php'), the\_content, apply\_filters('the\_content'), WP\_Hook-\>apply\_filters, do\_blocks, render\_block, WP\_Block-\>render, Automattic\WooCommerce\Blocks\BlockTypes\AbstractBlock-\>render\_callback, Automattic\WooCommerce\Blocks\BlockTypes\AbstractProductGrid-\>render, Automattic\WooCommerce\Blocks\BlockTypes\AbstractProductGrid-\>get\_products, Automattic\WooCommerce\Blocks\BlockTypes\AbstractProductGrid-\>prime\_product\_variations \[17-Jan-2022 00:30:54 UTC\] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') AND meta\_key LIKE 'attribute\*%'' at line 1 for query SELECT post\_id as variation\_id, meta\_key as attribute\_key, meta\_value as attribute\_value FROM wp73nj\_postmeta WHERE post\_id IN () AND meta\_key LIKE 'attribute\*%' made by require('wp-blog-header.php'), require\_once('wp-includes/template-loader.php'), include('/themes/one-page-express/page.php'), get\_template\_part, locate\_template, load\_template, require('/themes/one-page-express/template-parts/content-page.php'), the\_content, apply\_filters('the\_content'), WP\_Hook-\>apply\_filters, do\_blocks, render\_block, WP\_Block-\>render, Automattic\WooCommerce\Blocks\BlockTypes\AbstractBlock-\>render\_callback, Automattic\WooCommerce\Blocks\BlockTypes\AbstractProductGrid-\>render, Automattic\WooCommerce\Blocks\BlockTypes\AbstractProductGrid-\>get\_products, Automattic\WooCommerce\Blocks\BlockTypes\AbstractProductGrid-\>prime\_product\_variations \[17-Jan-2022 02:09:15 UTC\] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') AND meta\_key LIKE 'attribute\*%'' at line 1 for query SELECT post\_id as variation\_id, meta\_key as attribute\_key, meta\_value as attribute\_value FROM wp73nj\_postmeta WHERE post\_id IN () AND meta\_key LIKE 'attribute\*%' made by require('wp-blog-header.php'), require\_once('wp-includes/template-loader.php'), include('/themes/one-page-express/page.php'), get\_template\_part, locate\_template, load\_template, require('/themes/one-page-express/template-parts/content-page.php'), the\_content, apply\_filters('the\_content'), WP\_Hook-\>apply\_filters, do\_blocks, render\_block, WP\_Block-\>render, Automattic\WooCommerce\Blocks\BlockTypes\AbstractBlock-\>render\_callback, Automattic\WooCommerce\Blocks\BlockTypes\AbstractProductGrid-\>render, Automattic\WooCommerce\Blocks\BlockTypes\AbstractProductGrid-\>get\_products, Automattic\WooCommerce\Blocks\BlockTypes\AbstractProductGrid-\>prime\_product\_variations \[17-Jan-2022 02:59:56 UTC\] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') AND meta\_key LIKE 'attribute\*%'' at line 1 for query SELECT post\_id as variation\_id, meta\_key as attribute\_key, meta\_value as attribute\_value FROM wp73nj\_postmeta WHERE post\_id IN () AND meta\_key LIKE 'attribute\*%' made by require('wp-blog-header.php'), require\_once('wp-includes/template-loader.php'), include('/themes/one-page-express/page.php'), get\_template\_part, locate\_template, load\_template, require('/themes/one-page-express/template-parts/content-page.php'), the\_content, apply\_filters('the\_content'), WP\_Hook-\>apply\_filters, do\_blocks, render\_block, WP\_Block-\>render, Automattic\WooCommerce\Blocks\BlockTypes\AbstractBlock-\>render\_callback, Automattic\WooCommerce\Blocks\BlockTypes\AbstractProductGrid-\>render, Automattic\WooCommerce\Blocks\BlockTypes\AbstractProductGrid-\>get\_products, Automattic\WooCommerce\Blocks\BlockTypes\AbstractProductGrid-\>prime\_product\_variations \[18-Jan-2022 02:12:51 UTC\] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') AND meta\_key LIKE 'attribute\*%'' at line 1 for query SELECT post\_id as variation\_id, meta\_key as attribute\_key, meta\_value as attribute\_value FROM wp73nj\_postmeta WHERE post\_id IN () AND meta\_key LIKE 'attribute\*%' made by require('wp-blog-header.php'), require\_once('wp-includes/template-loader.php'), include('/themes/one-page-express/page.php'), get\_template\_part, locate\_template, load\_template, require('/themes/one-page-express/template-parts/content-page.php'), the\_content, apply\_filters('the\_content'), WP\_Hook-\>apply\_filters, do\_blocks, render\_block, WP\_Block-\>render, Automattic\WooCommerce\Blocks\BlockTypes\AbstractBlock-\>render\_callback, Automattic\WooCommerce\Blocks\BlockTypes\AbstractProductGrid-\>render, Automattic\WooCommerce\Blocks\BlockTypes\AbstractProductGrid-\>get\_products, Automattic\WooCommerce\Blocks\BlockTypes\AbstractProductGrid-\>prime\_product\_variations \[18-Jan-2022 19:27:59 UTC\] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') AND meta\_key LIKE 'attribute\*%'' at line 1 for query SELECT post\_id as variation\_id, meta\_key as attribute\_key, meta\_value as attribute\_value FROM wp73nj\_postmeta WHERE post\_id IN () AND meta\_key LIKE 'attribute\*%' made by require('wp-blog-header.php'), require\_once('wp-includes/template-loader.php'), include('/themes/one-page-express/page.php'), get\_template\_part, locate\_template, load\_template, require('/themes/one-page-express/template-parts/content-page.php'), the\_content, apply\_filters('the\_content'), WP\_Hook-\>apply\_filters, do\_blocks, render\_block, WP\_Block-\>render, Automattic\WooCommerce\Blocks\BlockTypes\AbstractBlock-\>render\_callback, Automattic\WooCommerce\Blocks\BlockTypes\AbstractProductGrid-\>render, Automattic\WooCommerce\Blocks\BlockTypes\AbstractProductGrid-\>get\_products, Automattic\WooCommerce\Blocks\BlockTypes\AbstractProductGrid-\>prime\_product\_variations \[21-Jan-2022 02:53:56 UTC\] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') AND meta\_key LIKE 'attribute\*%'' at line 1 for query SELECT post\_id as variation\_id, meta\_key as attribute\_key, meta\_value as attribute\_value FROM wp73nj\_postmeta WHERE post\_id IN () AND meta\_key LIKE 'attribute\*%' made by require('wp-blog-header.php'), require\_once('wp-includes/template-loader.php'), include('/themes/one-page-express/page.php'), get\_template\_part, locate\_template, load\_template, require('/themes/one-page-express/template-parts/content-page.php'), the\_content, apply\_filters('the\_content'), WP\_Hook-\>apply\_filters, do\_blocks, render\_block, WP\_Block-\>render, Automattic\WooCommerce\Blocks\BlockTypes\AbstractBlock-\>render\_callback, Automattic\WooCommerce\Blocks\BlockTypes\AbstractProductGrid-\>render, Automattic\WooCommerce\Blocks\BlockTypes\AbstractProductGrid-\>get\_products, Automattic\WooCommerce\Blocks\BlockTypes\AbstractProductGrid-\>prime\_product\_variations"

# Answer
> 2 votes
Welcome to SE! Those errors look to relate to WooCommerce, not CiviCRM. What happens if you disable WooCommerce?

---
Tags: wordpress
---


title: Family membership online signup

text:
# Question
Title: Family membership online signup
Just so I'm clear on this. There is no way to create a family membership online signup form that allows both partners to become members by signing up with one form when running on Wordpress. in other words, places for both members to enter names, phone # and emails. This seems like such a basic requirement and I see it has been kicked around since 2013, with no real resolution. I have seen that migrating to Drupal and using a third party Webform it is possible, but that is probably not an option for us. I just need clarification before going in search of another solution, in case I'm missing something. Thanks, Ray

# Answer
> 1 votes
There are (at least) 2 parts here:

1. What does 'family membership' mean in your context?
2. How to sign-up for it.

For 1) you can have the membership attached to the 'primary' partner and use inherited memberships and relationships to apply it to the other partner (and kids). \[One org I worked with wanted a symmetric arrangement so either partner could renew so they used households to hold the membership.\]

For 2), the core membership sign-up pages won't let you add two lots of contact details to create the membership and relationships etc. As you note, webform is a common option for doing this on Drupal.

On WP, you could have used Caldera Forms but that is being retired and the Ninja Forms replacement is not yet released. (See other posts for more details of that)

Alternatively, you could use the Contact Form 7 CiviCRM integration to create your form on WP and pass the data through to the Form Processor extension to create the contacts and membership. However, I don't think you can take payments this way.

Eventually you should be able to create this with Form Builder, but not yet.

---
Tags: wordpress
---


# Question
Title: Sorry, you are not allowed to access this page. WordPress version
So a long time ago we had played around with version 4.x on this site. I deleted it and I deleted the folder in the uploads folder. Then I unzipped the new zip file on my PC and uploaded it to the plugins directory. I then Activated it inside WordPress and when I go to the CiviCRM installer I see this on the screen for a second or two then it moves me to a page that says "Sorry, you are not allowed to access this page." I'm not sure where to go from here. We are using WordPress 5.9 and PHP 7.4

# Answer
> 0 votes
What I wound up doing to fix this was to delete the plugin then manually delete all of the tables in the database for CiviCRM. Then reinstall the plugin and it worked. So it was hung up on something in the database itself.

# Answer
> 0 votes
There are files installed as part of the plugin package (`wp-content/plugins/civicrm`), and other files that are created (`wp-content/uploads/civicrm` ... but I think that location has changed since CiviCRM 4.x).

It has found a `civicrm.settings.php` file. Remove the plugin and look for that file - then remove it and all the other Civi-related files.

After that, upload again to the plugins directory and try installing.

---
Tags: installation
---


# Question
Title: How to add a donation amount to an email that is sent from Civi
I am working to create an email that contains required details for donations to US-based non-profits. In this email, I need to include the donation amount that is collected from a contribution for patrons to file on their taxes with the IRS. I'm not seeing a donation field that I can use, but I have read some posts on custom tokens and needing to add it to Home » CiviCRM » Administer CiviCRM » Custom Data

Is that the process or should I do something else?

Thanks,

E

# Answer
Use Thank You Letters. This requires you to pull a contribution report of the donors you want to receive the email then create the letter to email them.

1. Go to Find Contribution, set the date for last year, select the financial type(s), and Refresh Results. Check if you need to do any other filtering to get the people you need.
2. Check "All Records"
3. Under actions select "Thank You Letters-Print or Email."
4. On the Thank You screen Group by "Whatever works for your grouping needs" Separator set to "Horizontal Cell" and select print or email
5. Create your letter adding token(s) to pull their donations or their {$contribution\_aggregate} Whatever detail you want.
6. Save & Name the template for next time

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

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

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

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

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

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

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

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

```
> 3 votes

# Answer
Alternate approach, since I was just wrestling with this: install the Fuzion Tokens extension. It gives you all kinds of useful tokens in various contexts, including things like total amount given this year/last year/all time, total deductible amount ditto.
> 1 votes

---
Tags: donations
---


# Question
Title: Minimum requirement: driver://host/database Error
My CiviCRM database cannot connect to my database server when it is loading a Drupal page that accesses CiviCRM through Views.

We have been having all sorts of trouble with our Amazon Aurora instance but all the problems have appeared focused on the Drupal database. We have one server but two databases running on the instance. One for Drupal 9.3.3 and one for CiviCRM 5.45.2.

The error is `InvalidArgumentException: Minimum requirement: driver://host/database in Drupal\Core\Database\Connection::createConnectionOptionsFromUrl() (line 2021 of core/lib/Drupal/Core/Database/Connection.php).`

The full backtrace too long to include but these are the key lines:

```
Drupal\Core\Database\Database::convertDbUrlToConnectionInfo('mysql://db_name:password@db-address:port/database?new_link=true', '/var/www/web') (Line: 67)
Drupal\civicrm_entity\Plugin\views\query\CivicrmSql->init(Object, Object, Array) (Line: 820)
Drupal\views\Plugin\views\display\DisplayPluginBase->getPlugin('query') (Line: 1182)
Drupal\views\ViewExecutable->initQuery() (Line: 1154)
Drupal\views\ViewExecutable->getQuery() (Line: 242)
Drupal\views\Plugin\views\cache\CachePluginBase->getCacheTags() (Line: 1566)
Drupal\views\ViewExecutable->getCacheTags() (Line: 2208)
Drupal\views\Plugin\views\display\DisplayPluginBase->applyDisplayCacheabilityMetadata(Array) (Line: 2407)
Drupal\views\Plugin\views\display\DisplayPluginBase->buildRenderable(Array, ) (Line: 1595)
Drupal\views\ViewExecutable->buildRenderable('block_1', Array, ) (Line: 51)
Drupal\views\Plugin\Block\ViewsBlock->build() (Line: 171)
Drupal\block\BlockViewBuilder::preRender(Array)

```

I am able to load /civicrm and I am able to connect to the database with `cv` command. I have no reason to think there would be any corruption to the database. I did recently expand the value for `max_allowed_packets`, expand the size of the RDS Aurora instance, and turn on file based long query auditing. I do not think any of these things should break this. Further, it was working this morning after those changes were made.

Any help is greatly appreciated.

Thanks,

Josh

# Answer
I use CiviCRM/Drupal 9 in a split database configuration with Views. Make sure that you've added the necessary configuration into `settings.php` (can be found under **Administer menu » System Settings » CMS Database Configuration**). You'll also need the `civicrm_entity` module.

Note that this is a moving target as of February 2022 - Drupal 10 won't support per-table database prefixes in `settings.php` so work is underway to use a different approach. There is an open issue (and open pull request) which, once merged, will change the values you put into `settings.php`.
> 0 votes

---
Tags: drupal, database, drupal-views, drupal-9
---


title: Webform/civicrm contribution page eror

text:
# Question
Title: Webform/civicrm contribution page eror
Using a webfrom civi contribution page and when submitting I get an error that a recurring interval must be selected, even though i have it set to user selects.

# Answer
> 0 votes
The Error message does not say none is selected. It says the option selected is not one of those options.

# Answer
> 0 votes
I've seen this only once before, when someone messed with the Recurring Frequency Units options.

* Go to CiviCRM's **Administer menu » System Settings » Option Groups**.
* Find *Recurring Frequency Units* and select **Edit Options**.

Compare the values you see to the attached screenshot. If they aren't an exact match, that's your problem. Set the values exactly as seen in this screenshot and the error will go away.

---
Tags: webform-civicrm
---


# Question
Title: How do I stop duplicate mailings from being sent out?
We are having problems with duplicate mailings being sent out. John Doe may be listed more then once in CiviCRM - For example, **John Doe** and **Doe, John** but it's the same addressee. What can I do to rectify the matter so that only one mailing will go out to this addressee versus two?

# Answer
I believe you should eliminate the duplication in your database. The CRM provides a tool for handling the duplicated contacts. You can merge the duplicated contacts into a single one. With this the email addresses will be unique so that only one email will be sent.
> 3 votes

---
Tags: civimail
---


# Question
Title: Trying to add image to email get ckeditor error
Using CiviCRM 5.36.1 - trying to create email to send using civimail. at: .../wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fa%2F#/mailing/336

Previously had no trouble adding an image by clicking on the add image icon. Now get error when trying to either upload a new image, or linking to an existing image.

Get "incorrect server response" as shown below.

The web console shows: \[CKEDITOR\] Error code: filetools-response-error. Object { responseText: "
\n**Deprecated**: The each() function is deprecated.

I removed old images from /public\_html/wp/wp-content/uploads/civicrm/persist/contribute/images and still get same error.

Any suggestions?

# Answer
> 2 votes
I don't know if it is just a coincidence, but after I upgraded the version of php my site uses from 7.3.33 to 7.4.27 I am again able to add images to a draft email.

# Answer
> 1 votes
A nice workaround for this is to install the CKEditor5 Extension (https://lab.civicrm.org/extensions/ckeditor5) and follow its setup instructions. Most of the Drupal 9 installs I use, have this problem and it is solved with this.

---
Tags: civimail, ckeditor
---


# Question
Title: Display number of records returned in a query
Is there a way to display the number of records returned in a SearchKit query? We would like to have an easy way to see the number of records being displayed in each of our SearchKit reports. Once we put that SearchKit into an afform, it would be helpful for that number to update as we enter information into filters.

An example would be: I have made a query in SearchKit that displays all contacts who have made a contribution to our organization (I am grouping those contacts by Contact ID). When I make a table display of that query, I would like to quickly see how many contacts are being displayed. I then use afform so that I can filter that query based on things like state, country, date range, or contribution amount. Ideally, the number of results would update depending on what filters were set. Is there a way to do this currently?

# Answer
> 2 votes
Yes, you can do that. In the display that you create for the search there's a field at the top - before the list of items to be shown in the search - called 'Show Count' - just check that. This is in release 5.45, and is in the 'Display' component, not the 'Search Kit' itself.

---
Tags: searchkit, formbuilder
---


# Question
Title: Cron job failing silently after update to 5.45.2
We upgraded to CiviCRM 5.45.2 on Joomla 3.10.5 and everything was working fine until we attempted to send a mailing to about 1000 recipients. The cron job started failing silently after that, with no notification to us or a visible notification in the dashboard. I contacted our host and they are seeing a 500 error in the Apache access log, but no corresponding entry in the Apache error log, so they said it is coming from either Civi or Joomla.

Example error below:

```
192.xxx.xxx.xx - - [31/Jan/2022:13:58:35 -0500] "GET /administrator/components/com_civicrm/civicrm/bin/cron.php?name=[redacted]&pass=[redacted] HTTP/1.1" 200 5628 "-" "lwp-request/6.36 libwww-perl/6.36" 0 0 "on:TLSv1.3:TLS_AES_256_GCM_SHA384" 895 3404768 192.252.151.10 www.[redacted].com proxy:unix:/home/[redacted]/.config/php-fpm/.sockets/php-fpm-ZrxRl01wU0Jb5N0KjTcmWLbh8.sock|fcgi://ZrxRl01wU0Jb5N0KjTcmWLbh8 - 192.xxx.xxx.xx

```

We've never had a similar issue prior to the upgrade, and the only error notices I received were about updating system templates. Has anyone seen a similar issue?

# Answer
> 1 votes
Our host helped resolve the issue. The cron job was failing silently by timing out. We had to lower the amount of emails triggered per run and updated the cron to have a longer period before timing out. Our host also increased the number of resources available for running cron jobs.

---
Tags: joomla, upgrade, cron-job
---


# Question
Title: Why do my site permissions mean a volunteer user role can see activities in the Activity tab, but then not see them when moved to case?
Civi 5.42 D7

I have set up a case system for our organisation to allow "Volunteer Counsellors" to access civi, see the clients they are allocated to and manage their clients' cases.

The "Volunteer Counsellor" role does not have the blanket view all contacts permissions in civi. I've set up the Counsellor of/ Counsellor is relationship to be permissioned so that the counsellor can see/ edit/manage the details of the client. The Counsellor of/is role is also the Case Manager role in the case. I've set up Drupal ACLs so that the counsellor has access to specific groups of contacts which includes other Service Staff who may interact with the client.

As a counsellor I can log in, find my client in Civi and see activities in the activity tab and view/ edit those added by members of service staff. And tbh, that's what I expect.

Once these activities are "filed on case" by an administrator, they are not visible to the counsellor in the case listing. Although they are visible to those with staff/ admin roles.

I can make these activities visible to the counsellor by adding them as activity assignees.

But I had thought that the permissions for the volunteer counsellor role to be able to see activities in the activity tab, would be sufficient for them to see the same case activity listing.

Is this a known feature? Have I overlooked something

# Answer
Figured this out after posting the above.

I had originally given the Volunteer Counsellor role the CiviCRM case permission "access my cases and activities". Because one of the requirements for volunteer access to the CRM was that they should not see other contact data beyond their own client list.

I changed this to "access all cases and activities". And the Counsellor user could then see and all the activities within their case, as well as any additional activities on the client's activity tab.

This meant that the volunteer user could then see additional client and case data when they selected "All cases" on the Case Dashboard. Which includes name and phone data for clients involved in cases across the organisation, but following links to case or contact details gave the access denied message- as per their wider site permissions.

So basically I updated the nav menu settings so that volunteer case users just can't see the case menu in Civi, and therefore the case dashboard is hidden from them. (They can see cases they are assigned to in views I've created for this project).

In short, the "my cases and activities" permission gives the user access only to cases they have a role in, and inside that case only the activities they are part of (Target, source, assignee). "all cases and activities" gives access to all cases and all activities within those cases.

Kind of wish there was a "my cases and all activities in my cases" option. But there isn't. But I've kind of created that with the ACL and relationship permissions.
> 2 votes

---
Tags: civicase, acl
---


# Question
Title: Anonymous online membership renewal - member dues payment is recorded but how to extend the membership expiration date?
I'm new to CiviCRM so I may be missing something obvious, but research hasn't helped me yet. This is for a small-scale organization using Wordpress where we don't want users to log in to the site. We are not trying to set up auto-renew, which seems to be what most of the questions that turn up in searches are about. All the member data was successfully imported from CSV files and mostly everything in the admin GUI looks and behaves normally AFAICT.

* I have a CiviCRM membership contribution page set up following the Online membership sign up directions.
* We are not using Price Sets. Memberships are rolling. The payment processor is Paypal Standard.
* The contribution page successfully records the Member Dues contribution, matching to existing users.
* But the membership doesn't change.
* In this post, which is about auto-renew but was the most helpful I found, KarinG said " If Membership is important for your org consider an extension that handles the logic for you. Eg -\> if Contribution is Completed -\> add +1y to current Membership start (or end date)." That would be perfect!
* So I installed CiviRules, but I can't find an existing Action (there is Add Membership, but we just want one membership per person and don't mind gaps or type changes).
* I started looking at the directions to create one's own triggers, but before going down that road, I wonder/hope if there's some simpler way that I'm just missing!

Thanks so much for any tips or help. I'm loving this project and hope to be able to contribute down the road!

-- Adding new information based on the responses:

* The online contributions are marked Completed. IPN is enabled and working.
* The contribution *is* associated with the membership - thanks Jon G for pointing me to that. Under Related Contributions I see name, amount, type, source, received, and status Completed.
* Now I see the actual problem! The members who have renewed so far skipped a year. When I imported the memberships to the database last month, the current person had an end date of 12/31/20**20**. The new end date is 12/31/20**21**. They renewed on 2/6/2022 so we want the new end date to be 2/5/20**23**.

So now I have 2 questions! First is a meta-Stack Exchange question - how best to rework this so it's clear what the actual issue is? Second, what's the best way ensure that membership renewal dates are extended the way we want? Memberships are rolling with duration unit 1 year. I have status rules set up to put memberships in Grace period if they are under 2 years past end date.

Thanks so much!

# Answer
The membership status will be updated once the Contribution status is changed from Pending to Completed.

Since you are using PayPal standard, a pending contribution will be created against the membership before the user is redirected to Paypal. Once the payment is confirmed at Paypal it will send a silent payment notification to Civi about the payment status and its details. Civi will read the notification and update the status of the contribution from pending to Completed/Failed simultaneously the membership attached to the contribution will also get updated like the status, end date etc.

Paypal to send silent payment notifications to Civi, you will need to enable IPN at PayPal. Please check if you have enabled the notification as per the doc here.
> 5 votes

# Answer
> we want the renewal end date to be 1 year from the payment date, not one year from the previous end date (we don't care about gaps)

I think you could do this by setting your Grace period to zero. That way someone moves from Current to Expired. Therefore a 'renewal' will add a new 12 months to the End Date since the system considers the membership already 'ended' and hence payment kicks off a new 12 month period
> 2 votes

---
Tags: civimember, contribution-page, civirules
---


# Question
Title: Multiple financial types from contributions - how does one search donors to find those that have contributed to only one financial type?
we have an umbrella organisation that accepts donations (contributions) for multiple financial types (Artist 1, Artist 2, etc.). Some donors may contribute to more than one financial type.

We want to find a way (report, search) to look for donors that have ONLY contributed to one financial type. That is, if they have donated to Artist 1 and Artist 2, we do not want to see that. How could one search for this?

Something like find donor where # of financial types within certain date span has contributed to = 1 only financial type.

Is this possible?

Thanks, Steve Marfisi on behalf of Flyingbow

# Answer
You can do that with SearchKit:

See this link on dmaster.

If you don't see all the options, check you are on the latest release. This works on current master which is 5.48.alpha1 (and maybe earlier).

== edit ==

From comments in chat, some may find a step-by-step explanation helpful. The SK interface is smart in that some options and parts of the interface are only shown if they are relevant given other selections, so the ordering is important.

1. Go to `Search > Search Kit > New Search`
2. Click `+Entity` and select `Contact Contributions` (We want people with contributions meeting certain criteria.)
3. Click `With (optional)` and change to `With (required)` (We aren't interested in people without any contributions)
4. Click `Add Condition`, select `Date Received` (Condition fields become visible)
5. Click `Pick Date`, select `Date Range` (Condition fields change)
6. Click `Today`, select `This calendar month`
7. Click `Search` to see the results so far - should show Contact ID & Display Name (If no results, try changing `This calendar month` to `This calendar year` etc)
8. Click `Add` and select `Financial Type` under Contact Contributions. (We want to see financial types)
9. Click `Search` again - should now show Financial Type as 'Donation', 'Event Fee' etc
10. People with multiple contributions have multiple result lines. We want one result line per person, so click `Group By` and select `Contact ID`. Note that the `Having` box is displayed now.
11. Click `Search` again. There is one result line per person and those with multiple contributions show a list of financial types (eg 'Member Dues, Event Fee')
12. Click `Field Transformations` to expand that section.
13. Click `List` in front of 'Financial Type' and change to `Count`. (We want a number, not a list)
14. Tick the `Distinct` checkbox. (We want the number of different types, not the total number of contributions)
15. Click `Search` again and it should show '1', '2' etc for the number of financial types
16. Now filter this list to only show the entries with '1': Click `Having` and select `(Count) Contact Contributions: Financial Type` and enter `1` in the box after `=`
17. Click `Search` \- then `Save` if you want to.
> 4 votes

---
Tags: contributions, financial-types, searchkit
---


# Question
Title: How to use the "Synchronizing CiviCRM data to Custom Posts" plugin (Wordpress)
I'm upgrading our website and was looking in better ways of integrating CiviCRM with Wordpress. I found a nice plugin called "Synchronizing CiviCRM data to Custom Posts" that might do what I need.

However I installed the plugin and the dependencies, I can create a custom post type via the plugin, I also get the custom fields.. However when I go into the created custom post type there is nothing.

Do I need to setup the fields first via ACF? Just missing a bit of guidance :(.

# Answer
I haven't used the plugin you mention, but if you're using ACF you might find that CiviCRM Profile Sync works for your needs. It has compatibility with ACF (ideally using the Pro version) as well as front-end form building with ACF Extended \- although contributions cannot be done via those forms as yet.
> 1 votes

---
Tags: wordpress
---


# Question
Title: Generating hard copy mail merge letters in Civicrm
I want to do a mail merge and post out a letter to members of a Civigroup. You can do this by generating a message template. When you insert a letterhead image into the template, the image resolution on the printed copy is poor. Is there a way to improve the resolution so that it looks professional. I presume this would be the same with invoices etc.

# Answer
> 1 votes
Meanwhile, there is a new extension called CiviOffice. It is still under development but provides many features already and should be able to solve the image problem described in your question. Have a look at the documentation: https://docs.civicrm.org/civioffice/en/latest/

# Answer
> 0 votes
If the printed version looks poor it is probably due to the quality of the image you used in the editor. You could simply upload one with better quality / resolution.

In general you may have to fiddle a bit to get your html templates work well. I would advise to use an external editor and backup your templates once they work.

---
Tags: mailing
---


# Question
Title: how to get participant id on registration thank-you page
How could I get the participant ID and the corresponding contact ID on the event registration thank-you page? E.g. is there a field (or piece of code) I can insert in /templates/CRM/Event/Form/Registration/DisplayProfile.tpl ?

For participant ID I tried the following but to no avail:

```
<div class="participant-id hidden">{$participant.id}</div>

```

Thank you for any tips

# Answer
the following did the trick - works in this situation well enough as we only allow registering one participant:

```
{$participantIDs.0}

```

The above grabs the participant ID of the first (and only in our case) participant
> 3 votes

# Answer
The participant\_id can be accessed on the event registration thank you page in two different ways -- by using Smarty template variables when the user is logged in or by using session variables when the user is anonymous. Both approaches work when used inside the "civicrmBuildForm" hook.

**1) User logged in**

```
add_action( 'civicrm_buildForm', 'getParticipantId' );

function getParticipantId() {
    $template = (array) CRM_Core_Smarty::singleton();
    $event = $template['_tpl_vars']['event'];

    $participant = civicrm_api3('Participant', 'getsingle', [
        'sequential' => 1,
        'contact_id' => "user_contact_id",
        'event_id' => $event['id'],
    ]);

    echo $participant['id'];
}

```

**2) Anonymous user**

```
add_action( 'civicrm_buildForm', 'getParticipantId' );

function getCrmFromSession($session) {
    if (!empty($session)) {
        $seshAry = (array) $session;
        $seshKey = array_keys($seshAry)[1];
        $CiviCRM = json_decode(json_encode($seshAry[$seshKey]), true)['CiviCRM'];

        if ( !empty($CiviCRM['CRM_Utils_Recent']) && isset($CiviCRM['CRM_Utils_Recent'][0]['id']) ) {
            $CiviCRM['participant_id'] = $CiviCRM['CRM_Utils_Recent'][0]['id'];
        }

        return $CiviCRM;
    } else {
        return array();
    }
}

function getParticipantId() {
    $CiviCRM = getCrmFromSession(CRM_Core_Session::singleton());

    echo $CiviCRM['participant_id'];
}

```
* I appended a template to the Thank You template with the data related to participant\_id.
* In my case, the BuildForm hook lives in my theme's functions.php file.
> 2 votes

---
Tags: registration, online-registration, participants
---


# Question
Title: When should a CIVI group be disabled vs deleted?
I am wondering what the difference between archiving and disabling a Group is? I would like to clean up our list of groups (including Smart Groups) without deleting or affecting any of the historical information related to these groups such as being a part of a specific bulk mailing.

Thanks for your help.

# Answer
Yes I would use the disable feature for that. Deleting is when you want to completely remove everything about it. Civi doesn't really have "archive" the way I think archive means. To me archiving is removing from the database but storing it somewhere else. Disabling keeps it in the same database but hides it from day to day tasks, and let's you restore it.
> 4 votes

---
Tags: groups
---


# Question
Title: Why does nesting Civi shortcodes in Wordpress pages prevent Javascript files from loading?
If I create a new page and include this shortcode, the Civi User Dashboard displays correctly.

```
[civicrm component="user-dashboard"]

```

If I create a new page but nest the same short code inside of an outer shortcode, several JS files do not get loaded. A section titled "\<!-- CiviCRM html header --\>" (present in non-nested output) does not output.

```
[members_logged_in]
[civicrm component="user-dashboard"]
[/members_logged_in]

```

# Answer
https://developer.wordpress.org/reference/functions/get\_shortcode\_regex/

"get\_shortcode\_regex" doesn't seem to work when nesting CiviCRM shortcodes. I found 2 hacky workarounds.
> 2 votes

# Answer
I ended up using page tags to tell a php script which pages need to force CiviCRM resources to load.

```
if ( function_exists('has_tag') && function_exists('get_the_id') && has_tag('logged-in-no-cache', get_the_id()) ) {
    add_action( 'wp_enqueue_scripts', array( civi_wp(), 'front_end_page_load' ), 100 );
}

```

This goes in functions.php.
> 1 votes

---
Tags: javascript, html
---


# Question
Title: Can't create quickform via CRM_Core_Form in my custom extension
I want to create page with form via my custom extension. I find this page in documentation: https://docs.civicrm.org/dev/en/latest/framework/quickform/ But when I create a class according to the documentation, I get this error:

```
Error: Call to a member function setName() on string in CRM_Core_Form->__construct() (line 271 of /var/www/mvp1/web/sites/all/modules/civicrm/CRM/Core/Form.php).

```

My class:

```
class CRM_JosiahVenture_Page_RolePrimaryAlert extends CRM_Core_Form {

  public function preProcess() {
  }

  public function buildQuickForm() {
    $this->add('text', 'my_text_field', ts('Enter Some Text'));
  }

  public function addRules() {
    $this->addFormRule(array('CRM_Example_Form', 'myRules'));
  }

  public static function myRules($values) {
    $errors = array();
    if ($values['foo'] != 'abc') {
      $errors['foo'] = ts('You entered the wrong text!');
    }
    return empty($errors) ? TRUE : $errors;
  }

  public function postProcess() {
  }
}

```

My xml file:

```
<item>
    <path>civicrm/RolePrimary</path>
    <page_callback>CRM_JosiahVenture_Page_RolePrimaryAlert</page_callback>
    <title>CustomActivity</title>
    <access_arguments>access CiviCRM</access_arguments>
  </item>

```

Tpl file is empty for now.

# Answer
Maybe it is not connected to your issue, but if you implement a form, it supposed to be inside a `Form` directory, and the class name should follow this (has to contain `_Form_`). In your case the class name contains the `_Page_` string which is strange. I would like to suggest you to generate the basics of your form with the `civix` tool. After the file generation you can check that the dummy form works well or not. If it works well, you can start to modify the dummy code.
> 2 votes

# Answer
In preprocess/postprocess/buildquickform, you should call the parent, i.e. your class should be:

```
class CRM_JosiahVenture_Page_RolePrimaryAlert extends CRM_Core_Form {

  public function preProcess() {
    parent::preProcess(); // <-- ************ add this
  }

  public function buildQuickForm() {
    parent::buildQuickForm();  // <-- ************ and this
    $this->add('text', 'my_text_field', ts('Enter Some Text'));
  }

  public function addRules() {
    $this->addFormRule(array('CRM_Example_Form', 'myRules'));
  }

  public static function myRules($values) {
    $errors = array();
    if ($values['foo'] != 'abc') {
      $errors['foo'] = ts('You entered the wrong text!');
    }
    return empty($errors) ? TRUE : $errors;
  }

  public function postProcess() {
    parent::postProcess();  // <-- ************ and this
  }
}

```
> 0 votes

---
Tags: extension, quickform, custom
---


# Question
Title: Is acl entity role available in Api4 explorer?
I'm pretty sure the acl\_entity\_role entity is supported by CiviCRM APIv4. Why doesn't it appear in the entity list on civicrm%2Fapi4#/explorer/ ?

# Answer
> 1 votes
Works for me on CiviCRM 5.46. Are you using an older version of CiviCRM?

---
Tags: apiv4
---


# Question
Title: Mismatched entity andf/or field definitions
Drupal is giving me an error that looks like the schema is out of date. I've run 'upgrade' and there is no tasks outstanding.

How do I fix these

```
Mismatched entity and/or field definitions
The following changes were detected in the entity type and field definitions.

CiviCRM Activity

  The Is GOTV? field needs to be installed.

CiviCRM Event

  The Is qr code used for this Event? field needs to be installed.

CiviCRM Participant

  The Public key field needs to be installed.
  The QR Event id field needs to be installed.
  The Qr hash code field needs to be installed.
  The QR image url field needs to be installed.
  The Bio field needs to be installed.

```

# Answer
> 4 votes
Most likely this was caused by the civicrm entity module. To fix

* Check that the CiviCRM database is upgraded https://site/civicrm/upgrade?reset=1.
* Reset the drupal caches *drush cr*
* Run the drupal upgrade https://site/update.php
* Check the drupal status report page https://site/admin/reports/status for entities out of date
* Uninstall the *civicrm\_entity* module *drush pm:uninstall civicrm\_entity*
* Reinstall *civicrm\_entity* *drush en -y civicrm\_entity*
* Clear caches again *drush cr*
* Check the status report page again.

There is an entity updates module that may let you run *drush entup* although it is only recommended for development sites.

---
Tags: fields
---


# Question
Title: How to restrict access to certain information for non-admin users (i.e. volunteers)
I'm working on a CiviCRM system which has volunteers who we need to restrict access to specific contact information.

I've created a group for the Volunteers as well as a group (called Private Contacts) for those people whose contact information needs to be hidden. I also created an ACL for Volunteers and a Group for Volunteers and placed the Volunteers into the Group. I also setup an ACL allowing them to view Contacts in All Groups.

The result is the Volunteers are getting full access to all the contact information for the users in the Private Contact group.

So far, all I can see are ways to enable access to things (like enabling access to View the groups) but I can't see how to restrict access to anything.

Is there a setting that I am missing?

For example, if I want to hide the mailing address or cell phones for the volunteer users. Or, better yet, if the volunteer users were not able to view the list of contacts that are part of the Private Group.

# Answer
> 2 votes
> So far, all I can see are ways to enable access to things (like enabling access to View the groups) but I can't see how to restrict access to anything.

Yes - that's the key to understanding these permissions. A user starts with no permission and is granted bits of access via the CMS permissions and ACL's.

If a user should have access to all contacts you will normally grant that via the 'CiviCRM: view all contacts' CMS permission - and in a simple setup where all users see all contacts then all users will have that permission.

So if you want your Volunteers not to view those in the Private Group, you need to remove the 'CiviCRM: view all contacts' CMS permission from the Volunteers and then *grant* them access to all contacts *except* those in Private Group. You also need to make sure that non-volunteers can access Private Group contacts, so you may want your Volunteers to be a different CMS role from non-volunteers.

That is awkward and a better way of handling the scenario you describe would be useful.

---
Tags: acl, roles
---


# Question
Title: How to account for credit card fees in reports?
How can I account for credit card processing fees in reports? For example, if a member renews via credit card for $15, we only get $14.26 after the processor takes their cut. I'd like to be able to generate reports that will match up with our accounting.

# Answer
> 0 votes
You could use Contribution details report and include 'Fee amount' as column and filter as Payment Method In Credit Card.

Also you could use BookKeeping report, with filters as

1. Financial Account Name - Debit In Banking Fees
2. Payment Method In Credit Card

---
Tags: civicontribute, payment-processor, payment, accounting, financial-accounts
---


# Question
Title: Error: You need to define CIVICRM_DSN in civicrm.settings.php civicrm 5.46.0 on Wordpress
I am quite new to civicrm, but managed to get a site up and running (the instance had records etc)- somehow I managed to delete the uploads folder. so I did a fresh install of Wordpress 5.9, created a new database for civicrm and a fresh install of civicrm 5.46.0. I enter database details, installation starts, but stops with this error, you need to define CIVICRM\_DSN in civicrm.settings.php, but the file doesn't exist neither does the civicrm folder in uploads. I have chmod plugins and uploads with write permissions, tried creating the folder myself, I don't know what else to do to get it working.

# Answer
> 1 votes
The civicrm.settings.php by default is in: /wp-content/uploads/civicrm/civicrm.settings.php

So if you deleted the uploads folder it might make sense it can not find it.

The civicrm folder in uploads contains a lot more as well.

You mentioned you did a fresh install of civicrm, that actually should have created this folder, with everything in it. So my guess is that went wrong. So, you might want to retry that.

---
Tags: installation
---


# Question
Title: "No such field" when attempting to open a contact in CiviCRM Spark
When I attempt to open a contact in CiviCRM Spark, I get the error message below, any ideas? See also screenshot.

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 Return to home page.

# Answer
CiviCRM has an undocumented limit on the number of custom fields inside a custom group, which might be 65 fields, or it might depend on the type of fields (text vs numeric).

Looking at your database, 71 custom fields had been created, but only the first 65 had actually been created in the underlying storage, which is what was causing the error.

To mitigate the issue, I disable those fields that do not really exist, and I recommend that you delete them completely.

You can then create a separate custom group for more fields. Ideally, you can try to group them logically somehow (by thematic?) so that it looks more intuitive. The end result will be exactly the same as if they were in a single group, but visually there will be some separator between the two groups.

(I'm a CiviCRM Spark admin, so I could view the detailed error log and examine the underlying database. You can also email us at spark-at-civicrm.org)
> 3 votes

---
Tags: contacts, civicrm-spark
---