title: API4 giving Authorization failed Error

text:
# Question
Title: API4 giving Authorization failed Error
We have local and dev site with drupal 8 + CiviCRM 5.22.0, Installed Contact Layout Editor Extension.

http://localdemo8.com/civicrm/api4. (api4 explorer)

or

http://localdemo8.com/civicrm/ajax/api4 for contact layout api call.

we are getting 500 status with 'Authorization failed' Message in console.

Here is backtrace

```
$Fatal Error Details = array(3) {
  ["message"]=>
  string(20) "Authorization failed"
  ["code"]=>
  NULL
  ["exception"]=>
  array(8) {
    ["API_ExceptionextraParams"]=>
    string(39) "#0 [internal function](): ()
#1 {main}
"
    ["*message"]=>
    string(20) "Authorization failed"
    ["Exceptionstring"]=>
    string(0) ""
    ["*code"]=>
    int(0)
    ["*file"]=>
    string(103) "PATH/vendor/civicrm/civicrm-core/Civi/API/Kernel.php"
    ["*line"]=>
    int(224)
    ["Exceptiontrace"]=>
    string(4877) "#0 PATH/vendor/civicrm/civicrm-core/Civi/API/Kernel.php(150): Civi\API\Kernel->authorize(Object(Civi\Api4\Provider\ActionObjectProvider), Object(Civi\Api4\Action\Entity\Get))
#1 PATH/vendor/civicrm/civicrm-core/Civi/Api4/Generic/AbstractAction.php(219): Civi\API\Kernel->runRequest(Object(Civi\Api4\Action\Entity\Get))
#2 PATH/vendor/civicrm/civicrm-core/CRM/Api4/Page/Api4Explorer.php(26): Civi\Api4\Generic\AbstractAction->execute()
#3 PATH/vendor/civicrm/civicrm-core/CRM/Core/Invoke.php(268): CRM_Api4_Page_Api4Explorer->run((Array:2), NULL)
#4 PATH/vendor/civicrm/civicrm-core/CRM/Core/Invoke.php(68): CRM_Core_Invoke::runItem((Array:13))
#5 PATH/vendor/civicrm/civicrm-core/CRM/Core/Invoke.php(36): CRM_Core_Invoke::_invoke((Array:2))
#6 PATH/web/modules/contrib/civicrm/src/Civicrm.php(88): CRM_Core_Invoke::invoke((Array:2))
#7 PATH/web/modules/contrib/civicrm/src/Controller/CivicrmController.php(75): Drupal\civicrm\Civicrm->invoke((Array:2))
#8 [internal function](): Drupal\civicrm\Controller\CivicrmController->main((Array:2), "")
#9 PATH/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array((Array:2), (Array:2))
#10 PATH/web/core/lib/Drupal/Core/Render/Renderer.php(573): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#11 PATH/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#12 PATH/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext((Array:2), (Array:2))
#13 PATH/vendor/symfony/http-kernel/HttpKernel.php(151): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#14 PATH/vendor/symfony/http-kernel/HttpKernel.php(68): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#15 PATH/web/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, TRUE)
#16 PATH/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, TRUE)
#17 PATH/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, TRUE)
#18 PATH/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, TRUE)
#19 PATH/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, TRUE)
#20 PATH/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, TRUE)
#21 PATH/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, TRUE)
#22 PATH/web/core/lib/Drupal/Core/DrupalKernel.php(694): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, TRUE)
#23 PATH/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))

```

Anybody have an idea about this issue ?

# Answer
Following changes fix the issue,

```
diff --git a/Civi/API/Subscriber/PermissionCheck.php b/Civi/API/Subscriber/PermissionCheck.php
index bc2f18af..282b9faa 100644
--- a/Civi/API/Subscriber/PermissionCheck.php
+++ b/Civi/API/Subscriber/PermissionCheck.php
@@ -76,7 +76,7 @@ class PermissionCheck implements EventSubscriberInterface {
       $event->stopPropagation();
     }
     elseif ($apiRequest['version'] == 4) {
-      if (!$apiRequest->getCheckPermissions()) {
+      if (!$apiRequest->getCheckPermissions() || $apiRequest->isAuthorized()) {
         $event->authorize();
         $event->stopPropagation();
       }

```
> 2 votes

---
Tags: api, drupal-8
---


title: Is there a hook for address parsing?

text:
# Question
Title: Is there a hook for address parsing?
As a german user of CiviCRM, i would love to have geocoding for my addresses. But at the moment, it tells me:

> Street address parsing is enabled but not supported by your locale (de\_DE).

That's true, the core only supports following locals:

```
 $parsingSupportedLocales = ['en_US', 'en_CA', 'fr_CA'];

```

In some way it still works, but I get an info on each save of an adress, telling me it couldn't parse the address.

I would love to try to implement a extension for german address parsing. Is there any hook I can use for that?

I took a look at `org.civicoop.streetformatnl` but it's old code and overwrites the core function. And it gave me an error 500, using it with CiviCRM 5.20.1.

There are two main differences between american and german adresses:

1. We write the house number after the street: \<street\> \<number\>
2. We place the zip before the city name: \<zip\> \<city\>

# Answer
> 3 votes
Just a clarification first: Parsing is different from geocoding. If all you want is to get lat and long values filled in then regular google geocoding works without parsing.

If you really want parsing, then you might be able to do it with hook\_civicrm\_post and when `$objectName == 'Address'` you can parse and adjust the address there.

Note that just for display of zip before city you can alter that at Administer - Localization - Address Settings, but you probably have already seen that, and it doesn't rearrange the edit form, just for viewing and labels.

# Answer
> 1 votes
If you only need geocoding and no parsing, you can disable parsing by using the parameters in the geocoding scheduled task

```
geocoding=1
parse=0

```

---
Tags: geocoding
---


# Question
Title: Strange 'Permission Denied' message when browsing to CiviCRM home page
On a site I've been working on for several years, when I log in to the site, I find that when I browse to the CiviCRM home page /civicrm?reset=1 I get a weird message: "Permission Denied: You do not have permission to view this contact record. Contact the site administrator if you need assistance."

If I simply ignore it and carry on then all seems fine. In the error log I see the following lines:

```
[Tue Jan 26 10:46:17 2016] [error] [client 81.95.52.80] client denied by server configuration: /home/mysite/sites/default/sites/default/files/civicrm/ConfigAndLog/CiviCRM.b94a921de7121c494a80645638b20a34.log
[Tue Jan 26 10:46:17 2016] [error] [client 81.95.52.80] client denied by server configuration: /home/mysite/sites/default/sites/default/files/civicrm/upload/delete-this-VJYWu2ovE4
[Tue Jan 26 10:46:17 2016] [error] [client 81.95.52.80] client denied by server configuration: /home/mysite/sites/default/sites/default/files/civicrm/custom/delete-this-uYgWNHRSxL
[Tue Jan 26 10:46:17 2016] [error] [client 81.95.52.80] Attempt to serve directory: /home/mysite/sites/default/sites/default/files/civicrm/persist/contribute/

```

The files mentioned in the second and third lines above don't exist.

If anyone has any advice about how to tackle this I'd be grateful.

EDIT: CRM-18300: "Permission denied" message re contact on CiviCRM dashboard

# Answer
The errors in your log that you note are not a problem, they are CiviCRM doing a little security check for you (and succeeding).

I've seen this occasionally on my servers, and especially on my staging server. I believe that the cause is indirectly related to the errors you are seeing, in that:

1. If you're logged in, CiviCRM does a fair amount of these checks before rendering the page.
2. If you have production-type settings on a not-super-fast server, then you can get timeouts of various flavours that aren't necessarily going to show up in your apache/webserver logs.

As you probably also experience, just reloading the page will solve the issue, presumably because CiviCRM and or the webserver is using some kind of caching so it doesn't take so long.

In my case, extending the default backend timeout in my varnish configuration eliminated the problem.
> 4 votes

# Answer
I have rarely seen this error display itself when an actual permissions problem has occurred that is preventing work getting done. Normally it shows up for no good reason that I can tell. @alandixon may be right that it has something to do with server cache or delay. I've turned this situation into a positive.

My answer is to use Word Replacements feature under Administer \> Customize.

Change "Permission Denied" to "Welcome Back" and the rest of the text to "It's good to see you again." Civi is now more friendly than ever.
> 2 votes

# Answer
A client reported this issue to us recently and after some investigation we found the cause to be the way that particular profiles had been setup.

In short, any active profile with ‘View/Edit Drupal User Account’ option selected AND if you have a group selected in the ‘Limit listings to a specific Group?’ (under advanced setting of the profile) causes this message to appear when you switch from a Drupal page to a CiviCRM page.

This was reproduced on the demo site today (23rd April 2020).

Solution to resolve this issue for the client was to remove the group from the ‘Limit listings to a specific Group?’ option under advanced settings of the profile as this was not required.
> 2 votes

---
Tags: permissions
---


title: Duplicate entries in Views

text:
# Question
Title: Duplicate entries in Views
I'm using Views to display lists of CiviCRM contacts (4.5.2). I'm finding that several contacts appear in Views twice. Any ideas what might be going on here?

# Answer
The culprit is often the website field which has no filters that enable you to specify which of a number should show and hence they produce multiple rows. But like others say, it could be Address, Email or Phone if you haven't specified either the location type or Primary only. Or multiple relationships etc.
> 5 votes

# Answer
Why this is happening depends very much on how your View is set up, providing an export of the View might help us investigate.

One thing that might help is turning on the 'Distinct' option in the View, to force only one of each result appearing.

This can be done whilst editing the View, under: Advanced \> Other \> Query settings \> Tick 'Distinct'
> 4 votes

# Answer
If you use adress fields and the contact has several addresses in CiviCRM the contact will be shown several times. In that case you could configure the address fields to only show the primary record.
> 3 votes

# Answer
There is a work-around for this. Take the example of multiple phone numbers in a contact record.

1. Include the Phone Number field once for each unique type of number (Home/Mobile, Home/Phone, Work/Phone etc)

2. In Civicrm Location Display Options for each field, select unique combinations (e.g. Location Type = Work & Phone Type = Phone). Do NOT select "Show only Primary record"

3. Mark each of these fields as "Exclude from Display", and add a Rewrite Results for each one followed by a comma (e.g. Rewrite as "\[phone\],"
4. Add a "dummy" field AFTER the Phone Number fields, using any **unused** CiviCRM field (e.g. PostCode Suffix) and in this change the Label to e.g. "Phone Number(s)" and the Rewrite Results to "\[phone\] \[phone\_1\] \[phone\_2\]" (or whatever the PN fields are called).

The result should be one line in the output per contact, and the multiple phone numbers will be concatenated in the Phone Number(s) column.

Hope this works for you. Tom C
> 1 votes

# Answer
Unfortunately, *I believe* in my case because I was using Household relationships and Addresses of Employers this caused a lot of duplicates.

What did work for me was to set **Aggregation on**. Then setting Group by on your main element that you wish to not duplicate. Viola all is well!
> 1 votes

# Answer
If you are still having trouble after setting DISTINCT as an option in the View, and specifying the Location Type hasn't helped -- then a RANDOM sort order may be the issue. Because of the way Drupal views handles random as a column *as well as* a ORDER BY clause, it breaks the distinctness of the query.
> 0 votes

---
Tags: drupal-views, 4.5
---


# Question
Title: How to display only unique CiviCRM Contact Address in Drupal view?
I have a Drupal view set up to display the CiviCRM address(es) related to a given contact:

## Full view settings

## Query options

As a note, I have enabled the *Distinct* and *Pure Distinct* settings on the Drupal query settings:

## CiviCRM contact page

On the CiviCRM contact page, there are only, for example, two unique addresses:

## Duplicate addresses on Drupal view (caching?)

For some reason, the addresses are appearing multiple times on the Drupal view:

How can I ensure that only distinct addresses are shown for a given contact?

# Answer
> 3 votes
If you can't sort the above out by ensuring you specify Location type (ie have a field for Zip = Worship, as well as Zip = Mailing) then I would try the views\_field\_view module.

I would make one view that pulls together the address details for just Worship, and another one that pulls together just the address for Mailing. Both these need to be set to use Contextual Filter = contact id. And set them both to only show 1 result

Then pull those both in as a Field and obviously use the contact\_id as the contextual filter (also needs using on the two views you have to create)

# Answer
> 0 votes
Make sure you select only the address where is\_primary = 1

# Answer
> 0 votes
If you are still having trouble after setting DISTINCT as an option in the View, and specifying the Location Type hasn't helped -- then a RANDOM sort order may be the issue. Because of the way Drupal views handles random as a column as well as a ORDER BY clause, it breaks the distinctness of the query.

---
Tags: drupal, drupal-views
---


# Question
Title: CiviEvent: Scheduled Reminders going out late
Drupal 7.69 and Civi 5.23.0

We've noticed that some of our Scheduled email reminders for events set up through CiviEvent are going out late. I've looked into email logs and it looks like scheduled reminders for events are sent out once per day at 9:16am.

This causes issues for e.g. events that begin at 5pm where we want to send a scheduled reminder 2 hours before the event to remind participants -- emails like this have ended up being delivered at 9:16am the following day.

Is there any way to fix this?

Cheers

# Answer
> 3 votes
Check the run frequency of the scheduled job called **Send Scheduled Reminders** at Administer \> System Settings \> Scheduled Jobs.

It may just be set to *Daily*. Change it to *Every time cron job runs*. Then make sure your run frequency of your cron job is set to something more often, like 15 min.

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


# Question
Title: Deleting a site on WP multisite deletes civicrm uploads folder's contents
Similar to the behavior of this Upgrading WP to 5.0.1 deletes civicrm uploads folder, I had deactivated then decided to delete a site on our WP multisite. Once I clicked delete I got a fatal error (sorry I did not copy) that referenced line 916 of civicrm.php file. Deactivating CiviCRM plugin got the multisite backup.

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

```

Then I saw that the uploads/civicrm folder was empty. It had the */ext /uploads and /template\_c* folder but they were all empty. The rest were gone.

We restored the directory from backup and now it works. Anyways, this is a word of caution.

Question is, why did this happen?

# Answer
Deleting a site in WP triggers deleting sites/nn/uploads folder contents. Unfortunately, that site still had a civicrm symlink pointing to /uploads/civicrm which the delete trigger followed and subsequently deleted.

Don't use symlinks. I removed without issue. Instead you can define resource paths in civicrm.settings.php file. Will take a look at updating docs.
> 1 votes

---
Tags: wordpress, multisite
---


# Question
Title: How to limit/choose what profile data is included in confirmation emails?
We collect a lot of data from people who buy a membership using a Contribution Page. The confirmation/thank you email includes all of that data, which is a problem: some of the data we collect is not suitable for being emailed.

Is there a way to restrict/limit/choose what fields are included in the thank you emails for this contribution page?

We're on 5.24.3.

# Answer
It looks possible by editing the Workflow Message Template for online receipts. (Thanks @RebeccaTregenna for hint) This is written in Smarty code.

There are two options:

1. Remove all customPre and customPost sections.
2. Add logic to identify the fields you don't want and filter those out.

Making these changes is difficult, it's code with logic, there's no validation either, so easy to make a mistake or delete the wrong bit. **So save a copy of the original version before you make changes!**

I went for (1) for the time being because we had so many extra fields that just listing them would have been time consuming. Also, as we can only filter on the field's label, were anyone to tweak that slightly the logic would fail and that would start getting output without us knowing. Also, I wasn't sure *any* of the fields were really needed in the receipt, so I took a conservative approach (as in erred on the safe side, ~~as opposed to a *Conservatives* approach which is to err on the *unsafe* side and not take coronavirus seriously until it's too late~~)

Looking at the template code, it already includes code for selectively removing fields defined in a `$trackingFields` array, however I can't see that that is ever defined anywhere.
> 0 votes

---
Tags: civicontribute, receipts
---


title: Fields not showing when Editing Contact

text:
# Question
Title: Fields not showing when Editing Contact
Contacts have multiple emails and phone number that appear on the Summary tab on the View page and can be edited there. However when I select the edit button on a contact, I get only one email address and no phone numbers listed. The "add" links do nothing. The Display preference are checked for email and phone. This was a new recent install. Current version of 5.23.3 and PHP version 7.3.15-3. Any thought on why the additional email addresses and phone numbers are not showing on the edit page and why the"add" link on the edit page doesn't work?

# Answer
> 2 votes
An error was trace it back to a PHP issues with certain Drupal themes, specifically the one used with the drupal commerce module. Although we are not using that module, We did have the admin theme for the module installed for the admin theme. We changed that back to the standard admin theme and it appears to be working now.

---
Tags: drupal, contacts, contact-layout-editor
---


# Question
Title: Editing a submission on Drupal Webform - not updating CiviCRM
I've got a webform that creates a Case and two Contact Records (one of whom is logged in as authenticated user). I want to allow the user the ability to edit the webform.

I've tried two options:

1. Encouraging them to use this page: mysite.org/node/1/submissions

However, any changes they make are only saved in the webform, and CiviCRM Case info is not updated.

2. Providing a link \< a href="https://mysite.org/amend-individual-grant-application/?cid=\[contact\_id\_b\_\]&caseid=\[id\]"\>View submission

This is slightly odd - it prefills the information, but conditions don't appear to work (e.g. fields are hidden when they should be shown) and I have the same problem as option 1.

I wondered if it's a permissions issue - I gave permission to edit all contacts (since there is more than one contact involved) but there's no equivalent for Cases (only 'access my cases/all cases', which is not quite the same thing).

Any ideas why the information is not saving in CiviCRM?

# Answer
> 2 votes
Basically, the webform was unable to update a submission with more than one client. I've had to rethink a couple of things and rely on relationships for the second 'client' so that there is a single Client per Case.

# Answer
> 1 votes
Editing webform submissions don't go through to CiviCRM. This just changes the form submission result.

And the URL link is more like https://www.example.org.uk/formurl?cid1=11446&case1=2055. Where CID can be CID1 or CID2 etc depending on which contact(s) you want to pre load into the form. And in the form don't have Update Existing Case set if you are specifying the Case ID in the URL.

Olly

---
Tags: drupal, webform-civicrm, civicase
---


# Question
Title: Are we able to see why a payment failed?
Our contribution pages are working for some individuals and for others, payments are failing. Is there a way to see what the cause of this issue is for the payments that are unable to go through?

# Answer
There are a few places you can check.

* Foremost, I would check your payment processor's logs. Most likely the cards were sent there and declined. Make sure you don't have any configuration mismatches - e.g. not allowing credit cards from outside your country, or requiring a CVV on the payment processor but not on CiviCRM (though I believe it's mandatory in CiviCRM on the front end these days).
* Check your CiviCRM logs. Their location varies by CMS. If you're not sure how to interpret them, you may want to open a new question.
> 2 votes

---
Tags: civicontribute, payment
---


title: iATs in ESR version 5.21.3 for Joomla

text:
# Question
Title: iATs in ESR version 5.21.3 for Joomla
iATs in ESR version 5.21.3 for Joomla Does the latest ESR CiviCRM 5.21.3 for Joomla support the latest iATs 1.7.2 for Joomla? Thank you! Jamie

# Answer
> 1 votes
The iATS extension is not CMS specific. If you’re running into issues you can post in the issue queue: https://github.com/iATSPayments/com.iatspayments.civicrm and we can try help you out there.

---
Tags: iats, esr
---


# Question
Title: Customize basic find display to include membership status
When I submit a search via the "Find contacts" menu item, I would like to add our "Membership Status" to the results page. Where do I go to configure that? I can't figure out which report the basic find command is using to display results.

This is CiviCRM 5.24.5 running under Drupal 7.

Thanks.

# Answer
> 1 votes
You can not just configure that, you will need to develop a little extension to modify the behaviour.

That would mean finding out which search is involved (I think it is BasicSearch) and probably use the *buildForm* hook (see https://docs.civicrm.org/dev/en/latest/hooks/hook\_civicrm\_buildForm/) to add the column and the *searchColumns* hook (https://docs.civicrm.org/dev/en/latest/hooks/hook\_civicrm\_searchColumns/) to modify the result.

---
Tags: civimember
---


# Question
Title: CiviContribute adding $200 even to every transaction
CiviCRM 5.24.4/WP 5.4

Some freakish behavior going on with CiviContribute and Stripe processing. Based on Stripe logs, it *looks* like its originating with CiviContribute. Everything worked for at least one test transaction before I upgraded to 5.24.4, but, despite several restores and reconfigurations, I haven't been able to charge the right amount.

Here's the deal: if a user opts to make a $25 contribution, CiviContribute sends the charge to Stripe as $225. If they opt for $100, the charge is $300. Exactly $200 every time. Pretty weird.

# Answer
> 1 votes
Problem turned out to be js conflicts with Themefy popup messing up the js files in civicrm.

Disabling the plugin from /wp-admin/plugins.php?plugin\_status=all&paged=1&s removes this problem and contributions go through to Stripe as intended

---
Tags: civicontribute, stripe
---


# Question
Title: Why settings.default.json file is neglected during install?
Since CiviCRM 5.23, one can set a custom L10n/I18n resource directory. Using this feature with Aegir and Drupal 7 profiles, this setting almost works: CiviCRM sites install with selected language, using the Drupal and CiviCRM language files (.po/.mo) located now at `profiles/myprofile/translations/`.

Missing piece is that the `settings.default.json` file of CiviCRM l10n settings is not picked up during install, so its settings are neglected. The file is at `civicrm/l10n/hu_HU`, next to the .po files.

Is it a bug or am I missing something in my Aegir settings?

# Answer
> 2 votes
The solution was:

1. Add a `define('CIVICRM_L10N_BASEDIR', '/var/aegir/platforms/YOUR-PATH');` statement to `platform.settings.php` file of Aegir (see: Altering Aegir's Behaviours), to set an environmental variable for CiviCRM, to locate the exact place of its l10n files. More info on `CIVICRM_L10N_BASEDIR` here and here.
2. Correct the line breaks of the example settings.default.json, otherwise it's not being read as JSON file. The `address_format` and `mailing_format` should be one line, and `\n` have to be added when line break is required. See MR.

---
Tags: installation, i18n, aegir, l10n
---


title: Contacts unexpectedly added to group

text:
# Question
Title: Contacts unexpectedly added to group
We have about 2800+ contacts in CiviCRM, including our 16 Board members. I have a "Board Members" group (access control group) for just those Board members. I also have a mail group set up for the same members. For some reason, unrelated to any action on my part as far as I can see, I am getting our entire list of contacts added to the Board Group.

I can even go in and remove all of the contacts from the Board Group, add the contacts from the Board email group back in and verify the correct contacts are in the Board Group. If I go away for some short period of time and return to look at the Board Group, all 2800+ contacts have been put back in.

Needless to say, this is annoying and we don't really need 2800 people on the Board. Does anyone have an idea what's going on and how to put a stop to it?

Thanks

# Answer
> 3 votes
I can think of three reasons why this would happen.

* "Board Members" is a smart group. You can check this by going to **Contacts menu » Manage Groups**. If it's a smart group, it either a) shouldn't be, or b) the criteria need to be changed.
* The Board Member group is the parent of some other group. I did this by accident myself recently; you'll need to remove the parent-child link.
* Some custom magic. If you're the only administrator of the database, we can rule this out. However, I perform similar tasks all the time, either using a) cron with a SQL query, b) the SQL Tasks extension, c) a custom extension.

---
Tags: civimail, civimember
---


# Question
Title: CiviCRM Extended Security Release details
We are all-in for the CiviCRM Extended Security Release (ESR) version 5.21.3. We've been big CiviCRM fans for a while. It sounds like a great deal. We just have a few questions, which I will post on this forum. Does anyone know the proper contact person? What is the maximum number of monthly or yearly support phone calls or emails? Are there any support provider partners that can match the published ESR pricing below for small- to mid-tier? Thank you!

Jamie

Pricing https://civicrm.org/civicrm/contribute/transact?reset=1&id=64

https://www.civicrm.org/esr

# Answer
There is better information coming which will include a statement along the lines of

> While Extended Security Release provides for longer term stability and fewer upgrades for subscribers, it does not include any additional level of support over and above what is provided via the community. For organizations that need professional support, we recommend working with an expert that specializes in CiviCRM ESR.
> 1 votes

---
Tags: esr
---


title: Action Records for Civi

text:
# Question
Title: Action Records for Civi
Overarching question - Is there a way to see the actions that a specific user has performed? For example, is there a way to see what records a user has exported?

Details - We recently had an employee succumb to a phishing attack. The employee provided a username and password that could be used to access Civi. While we think that we were able to catch the problem before anything suspicious happened, we would still like to see what this user (or someone pretending to be the user) did while in Civi. We are specifically concerned about any downloaded information. We are running Civi 5.24.5 and our website is using Drupal 7.

# Answer
There is an extension which will record exports using civicrm export from contact search. Unless you have this extension installed there really isn't a way to see if there were specific exports of information.

More information on the extension can be found here
> 1 votes

# Answer
Specifically for "what records have they exported", I don't think there's an easy answer to that one. Most sites, not just civi, don't track *outbound* data.

The more general question is more of a web hosting question. For drupal specifically if you have the built-in statistics module enabled you can go to /admin/reports/hits and mostly see what pages they viewed.

For any CMS to get a full list you'd need to look at the web server logs and then look at timestamps. But again that's only *inbound* data, i.e. what they clicked on, not the actual data they viewed or downloaded. But you could see if they visited an export page.
> 0 votes

---
Tags: logs, logging, db-logging
---


# Question
Title: UK Counties list not complete - can this be amended by user or does it need to be amended in the core program?
The drop down list of UK Counties does not seem to include Middlesex. Can the drop down list be amended?

# Answer
> 1 votes
You can amend this list directly in the DB if you want to. You can find the relevant data in the civicrm\_state\_province table. To see the values for the UK use:

```
select *  from civicrm_state_province csp where country_id = 1226

```

---
Tags: contacts
---


# Question
Title: Adding Facebook tracking pixel to contribution confirmation pages
We're on Drupal 7.69 and CiviCRM 5.13.x.

One of our clients want to add facebook tracking pixel codes to the membership confirmation page after payment.

We are using the Facebook Tracking Pixel Drupal module (https://www.drupal.org/project/facebook\_tracking\_pixel) to add the base tracking for the website and for webform confirmation pages. Would someone be able to help inform me on using the same module for CiviCRM confirmation pages?

Thanks

# Answer
You can add the code using one of the below method

1. Use buildform hook to add JS code using region method.
2. Add pixel code in CRM/Contribute/For/Contribution/ThankYou.extra.tpl in your custom template directory.

Note: Won't be difficult to make it generalized for each contribution page and also have it extended to event registration.
> 1 votes

# Answer
So instead of using the Drupal facebook pixel tracking module or customising the Thank You tpl file, we decided to use Google Tag Manager to create tags for Facebook pixel.

That way, we were able to set up tracking for pixel throughout the website and also on the Civi Pay Now buttons to capture payments.
> 0 votes

---
Tags: civicontribute, extension, facebook
---


title: DB Syntax Error: CiviMail

text:
# Question
Title: DB Syntax Error: CiviMail
Drupal 7.69, Civi 5.23.0

A colleague just had an issue with CiviMail. She was trying to send a mail to Group "Volunteers" but exclude people in Group "Garden Volunteers". Instead of saying the number of recipients, it just froze on "Estimating..."

It still says estimating even if saving the draft and exiting.

When we try to submit the mailing, it gives a DB Syntax error.

I checked the Drupal error log and saw two relevant errors.

Pastebin link 1 | Link 2

I ended up fixing this by just creating a new mailing with the same settings and it worked fine, but would love to work out why the initial issue happened so I Can fix it pre-emptively in case it happens again in the future.

Flushing cache did not solve it.

Cheers!

--

EDIT It's happened again, looks like it's just an issue with one particular smart group. We've definitely mailed to this smart group in the past though.

Someone previously asked what I see when clicking on the spanner icon:

# Answer
> 0 votes
The DB error looks to be caused by this clause: `(civicrm_email.location_type_id != )`

I don't know why that is occurring but check anything related to location types. Are you using flexmailer/Mosaico? Do you have any extensions installed that relate to mailing or email address locations?

---
Tags: civimail, error
---


# Question
Title: Thank You Mailing for Permissioned Relationship after Renewal
I'm trying to setup a scheduled reminder to send a Thank You message after a membership is renewed. **Note that this is for organisation memberships**

I only want this message to go to the permissioned primary contact that logs in and renews the membership.

I know that I can use the Membership entity in scheduled reminders to send the Thank You message for new members using the **Membership join date option**. This correctly send the Thank You message to the permissioned primary contact.

However, I don't have an option when using the Membership entity to configure it to send the messsage after a membership is renewed.

I can use the activity entity but that would send the thank you message to all the related employees and not just the permissioned employee.

Does anyone have any workarounds for this?

Thanks

# Answer
> 2 votes
As mentioned by Rebecca, try creating a smart group based on your condition for choosing recipients. Use Membership Renewal activity for sending reminders ad limit the recipients to 'select group'.

# Answer
> 1 votes
Maybe try creating a smart group for primary members only and then limit the recipients for the selected scheduled reminder to that group.

# Answer
> 0 votes
The Email API extension has an action to send an email to a related contact. Provided that your primary contact has a different relationship type than the others, you could use CiviRules + Email API to send the email.

---
Tags: civicontribute, renewals
---


# Question
Title: What is the best way to disable the jquery.crmEditable.js file in CiviCRM without modifying the core common.js file?
We have a use case whereby certain users should not be able to edit certain rows of custom data.

CSS selectors can hide the "Edit" links for these rows, but the inline editing (i.e. clicking on the value in the table cell) is not easy to override.

We have commented out the function in civicrm/civicrm/js/common.js where the jquery.crmEditable.js file is loaded, however this introduces limitations to many of the administrator functions and is not ideal.

Is there a better way to disable the jquery.crmEditable.js functionality without modifying core code, e.g. with a custom template?

# Answer
> 1 votes
You can setup ACL to restrict custom group edit to certain group contacts. This will stop them to update the custom field data and only view it.

---
Tags: custom-fields, custom-templates
---


# Question
Title: Is there a hook for writing a record to an export batch?
My organization uses QuickBooks Online Plus, and implemented the Classes system. We also use Campaigns as Campaigns in CiviCRM, so all the previous solutions do not work for us.

So, we came up with a possible solution, but it would require a change to the export function. We are thinking that we use the Financial Account name to hold both the Account Name and the Class Name. For example, we have two Financial Accounts: Member Dues:National and Member Dues:Chapter. The colon separates the account from the class. But for this to work in the export, I need to get the journal entry transaction before it gets written.

We can't use the Campaigns feature for this because we do have fundraising campaigns as well as petitioning and membership campaigns. The name seems to be our best solution, but we're not sure how to get it to work. It's beginning to look like it would be a patch to core. ::shudder::

# Answer
Yes, its possible to alter the content of exported files. Either you can create your separate export type or can use combination of hook\_civicrm\_batchItems and hook\_civicrm\_batchQuery
> 1 votes

# Answer
What I ended up doing was customize the template for the iif export: \[civicrm.template\_dir\]/CRM/Financial/ExportBatch/iif.tpl

And the ExportFormat BAO: \[civicrm.php\_dir\]/CRM/Financial/ExportBatch/iif.php

We enter the Financial Account name now as: \[Account Name\].\[Class\]

This was decided because the colon and slash were used in Account Names. The PHP file breaks out the class from the Account Name, if used. Otherwise the Class name is NULL.

The template then exports the class name in the appropriate column. And the iif file properly imports.
> 0 votes

---
Tags: financial-accounts, quickbooks
---


title: Civi is slowing down my website

text:
# Question
Title: Civi is slowing down my website
Our website is hosted on Drupal 7 but is tied to our database in civi 5.14. We are experiencing a surge in new registrations which require people to fill out a full page of information that then gets tied into our database. This is causing massive delays on our site. How can we optimize civi to improve the speed of our site or reduce the strain?

# Answer
1. You're on an insecure version of CiviCRM, you'll want to update it.
2. Page caching is not going to help, because form interaction is not (page) cached.
3. I'll assume you've got the usual production caching on, but if you don't, then start there.
4. If your site is otherwise reasonably responsive, your server is probably running out of resources, either cpu or RAM. You may be on a customized service that has implicit limits the number of concurrent connections (e.g. limiting the number of apache processes/children), or (more likely) you've hit a memory limit and your application is swapping memory to disk.
5. If you have no way of changing the server or operating system parameters, there's probably not much you can do.
6. In general, the best way to increase your form interactivity behaviour is going to be using some kind of RAM-based caching (Redis or Memcache), but that's a server thing, not something you can setup purely within Drupal or CiviCRM.
> 2 votes

---
Tags: drupal, webform-civicrm, database, performance
---


# Question
Title: “Missing parameters” error in unsubscribe confirmation
Unsubscribe is giving an error with Drupal 7.69 and CiviCRM 5.23.4. We did not have any issues or errors during the upgrade process.

Unsubscribe links from mailings load the confirmation page correctly, with the correct partially obscured test\****@domain.org. But when I fill in the email address and click Unsubscribe, it displays:

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. Missing Parameters

The unsubscribe page is loaded with this URL:

https://domain.org/civicrm/mailing/unsubscribe?reset=1&jid=3590&qid=1037445&h=c38ef80808cc0140

We included the unsubscribe link in our CiviMail mailings as follows:

```
<p><a href="{action.unsubscribeUrl}" target="_blank">Unsubscribe from this list</a></p>

```

Log shows this message:

```
$Fatal Error Details = array(3) {
  ["message"]=>
  string(18) "Missing Parameters"
  ["code"]=>
  NULL
  ["exception"]=>
  object(CRM_Core_Exception)#2268 (10) {
    ["errorData":"CRM_Core_Exception":private]=>
    array(1) {
      ["error_code"]=>
      int(0)
    }
    ["cause":protected]=>
    NULL
    ["_trace":"PEAR_Exception":private]=>
    NULL
    ["message":protected]=>
    string(18) "Missing Parameters"

```

# Answer
> 1 votes
It appears this issue is fixed in CiviCRM 5.24.5. We upgraded and re-tested and unsubscribe now works.

# Answer
> 0 votes
This will be fixed in PR #17081 and will be part of 5.24.3. You can either wait for the release or apply patch from here.

---
Tags: email, unsubscribe
---


title: emails to gsuite addresses bounce

text:
# Question
Title: emails to gsuite addresses bounce
I am having trouble sending email to addresses in our own GSuite domain. They bounce with a "syntax" error, and the addressee gets flagged as ON HOLD.

Using CiviCRM with Wordpress, current versions.

Any ideas, friends?

# Answer
> 2 votes
Sending emails that appear to come from within the organization but are from an outside server is a common scammer's tactic, and Google is much quicker to not deliver these emails. To get delivery, you'll need to configure an SPF record. This will improve all-around deliverability - but is 100% required for delivering to your own domain when using GSuite.

---
Tags: civimail, mailing
---


# Question
Title: Will all contacts be delieted with an uninstall?
I have 1.3 million contacts in CiviCRM 4.6.34, but the contacts are outdated. I want to remove all the contacts completely, but cannot find an easy way to bulk delete all the contacts. I also want to upgrade to the latest CiviCRM version because 4.6.34 does not support CiviMobile... Which means I also have to updgrade Joomla from 2.5 to 3.x, which means I also need a new template compatible with 3.x. Anyway, we don't need the 1.3 million contacts currently housed in CiviCRM. We have an updated list of voters (also about 1.3 million) which we will do as a clean import into the newest CiviCRM version on the latest Joomla. I think this makes more sense than overwriting 1.3 million contacts with 1.3 million contacts. Also, we may very well have to pay to migrate our site from Joomla 2.5 to 3.x, and if we have to migrate 1.3 million contacts, it will probably be a rather expensive migration, moreso than if remove the contacts pre-migration. Since we are upgrading everything and need to install a newer version of CiviCRM anyway, will all the contacts be permanently deleted when CiviCRM 4.6.34 is uninstalled? If so, I think that would solve everything. If not, what is the best and cleanest way to eliminate all the contacts? Very little has been done with the contacts since they were uploaded anyway, so I don't believe there are really many (or any) tables to which they are copied on. They are uploaded as part of a 'group,' but otherwise there has been hardly any extra data added in after the fact. Thanks for the help.

# Answer
> 1 votes
welcome to CiviCRM Stack Exchange. As you probably gathered from the comments from @Demerit and @petednz, if you start from scratch with a new version and "just" uninstall and remove the previous version the contacts will disappear from CiviCRM.

It is hard to judge if they will disappear from your website without knowing your website. I do not know if for any reason users were stored in Joomla or other contact data, but you will certainly lose all the CiviCRM data.

The safest option would be to start from scratch, so get a different spot to install your new Joomla and CiviCRM. Then you could just remove your old folders and databases from your webserver once you are happy with the new situation?

Good luck!

---
Tags: contacts, joomla, delete
---


# Question
Title: How can I create a Drupal page with an automated feed for all the events?
I would like to create an automated feed for all the event we create in CiviEvent, and want to show that on a themed drupal page. I want to feed all info, image that we create during event craetion and a button to register.

Is that something easily achievable?

Thanks in advance.

# Answer
Have you looked at the existing Event feeds? Go to Events \> Manage Events and you'll see icons and help for iCalendar, HTML & RSS feeds. You'll need to look at how you display those feeds but the data about events is there.
> 2 votes

# Answer
Another option, depending on your set up, would be Drupal Views, there's detail in the documentation

https://docs.civicrm.org/sysadmin/en/latest/integration/drupal/views/
> 2 votes

---
Tags: civievent, drupal
---


title: Filter mailing list by country

text:
# Question
Title: Filter mailing list by country
Could you tell me how I can filter a group/mailing list we have to view by certain countries? For example we have a 'Youth Collective' lsit but we'd like to filter this by addresses to see all that are from the UK.

Thanks, Megan megan@restlessdevelopment.org

# Answer
> 1 votes
You can do this via the advanced search:

Select the group you want to include in the 'Basic Criteria' section and then the country within the 'Address Search'.

---
Tags: mailing
---


title: Using the cron facility

text:
# Question
Title: Using the cron facility
I have unsuccessfully been trying to get the cron facility to work and would like someone to help me please.

I am working on a Joomla 3 site. The CP provides a facility to create a cron job which needs the timing codes (no problem there) and the command line. OK, so I insert a command line which points to the cron.php file and passes the three parameters in the URL i.e. http://www.zoolake.co.za/administrator/components/com\_civicrm/civicrm/bin/cron.php?name=username&pass=password&key=site-key&task=who\_knows\_what (I used the correct username, password and site-key)

As the parameter names given in the documentation are not correct (I examined the cron.php file to establish the correct names) I changed them to the ones shown above. However, I don't know what to put into the job parameter and the documentation is silent on that. I have tried "job.execute" but that produces an error. I have copied the link from the manual link on the schedule jobs page, but that too doesn't work. Please can someone help?

# Answer
I have got it sorted. I had made the following errors: 1. The command line doesn't need the parameter "task", so only the first three. This worked when I used that amended URL as a url in a browser but then I had to include it in the control panel of the hosting site. 2. For the cron job facility provided by the hosting site in the control panel, I had to change the url to: home/public-html/components/com\_civicrm...etc. Then it all worked well!
> 1 votes

---
Tags: cron, scheduled-job
---


# Question
Title: My custom reports work fine, but mail_report fails
All of my custom report mail\_report jobs give this error, both through cron and when triggered manually:

> "Did not find valid instance to execute"

The report is defined as

```
class com_foo_bar extends CRM_Report_Form {

```

It is stored as an extension in

```
[civicrm.files]/ext/custom

```

For example, report 70 works fine in a webbrowser .. it is at

https://mydomain.com/bla/civicrm/report/instance/70

But the mail\_report job log says

> Entity: Job Action: mail\_report Summary Finished execution of yyy with result: Failure, Error message: Report Mail Triggered... Did not find valid instance to execute Details
>
> Parameters raw (from db settings): instanceId=70 format=csv
>
> Parameters parsed (and passed to API method): a:3:{s:7:"version";i:3;s:10:"instanceId";s:2:"70";s:6:"format";s:3:"csv";}
>
> Full message: Finished execution of yyy with result: Failure, Error message: Report Mail Triggered... Did not find valid instance to execute

The same happens when called from the command line. If job.mail\_report is called on a regular report, it returns results. But if it is called on my custom reports, it returns

```
$ drush -u cron civicrm-api job.mail_report instanceId=70 format=csv sendmail=0
Report Mail Triggered...                                                                                [error]
Did not find valid instance to execute
Array
(
    [is_error] => 1
    [error_message] => Report Mail Triggered...
Did not find valid instance to execute
)

```

or

```
$ php bin/cli.php -s mydomain.com -u cron -p XXXXXX -e Job -a mail_report --instanceId=70 --format=csv --sendmail=0
Report Mail Triggered...
Did not find valid instance to execute
Died during callApi

```

Any ideas ?

# Answer
> 1 votes
What doesn't help, is that the code for Report.php:402

https://github.com/civicrm/civicrm-core/blob/master/CRM/Report/Utils/Report.php#L402

requires

```
if (strstr(CRM_Utils_Array::value('name', $templateInfo), '_Form')) {

```

and otherwise

```
  $is_error = 1;
  // ...
  $messages[] = 'Did not find valid instance to execute';

```

The 'name' reported for my custom report is more like

```
com.foo.bar

```

.. is that a bug, or some requirement I missed ?

---
Tags: email, civireport, cron, 5.15.2
---


# Question
Title: dedupe rule using birth date is not working using drupal
A dedupe rule using birth date is not working with drupal CMS. I receive the message "unknown error, please contact your administrator". The rule is working well in WordPress

# Answer
> 1 votes
This sounds odd since it should not be CMS related. I tested on dmaster - set up a DoB based rule, it worked

Link is below but will be removed when site next rebuilds in a few hours

https://dmaster.demo.civicrm.org/civicrm/contact/dedupefind?reset=1&action=update&rgid=8

Is it possible you made an error setting up your Rule?

---
Tags: duplicate-contacts
---


# Question
Title: GiftAid extension 3.1.0 compatible with CiviCRM 5.x?
I'm running WP 5.4 / CiviCRM 5.24.3 / php 7.3.16 / gift-aid-extension 3.1.0 / uk-hmrc-online-gift-aid-submission 1.7.3

Just going to do my first GiftAid submission (now that I have some donations to claim), and the extension isn't working - drops straight to the default admin console.

Looking at the extension info page, and civi-5.0 isn't listed for ver 3.1.0 (though it is listed for 3.0.4). It this a typo on their part, and a reinstall on mine, or did something break with 3.1.0? https://civicrm.org/extensions/gift-aid-extension-uk

# Answer
> 1 votes
Yes, version 3.1.0 of the Gift Aid extension (from Compucorp) certainly works with release 5.19.x and 5.24.x. As you've obviously upgraded fairly recently then try clearing caches?

# Answer
> 0 votes
Clearing caches (after upgrading to 5.24.5) did the trick, thanks.

---
Tags: wordpress, gift-aid-extension
---


# Question
Title: How can I submit WordPress forms to a REST URL?
I've been directed here to ask this question, I've been asked if WordPress contact forms/forms can post to a REST URL rather than to the WordPress database. Now I'm not really familiar with CiviCRM tbh but we were wondering if there were any plugins that could achieve this? Any advice please.

# Answer
You can use Contact Form 7 and the Contact Form 7 CiviCRM plugins for wordpress to `POST` your forms directly to CiviCRM's REST API. There is a blog post by Erik Hommel on CiviCRM.org that explains how this works.
> 1 votes

---
Tags: wordpress
---


title: Server transfer CiviCRM search problems

text:
# Question
Title: Server transfer CiviCRM search problems
We have just transferred a Wordpress installation of CiviCRM 5.21.0 to a new server, but all of the search functions are failing. In advanced search, when I attempt to open for example, "Address", the following error appears and repeats itself on some kind of loop:

"Because your session timed out, we have reset the search page."

The Address option then just opens up another "Search Criteria" section underneath.

The parameters in the looping message are: page "CiviCRM" q "civicrm/contact/search/advanced" reset "1" snippet "json"

I've checked the database connection and that seems fine, it is returning the correct numbers of results in saved search smart group lists, but when I click "contacts" on the lists it shows no results, just the same error.

# Answer
I found the problem, the session save path in .htaccess was different from the one in the new CPanel.
> 5 votes

---
Tags: search
---


# Question
Title: cli.php can only be run from command line
Using WordPress 5.4 and CiviCRM Version 5.18.4. Hosting with InmotionDirect, managing via Cpanel.

Trying to follow the instructions to set up our cron job. I got the command line to work, finally, as: php public\_html/wp-content/plugins/civicrm/civicrm/bin/cli.php -s \[site\] -u \[user\] -p \[password\] -e Job -a execute

It worked, and I thought I was done. Plugged it into the Crom job list in Cpanel and sat back.

Error via email: "cli.php can only be run from command line."

Well, nobody mentioned that in the instructions. Is that a universal rule, or is just my hosting service being fussy?

Based on an answer here (Setting up cron jobs on cPanel) I tried putting the command line in a file and having the cron job command be just sh thatfile. Same error.

Is there a workaround? Or do I have to manually install yet another program like wp-cli just to run my jobs?

# Answer
Well, I seem to have resolved it by replacing cli.php with cron.php in the command line. Of course it didn't do anything when I ran the command from the terminal, but I plugged it into the cron jobs list and it seems to be executing the jobs now. I am just lucky I spotted the "cron.php" file in the bin folder, and took a chance on it being what I needed.

My sympathies to any novice like me who has to set up Cron Jobs for CiviCRM -- the instructions may make sense to a Linux expert or php programmer, but to complete this simple and essential task, it has taken me months.

Thanks for your help, folks!
> 1 votes

# Answer
I think this is maybe the same as https://stackoverflow.com/questions/10886539/why-does-php-sapi-not-equal-cli-when-called-from-a-cron-job

The key line is `Do not always expect /usr/bin/php to be a link to php-cli binary`.

Meaning: In your cron command give the full path to the exact version of the php binary that you want, which might be something like `/usr/bin/php-cli`. I'm not familiar with InmotionDirect, but they probably have `php` linked to `cgi-fcgi`, so you need to find the right full path to the cli version of php. I'm sure InmotionDirect can tell you. Possibly this: https://www.inmotionhosting.com/support/questions/communities/1/topics/10968-using-cli-version-of-php-with-cron
> 0 votes

---
Tags: wordpress, cron, cron-job
---


# Question
Title: Create forwarding email address for mailing to members of a group
Is it possible to create a custom email address which forwards to all members of the organisation, or all members of a group? Perhaps via Inbound Mail Handling? *edit - perhaps Civi or Drupal Rules?*

This would enable a non-tech savvy Secretary to email all members (or another group) from their own email client via the custom email address rather than via CiviMail interface, and each email only go to current members of the organisation.

# Answer
This problem has two parts - getting the email into Civi, and sending it out again to people in a group. The first part is definitely going to be done with Inbound Email Handling if the person will be using their email client.

For the second part, I like Tim's idea of integrating with Sympa or Mailman, but unless you need the full-blown list management software, it seems like overkill.

Pete's CiviRules answer should be correct; however, just this week I tried doing almost the exact same thing (redirect incoming SMS to a team's email) but I couldn't get the tokens to work. My client was on a tight budget so rather than troubleshoot I just repurposed an existing extension. I would try this CiviRules approach first.

Another approach would be Scheduled Reminders (**Administer menu » Communications » Scheduled Reminders**). You could set a reminder to trigger on an "Inbound Email" activity, and use the **Select Group** dropdown to pick the group. Your token would just be `{activity.details}` to pick up the message body. If you do this, you should make sure your cron runs reasonably frequently. You would also want to increase the frequency of the *Process Inbound Email* and *Send Scheduled Reminders* jobs under **Administer menu » System Settings » Scheduled Jobs**.
> 2 votes

---
Tags: email
---


# Question
Title: Is it possible to use Civimail without unsubscribe / opt out option?
Our organisation uses Civimail to communicate with our members on a regular basis. Email is the only realistic way we have of communicating with them and informing them of legal notications, ballots etc as well as news and alerts. The presumption is that in ajoining as a member they agree to receive email communications from us.

A number of members use the opt out link on our mailings which then means they no longer receive any communication at all from us as their email address is now disabled in Civi.

Is there a way of either removing the opt out / unsubscribe links since by accepting membership they have opted in or a way of getting round the issue of members who have cut themselves off from the organisation they have joined.

We are using CiviCRM 5.14 Drupal 7

# Answer
Pete's answer is technically correct, but from a user experience perspective - these folks are choosing to opt out, and there should ideally be a middle ground that meets everyone's needs.

My assumption is that you have mailings that *must* reach the members - legal notices, etc. - and then some non-mandatory communication (e.g. a newsletter) which is what folks opt out of.

If that's the case:

* Create one (or more) additional groups - mandatory communications, newsletters, special offers, etc.
* Add all the members to all the groups.
* Use the "unsubscribe" token rather than "opt out" token.
* Send mailings from the appropriate group.

With this approach, someone who opts out of one type of communication doesn't opt out of another.

You can combine this with Pete's approach and use a template that includes an "Unsubscribe" where it belongs, and omit it on mandatory communication.
> 1 votes

# Answer
Yes you can. There is an override option under Admin \> CiviMail \> CiviMail Component Settings

ie at civicrm/admin/setting/preferences/mailing?reset=1

> **Disable check for mandatory tokens**
>
> Don't check for presence of mandatory tokens (domain address; unsubscribe/opt-out) before sending mailings. WARNING: Mandatory tokens are a safe-guard which facilitate compliance with the US CAN-SPAM Act. They should only be disabled if your organization adopts other mechanisms for compliance or if your organization is not subject to CAN-SPAM.
> 2 votes

---
Tags: civimail
---


# Question
Title: Why does searching by contribution source use always the "Like" statement?
I'm currently using CiviCRM 5.21.1.

When I try to search for contributions by typing specific "Contribution Source" under "Contributions -\> Find Contributions", it shows me all contribution records which contribution source is not only just "ABC" but also "ABCD" and "ABCDE".

This is because "Find Contributions" searches with a "**Contribution Source Like ABC%**" condition, not "**Contribution Source = 'ABC'**". In other words, for the search, a wildcard was attached automatically at the end of the word and the "Like" statement was used in the search condition instead of an equal statement.

I know that I can find the list what I want by using "Search Builder" but I want to get the numbers of Total Amount and Average, so I need to use "Find Contributions".

Does anyone have the same issue as me? Please, help me.

# Answer
> 1 votes
The reason is because Civi is trying to accommodate less tech-savvy folks than yourself :)

I recommend CiviReport - either Contribution Details or Contribution Summary reports. That will let you control the operator, give you the total/average, and in the case of Contribution Summary, allow you to aggregate in other ways - e.g. total/average by month, or by financial type.

---
Tags: contributions, search
---


title: My membership fee changes year to year

text:
# Question
Title: My membership fee changes year to year
My organization revise membership fees for every 3 years,

eg: gold membership - 2010 - $100, 2013 - $105, 2016 - $120, 2019 - $130

Silver membership - 2010 - $75, 2013 - $80, 2016 - $85, 2019 - $100

if Gold member in arreas from 2015 = $105(2015)+ $120\*3(2016-2018) + $130 (2019)

then how can I assign membership types and caculate arreas ? how can I change the membership fee year to year in CiVi (can assign 'member price sets' according to membership types and calculate arreas?)

# Answer
> 3 votes
You can change the membership price whenever you want - you don't even need to charge everyone the same amount.

When you record a membership from the back end, you can enter any price you want - simply select **Record Membership Payment** on the New Membership screen and enter the amount. If you set *Contribution Status* to **Pending**, it will show the contribution as owed rather than paid.

On a public-facing page, yes, you can use price sets to set the cost every year.

Because each contribution is stored separately, it's OK that they're different from year to year. You can see which payments have been made and which haven't.

This will meet your needs going forward. However, if you start using CiviCRM in 2020, and you have current members in arrears from 2015, that's not going to be calculated. I would recommend importing pending calculations for each missing payment. You could use your spreadsheet software to calculate owed amounts if necessary.

Consider installing the Membership Extras extension. Without it, a member who pays for 2020 but has not paid previous years is considered a current member; with the extension, a member who has paid the current year but is still in arrears can be considered non-current if you like.

---
Tags: civimember
---


title: CiviCRM Spark Localization Change

text:
# Question
Title: CiviCRM Spark Localization Change
I'am a totally beginner. After signing-up to CiviCRM Spark for evualating I expected the web-Site to be in German, but it's all in english. How Can I change the language to German?

# Answer
> 1 votes
Uli, Welcome to CiviCRM stack exchange.

You can change the language by navigating to CiviCRM \>\> Administer \>\> Localization \>\> Languages, Currency, Locations

Change the default language to German.

---
Tags: language
---


# Question
Title: Custom fields are not pre-populating on profiles added to events, membership, contributions, etc
I have some custom contact fields that are not pre-populating the fields on event registrations, memberships, contribution pages, etc. Other fields in the profile pre-populate. When I use the profile in edit mode, the custom fields pre-populate as usual.

This is a fairly new thing, a few months ago, this was not an issue.

Latest Civi/WP

# Answer
> 2 votes
Try applying patch from below PR

https://github.com/civicrm/civicrm-core/pull/16991

https://github.com/civicrm/civicrm-core/pull/16981

HTH

Pradeep

---
Tags: civicontribute, civimember, profile, registration
---


# Question
Title: Session variables destroyed while making contribution through webform in Drupal 8
I'm not sure this is the best place for this but really needing some assistance with this.

Using Drupal 8.8.5 and CiviCRM 5.24.3 along with webform 5.9 and the latest version of webform\_civicrm.

This is only a problem when not logged in. If an anonymous user makes payment through a webform (linked to a contribution page that uses an omnipay payment processor), when the user is redirected back to the website it lands on the IPN url with a white screen. It should redirect to the confirmation page but at this point the session variables no longer exist. (Including the url needed and anything I store in $\_SESSION)

When making a payment directly through the CiviCRM contribution page there is no problem. And interestingly, if the contribution page is merely visited in the browser first, the webform will then also work correctly and will keep working correctly. Clear the cache in the browser and the webform will again have a problem.

I'm really in the dark with this kind of thing, anyone have any ideas?

# Answer
> 2 votes
I think session issues sounds more like a D8/CiviCRM configuration issue rather than a D8WFC module issue.

I just confirmed that D8WFC can do live payments (authenticated and anonymous) with iATS Payments. I'm sorry we don't use any Omnipay processors with any of our clients so I can't try to confirm your scenario. Perhaps check on Mattermost -\> chat.civicrm.org Drupal channel to see if you can find others who can reproduce this. Some folks in that channel are system administrators themselves and may be able to help.

Here's an example of a live-payment -\> with a Confirmation that all lands in the database using D8 CiviCRM Entity:

# Answer
> 1 votes
I narrowed the issue down to what goes on in initialize() in civicrm-core/CRM/Core/Session.php. When calling the contribution page directly resetScope() is called, which calls initialize() without any argument. When going through webform only createScope() gets called with $isRead set to TRUE every time. This means initialize() is only ever run with $isRead TRUE which means this code never runs:

```
if (!isset($this->_session[$this->_key]) ||
  !is_array($this->_session[$this->_key])
) {
  $this->_session[$this->_key] = [];
}

```

And that seems to make all the difference.

As a quick fix I've added

```
\CRM_Core_Session::singleton()->initialize();

```

to alterElements() after the other initialize() in webform\_civicrm/src/Plugin/WebformHandler/CivicrmWebformHandler.php. This works but if anyone knows the "right" approach here please let me know.

---
Tags: civicontribute, webform-civicrm, drupal-8, omnipay
---


# Question
Title: Where to get PDF copies of CDN tax receipts?
How can I find, search and access tax receipts that have been issued in a PDF format? Where and how do I do that?? I want to be able to attach a PDF copy of a TR to send to client.

# Answer
Welcome to StackExchange!

In the Configuration for the CDN Tax Receipts Extension -\> look for archive email address. That’s where carbon copies of any issued Tax Receipt will go.

If you want a copy becuase you want to re-issue a Tax Receipt then (when viewing the Contribution) hit the Tax Receipt button and then hit re-Issue.
> 4 votes

# Answer
When a Tax invoice is downloaded or emailed Civi creates activity of type Download Invoice or Email Invoice respectively. So if you do a Find Activity on Download Invoice or Email Invoice and view the respective activity you will see file link in attachment section.

If you need a report to list those attachment than you can use guidance from this post How do I search for Activity Attachments?

HTH

Pradeep
> 0 votes

---
Tags: cdn-tax-receipts
---


# Question
Title: Can CiviRules add a contact to an event?
I've had a situation where we needed to offer a recurring payment possibility for an event. Hmmm... This is not at all native to CiviEvent as far as I can see. (I looked into using Webforms, as well as Repeating Events.)

The plan was to make a contribution page to create the recurring contribution subsription. So far so good! And then make a CiviRule to detect when a payment has been made as above. That's fine too.

And then use CiviRules to add the person to a specific event, preferably along with a statement in the Participant Fee Level fee.

However, it looks like CiviRules is not yet set up to registering people to Events. Is that true?

Thanks for your help.

Civi 5.24, Drupal 7.69.

# Answer
Not at present - I've investigated this myself in the past. You can find a complete list of actions in their repository (though of course other extensions add actions).

I considered writing the action but it turned out to be complex. A rule that adds everyone to a pre-determined event is easy enough - but creating a UI that could handle actions like "Add contact to the next workshop" proved trickier and not worth the effort (for me, YMMV).
> 2 votes

---
Tags: civievent, recurring-contributions, civirules
---


# Question
Title: API CSV Import -> for ActivityContact -> invalid value for record_type_id
Using API CSV import to try add entries to the civicrm\_activity\_contact table -\> running out of ideas as to what I need to use for record\_type\_id (see screenshot) - any other ideas are welcome! Trying to get a GUI solution for a client.

# Answer
> 2 votes
API explorer says "Activity Assignees". And as noted in comment it must have the upper case A's.

---
Tags: import, activities
---


title: Cron Job User Permissions

text:
# Question
Title: Cron Job User Permissions
Is it possible to run a cli.php without user and password if cron owner has sufficient privileges? Having added it my Joomla dashboard is over run with entries for the cron user logging in. The user I created I didn't give any special acl but it seems to work. I'm assuming due to my cron rights. Suggestions? Thanks Wallace

# Answer
> 0 votes
I'm not clear exactly what issue you're wanting to address here, but you might want to look at running 'cv' from cron instead of cli.php/cron.php. That does not require a password and will not record as a login.

See https://docs.civicrm.org/sysadmin/en/latest/setup/jobs/#cv

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


# Question
Title: private notes: how to restrict visibility to a certain group?
private notes is very usefull , but I miss the functionality to restrict visibility to a group of users. Is there a way to realise this in civicrm or is it necessary to make a new extension?

# Answer
You might want to try this extension: https://github.com/AlainBenbassat/eu.businessandcode.notepermissions

It creates a permission in your CMS for each note type you create in CiviCRM. You can then selectively assign these permissions to users who have to see the corresponding notes.

The extension has not been extensively tested, so I'm looking forward to user feedback.
> 2 votes

# Answer
At the moment it is necessary to make a new extension AFAIK.
> 0 votes

---
Tags: privacy
---


# Question
Title: "Failed to execute rule" - Civirules error, How to solve?
I have a set of civirules in places, when a contact is tagged it should send a welcome email. But I am keep receiving the following error message in log and welcome email is not sent. It happens for new & existing contacts. Anyone has a clue what is it? How to fix it please? Thanks.

Log in Drupal:

```
Civirules api action exception: Mandatory key(s) missing from params array: source_contact_id. API call: Email.send with params: from_name="Email from", from_email="abc@example.com", template_id="108", location_type_id="1", alternative_receiver_address="test@me.com", cc="", bcc="", file_on_case="", contact_id="8949", extra_data="Array"

```

Log in Civirules Logger:

```
    Array
(
    [line] => 77
    [file] => /home/webadmin/public_html/cmm/sites/default/files/civicrm/ext/org.civicoop.civirules-master/CRM/CivirulesActions/Generic/Api.php
    [exception_message] => Civirules api action exception: Error sending e-mail to Katie Lost  . API call: Email.send with params: from_name="from name", from_email="abc@example.com", template_id="108", location_type_id="", alternative_receiver_address="", cc="", bcc="", file_on_case="", contact_id="9688", extra_data="Array"
    [rule_title] => Welcome Emails Workflow
    [original_error] => Error on {file} (Line {line})

{exception_message}
    [reason] => Failed to execute rule
)

```

# Answer
Can you try after applying patch from here may or may not be related!
> 1 votes

---
Tags: email, civirules, message-templates, tags
---


# Question
Title: Restrictions and Limitations for CiviSpark
I very recently signed-up to CiviSpark Hosting Plattform to evaluate it for future use by our organistion. Early on the way I stucked by some limitations of that Version, first of all:

1. The localisation/ language can't be changed as desired
2. Only Users with the Admin Role selected in CiviCRM can access the CiviCRM-Site

Does anybody know how to get detailed information about the limitations, restrictions and functional differencies of the Civi Spark hosted Version compared to the "native" CiviCRM

# Answer
> 2 votes
The sign-up page says:

* Store up to 2000 contacts
* Send up to 5000 emails per month
* Payments are only supported with three processors: PayPal, Stripe and iATS
* The interface is available in many languages.
* A few other configurations are disabled by default, such as Households and some Location Types
* It is not possible to enable other extensions than the ones provided by default.

If you can't do something on Spark, it's worth clarifying on the Spark channel on Mattermost whether it is an intentional limitation or just a problem with your setup.

---
Tags: documentation, civicrm-spark
---


# Question
Title: Number of zero after colon in Price field
Is there a way to reduce the number of 0 after colon in a simple price field in the backend?

For example, this is what I see in Price Fields Window.

I read this post and JonG's answer but I'm not working on a simple donation.

I use CiviCRM 5.19.3 on Drupal 7.67 and currency is euro.

Regards,

Guillaume

# Answer
1. The backend isn't exposed to the visitor, so you might just not worry about it.
2. There is a good reason to have currency showing to what might seem an excessive number of places: taxes! For example, a membership price on that screen would be showing the amount exclusive of taxes, and if you lived somewhere that typically shows prices with tax included, then you might want a membership price that makes use of those extra places.
> 2 votes

# Answer
Try adding %!.2n in 'Monetary Value Display' under localization settings(administer\>\> localization \>\> Languages, Currency, Locations)
> 0 votes

---
Tags: price-sets
---


# Question
Title: How to use Gsuite Relay as SMTP for CiviCRM bulk mailing?
I have Gsuite email setup with our own domain (name@ourdomain.com). I have tried to use mailgun with gsuite. Although it worked ok ish, as the number of contact increasing, bills are also increasing.

Since there is Gsuite relay service available which allows 10000 emails per day, we would like to setup our CiviCRM with it, so we can use it's full potential.

I have read this post How to use G Suite / GMail as your CiviMail Provider but not able to get SMTP working at all from civicrm's side.

We are currently using cpanel hosting and SMTP mailserver already setup on there which allows only 250 emails. Not very efficient and not sure if that causing any issue while setting up gsuite relay.

Did you manage to successfully setup Gsuite and currently using without any issue? If yes, would you please share some thoughts or tips what issue you have encountered and how you have solved it?

EDIT: I have tried to follow the steps as per the instruction on above tutorial and getting this results. I have tried different combination of ports and authentication settings on Gsuite, but no luck. I am using the email with our domain for signin example@ourdomain.com, and app specific Password to set the SMTP

# Answer
> 2 votes
Its been a while - but hope these tips help:

# Answer
> 2 votes
It seems there is a difference between sending via Gsuite and Gsuite SMTP Relay ...

For sending via Gsuite, and comparing the connection details in the post you linked to with a site using this, the difference is that it uses SMTP host `ssl://smtp.gmail.com`

The main practical limitations are the limits and that all mails get sent out with the sender of the Gsuite account, not the address you configure in Civi.

I haven't tried Gsuite SMTP Relay

---
Tags: civimail, smtp, mailserver, g-suite
---


# Question
Title: In order to see Activities fields in Views - do I need to add/install CiviCRM Entity?
I want to add Activities fields or Relationships in Drupal Views. Do I need to add/install CiviCRM Entity?

# Answer
> 1 votes
The answer is No, you do not, at least for Drupal 7. What I was missing was to first, add a new View, selecting CiviCRM Activities, not CiviCRM Contacts. I discovered clues starting on page 169 of The CiviCRM Cookbook by Tony Horrocks.

---
Tags: webform-civicrm, drupal-views, civicrm-entity
---


# Question
Title: When exporting data from CheckBox field, can value of be different from what is displayed?
When exporting data from a custom CheckBox field, can the value of the data exported be different from what is displayed? For example, the checkbox Multiple choice is labeled "Asked" but I would like the data value exported to be 1. I tried to change the Value to 1, but it is still exporting "Asked"

Thanks!!

# Answer
as far as I know you can not change the way an exported field is represented in the User Interface. What you could do is create a report of activities and export that report, perhaps you will then get the option to get the value. And this extension might help as well: https://civicrm.org/extensions/export-native-excel. Good luck!
> 1 votes

---
Tags: custom-fields, database, export
---


# Question
Title: Membership Pay later and Activity Renewal
I don't understand why, for a first membership, when a member chooses the "Pay later" option s.he gets a new activity "Renewal" recorded once the payment is manually added by the admin but not if s.he just pays live with credit card?

It's not a renewal and I don't want this activity to be added. This is mistaking the reports for those who are really renewing their membership and need to be separately identified for backoffice purpose.

I don't have a special CiviRule that would involve this behaviour so I guess it's build in CiviCRM.

I'm using CiviCRM 5.21.0 on Drupal 7.67

How could I fix this?

regards, Guillaume

EDIT 1: Activity Renewal is "Renouvellement d'adhésion". It comes automatically every time I use the pay later option. I don't get :-/

EDIT 2: I've tried on a different CiviCRM/Drupal website and it ends the same. It creates an unwanted Renewal activity

EDIT 3: After a step-by-step comparison with the demo, it appears that when registering a member, CiviCRM creates an "Online or offline membership signup." activity that I don't see on the demo instead it creates a Pending membership coloured in red that is deleted after a payment. And when entering a contribution, it logically adds a "Renewal" activity. So now, it's more about why is CiviCRM creating this first membership and no more why I get a renewal activity. little step forward...

# Answer
> 3 votes
On the demo site I took the following route and saw no issues

* change the Contrib page to accept Pay Later
* completed a Pay Later membership for the demo user
* confirmed that by then clicking on Edit for membership at backend, clicking on the Contribution block with 'more' and 'record payment' the membership was set to Current and there was no 'renewal' Activity on their record.

Hope that helps

Data will be on https://dmaster.demo.civicrm.org/civicrm/contact/view?reset=1&cid=203 for less than 12 hours till it is flushed.

---
Tags: civimember, activities, renewals
---


# Question
Title: Easy "add to Google Calendar" link in Event confirmation emails
Are there recommended practices for adding a link in Event email confirmations so that users can easily add the event to their Google Calendar? By default, CiviCRM offers that users download the .ical file, which they can then add to their calendar.

I would like to offer a direct "add to google" link. While not everyone uses Google (I'm one of those who do not), a few of my users have requested this feature.

For web pages, this library seems like a pretty good solution:
https://github.com/carlsednaoui/add-to-calendar-buttons

However, we cannot embed javascript code in emails, so it needs to be simpler. It seems like we can use an URL of the following form, which can be included in message templates:

```
<a class="icon-google" target="_blank"
  href="https://www.google.com/calendar/render?action=TEMPLATE&text={event.title}&dates={event.start_time}/{event.end_time}&details={event.description}&location={event.location}&sprop=&sprop=name:"
 >Add to Google Calendar</a>

```

NB: I did not test all of the above event variable names. The above probably does not work as-is.

I was wondering: has anyone else already implemented this? any suggestions? should I worry about timezones?

# Answer
> 8 votes
Better late than never, I suppose! I wrote an extension that attaches ics files to event confirmations.

https://civicrm.org/extensions/event-ics

# Answer
> 5 votes
What about going "the extra mile" and add the event information as an attachment of the right content type? That would allow gmail to automatically add the event to the calendar and would work with other calendar events too.

Not sure how to paste the code without looking like crap here, but if you use google calendar and invite your (non gmail) email, you will see the format google generates (and understand) that is fairly standard iCalendar format for what I recall.

---
Tags: civievent
---


# Question
Title: How to show/hide Profile based on Price set Total on a Contribution page?
I would like to hide/show my "Custom Profile Group" based on the value of "Price Set Total". I already have an extension with this Jquery, but seems to be not working. Any help would be appreciated. Thanks in advance.

```
  CRM_Core_Resources::singleton()->addScript("
     CRM.$(function($) {
        hideshowMainProfile();
    $('#priceset [price]').bind('keyup',hideshowMainProfile);

    function hideshowMainProfile() {
        let priceValue = $('#priceset [price]').val();
    if (priceValue.length > 1) {
      $('.crm-public-form-item.crm-group.custom_pre_profile-group').show();
    }
    else {
      $('.crm-public-form-item.crm-group.custom_pre_profile-group').hide();
    }
  }
    });
");

```

# Answer
I would use calculateTotalFee() to check if total amount is \> 0.

```
CRM_Core_Resources::singleton()->addScript("
  CRM.$(function($) {
    hideshowMainProfile();
    $('#priceset [price]').bind('change keyup click blur', hideshowMainProfile);

    function hideshowMainProfile() {
      if (calculateTotalFee() > 0) {
        $('.crm-public-form-item.crm-group.custom_pre_profile-group').show();
      }
      else {
        $('.crm-public-form-item.crm-group.custom_pre_profile-group').hide();
      }
    }
  });
");

```
> 2 votes

---
Tags: ui, jquery
---


title: Downstream Git/Composer Issues

text:
# Question
Title: Downstream Git/Composer Issues
I am trying to use the Drupal 8 Project on GitLab and I am having an issue with a downstream CiviCRM requirement. I am not sure where to post this issue, so I hope it is okay if I post it here.

The Composer files download civicrm/civicrm-asset-plugin. This asset includes pear/net\_smtp. There is also a patch CiviCRM custom error message for CRM-8744.

When Composer attempts to apply the patch, I get the error " Cannot apply patch Add in CiviCRM custom error message for CRM-8744 (https://raw.githubusercontent.com/civicrm/civicrm-core/a6a0ff13d2a155ad962529595dceaef728116f 96/tools/scripts/composer/patches/net-smtp-patch.patch)!".

I am not sure how to change what files are included in civicrm/civicrm-asset-plugin if there should be another patch or how to try and skip the patch in Composer.

Any help is greatly appreciated.

Thanks, Steve

# Answer
> 3 votes
Roundearth just recently switched to using civicrm-asset-plugin and it may not be fully integrated yet.

CiviCRM can be installed on drupal 8 without roundearth now - it's still not "official" but is being used by some.

composer create-project drupal/recommended-project some-folder

cd some-folder

\# replace the 'x' below with a proper version number

composer require civicrm/civicrm-core:5.x.x civicrm/civicrm-packages:5.x.x civicrm/civicrm-drupal-8:5.x.x civicrm/civicrm-asset-plugin:~1.0.1

Install Drupal as usual

Then to install CiviCRM - make sure the civicrm.settings.php file can be created -\> by making the web/sites/default directory writeable:

chmod +w web/sites/default

Then you can either go to Extend and enable CiviCRM Core or you can do this from the command line:

drush en -y civicrm

---
Tags: drupal-8, install, gitlab
---


# Question
Title: How can I prevent users editing custom fields for contacts not in their ACL group?
Using Wordpress 5.4.1 with Civi 5.24.3.

We have a smart group used for ACL which prevents the core "Edit" button being shown on the contact summary.

There is also an ACL entry for a group of contacts to view/edit a custom data group.

However, contacts that are not in the ACL for the smart group are able to add and edit custom data (for all contacts, regardless of their ACL group).

How can I use ACLs to prevent a contact view and editing custom data for contacts who are not in their ACL group?

If I add the required ACL entry to give access to the custom data group, this allows them to edit ALL contacts' custom data, which seems contrary to the documentation.

# Answer
Can you try applying the PR changes to your current version of civi? you will need to apply it manually as the pr is closed and is very old. If you will apply it manually than it may give you conflicts errors.
> 0 votes

---
Tags: custom-fields, acl
---


# Question
Title: Services from core contrib modules missing!!!! "The service xxxx has a dependency on a non-existent service xxx. " (with solution)
In this case it was webform. Webform services wouldn't load, I couldn't clear cache, clearing db caches manually wouldn't work. All I got was:

```
[Thu May 07 14:37:33.174757 2020] [php7:notice] [pid 2795] [client x.x.x.x:25119] Symfony\\Component\\DependencyInjection\\Exception\\ServiceNotFoundException: The service "webform_scheduled_email.manager" has a dependency on a non-existent service "webform.token_manager". in /var/www/html/www.actionfund.org/vendor/symfony/dependency-injection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php on line 31 #0 /var/www/html/www.actionfund.org/vendor/symfony/dependency-injection/Compiler/AbstractRecursivePass.php(60): Symfony\\Component\\DependencyInjection\\Compiler\\CheckExceptionOnInvalidReferenceBehaviorPass->processValue(Object(Symfony\\Component\\DependencyInjection\\Reference), false)\n#1 /var/www/html/www.actionfund.org/vendor/symfony/dependency-injection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php(28): Symfony\\Component\\DependencyInjection\\Compiler\\AbstractRecursivePass->processValue(Array, false)\n#2 /var/www/html/www.actionfund.org/vendor/symfony/dependency-injection/Compiler/AbstractRecursivePass.php(67): Symfony\\Component\\DependencyInjection\\Compiler\\CheckExceptionOnInvalidReferenceBehaviorPass->processValue(Array)\n#3 /var/www/html/www.actionfund.org/vendor/symfony/dependency-injection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php(28): Symfony\\Component\\DependencyInjection\\Compiler\\AbstractRecursivePass->processValue(Object(Symfony\\Component\\DependencyInjection\\Definition), true)\n#4 /var/www/html/www.actionfund.org/vendor/symfony/dependency-injection/Compiler/AbstractRecursivePass.php(60): Symfony\\Component\\DependencyInjection\\Compiler\\CheckExceptionOnInvalidReferenceBehaviorPass->processValue(Object(Symfony\\Component\\DependencyInjection\\Definition), true)\n#5 /var/www/html/www.actionfund.org/vendor/symfony/dependency-injection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php(28): Symfony\\Component\\DependencyInjection\\Compiler\\AbstractRecursivePass->processValue(Array, true)\n#6 /var/www/html/www.actionfund.org/vendor/symfony/dependency-injection/Compiler/AbstractRecursivePass.php(39): Symfony\\Component\\DependencyInjection\\Compiler\\CheckExceptionOnInvalidReferenceBehaviorPass->processValue(Array, true)\n#7 /var/www/html/www.actionfund.org/vendor/symfony/dependency-injection/Compiler/Compiler.php(140): Symfony\\Component\\DependencyInjection\\Compiler\\AbstractRecursivePass->process(Object(Drupal\\Core\\DependencyInjection\\ContainerBuilder))\n#8 /var/www/html/www.actionfund.org/vendor/symfony/dependency-injection/ContainerBuilder.php(789): Symfony\\Component\\DependencyInjection\\Compiler\\Compiler->compile(Object(Drupal\\Core\\DependencyInjection\\ContainerBuilder))\n#9 /var/www/html/www.actionfund.org/web/core/lib/Drupal/Core/DrupalKernel.php(1321): Symfony\\Component\\DependencyInjection\\ContainerBuilder->compile()\n#10 /var/www/html/www.actionfund.org/web/core/lib/Drupal/Core/DrupalKernel.php(902): Drupal\\Core\\DrupalKernel->compileContainer()\n#11 /var/www/html/www.actionfund.org/web/core/lib/Drupal/Core/DrupalKernel.php(477): Drupal\\Core\\DrupalKernel->initializeContainer()\n#12 /var/www/html/www.actionfund.org/web/core/lib/Drupal/Core/DrupalKernel.php(693): Drupal\\Core\\DrupalKernel->boot()\n#13 /var/www/html/www.actionfund.org/web/index.php(19): Drupal\\Core\\DrupalKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request))\n#14 {main}

```

Reinstall drupal wouldn't fix it (once custom modules were in). Deleting vendor and composer install wouldn't fix it. Reloading DB had no effect. None of the usual tricks worked. I was pulling my hair out.

# Answer
A contractor had added a directory called "webform" to modules/custom to add some custom configurations to webform. Which worked fine after updating webform module, until you cleared cache. Then Drupal blew up with the above error (similar from drush side) and I got puzzled silence on the call with them.

Turns out Drupal looks in custom first, for module directories, and ignores directories of the same name in contrib. When other stuff tried to reference services in the contrib module, drupal stopped looking for stuff in "webform" at the custom directory of the same name and died.

Hopefully this saves someone some time. Learn from our folly!

Changing the name custom/webform to custom/SITE\_NAME\_webform (with .info.yml etc name changes) fixed issue.

They're killing me.
> 2 votes

---
Tags: modules, missing, custom
---


# Question
Title: Does anyone have recent experience with CiviCRM for RSForm?
This Joomla plugin is supposed to provide the ability to update a civiCRM contact record based on a matching email address submitted in an RSForm submission.

Does anyone have recent experience with this plugin? Will it work with latest RSForms and civiCRM 5.21.x?

# Answer
I purchased the extension, and can confirm that it work with latest release of civiCRM.
> 4 votes

# Answer
CiviCRM for RSForm extension is a paid version and is maintained by NSWD. The extension page does say it supports from Civi 5.1. Since its a paid version, we don't have access to its code, it would be worth asking for a support from NSWD
> 2 votes

---
Tags: contacts, joomla
---


# Question
Title: Add/update activity date time using webform
Is it possible to use webform to update the activity date and time using webform?

# Answer
Below please find some screenshots to show you how: note there is an Activity Date and an Activity Time checkbox
> 3 votes

---
Tags: webform-civicrm, activities
---


# Question
Title: Prevent contact from unsubscribing from a mailing list?
I have a case where we have optional mailing lists for our members, but also a mandatory list that members must not be able to unsubscribe from (a smart group that looks for active members -- our master list of members -- which we use to contact them about urgent issues). A condition of membership is that they need to remain on this list.

But, when I send a mailing with the {unsubscribe} placeholder, members see all the lists they are on, including the master list, which they can then unsubscribe from.

Is there a way to prevent a mailing list from being displayed on the Unsubscribe page?

# Answer
> 3 votes
> Is there a way to prevent a mailing list from being displayed on the Unsubscribe page?

If the Mailing Group is not set to Public then it should not show I believe.

# Answer
> 2 votes
{action.unsubscribeUrl} should only unsubscribe them from that single mailing list and not display all your groups.

You do have to include an unsubscribe URL - civicrm forces you to include (body\_html:action.optOutUrl or action.unsubscribeUrl) or you can't send the email. There is a setting to sidestep the requirement for OptOut per *petednz - fusion* but use at your own risk.

---
Tags: civimail
---


# Question
Title: What this bot/IP trying to do on my civicrm site?
I find 100s of these types of entries in my drupal log. It tries URLs like this below. It happens when there's very less traffic on our site. What is it trying to do? Is it a security threat? Can it cause any harm to our site & data? Can they be stopped?

```
https://example.com/civicrm/contribute/transact?reset=1%27%20AND%206876%20IN%20%28SELECT%20%28CHAR%28113%29%2BCHAR%28106%29%2BCHAR%2898%29%2BCHAR%28122%29%2BCHAR%28113%29%2B%28SELECT%20%28CASE%20WHEN%20%286876%3D6876%29%20THEN%20CHAR%2849%29%20ELSE%20CHAR%2848%29%20END%29%29%2BCHAR%28113%29%2BCHAR%28118%29%2BCHAR%28106%29%2BCHAR%28112%29%2BCHAR%28113%29%29%29%20AND%20%27KFmQ%27%3D%27KFmQ&id=10

```

# Answer
It's a SQL injection attempt, where it's looking to see if it gets used in a query and alters it. Depending on the query where it gets used, it could do nothing or it could do something, but at the very least tells the attacker if it's vulnerable. Simple example, where it does nothing:

If civi had code like this, where it doesn't escape the value:

```
$reset = $_GET['reset'];
$dao = CRM_Core_DAO::executeQuery("SELECT * FROM table WHERE something='$reset'");

```

That particular url would translate to:

```
$reset = $_GET['reset'];
$dao = CRM_Core_DAO::executeQuery("SELECT * FROM table WHERE something='1' AND 6876 IN (SELECT (1)) AND 'KFmQ'='KFmQ'");

```

which is valid SQL and does something different than intended. In my example all it does is tell the attacker it's vulnerable, but there's lots of variations.

Since IDS is catching it, you get the log errors.

If it's always the same IP, you can block the IP.
> 1 votes

---
Tags: security, urls, security-advisory
---


title: List of count of tag members?

text:
# Question
Title: List of count of tag members?
Is it a report or anything like that, that could display a list of all tags together with a count of contacts with each tag?

# Answer
> 2 votes
Not a report, but FYI the "Manage Tags" screen actually shows the usage count for each tag when you click on it:

# Answer
> 1 votes
In D7 this can be done use CiviCRM Entity and Views and Views Field Views

CiviCRM Entity can give us a View with the data from civicrm\_entity\_tag

but, there is no 'Relationship' that I can spot to the civicrm\_tag table to get the name of the tag, hence you get a table with the Tag ID and the Count. Not so useful.

With views\_field\_view you can make another view based civicrm\_tag to get the tag name, use the Contextual Filter of the tag id

then pull that View in to the first one and apply the same Contextual Filter and bingo you have your table of Tags with a count of entities using it.

PM me and I will zip you the views if you don't want to start from scratch.

---
Tags: reports, tags
---


# Question
Title: Send certain welcome message after subscription to certain mailing list
I think this is an obvious feature, but I can't find it anywhere.

I can set several custom "Welcome" Automated Messages but I would like to be able to assign certain custom "Welcome" automated messages to be sent after a user signs up for a certain mailing list.

For example:

User signs up for mailing list "dogs" and in the body message (sent after successfully double opt-in) is "Thanks for subscribing to Dogs!". But if the user subscribes to "cats" the message is sent containing "cats" in body text.

I've tried using CiviRules, but Civirules is not respecting double opt -in. It sends e-mail even if user won't confirm subscription.

Has anyone figured it out?

# Answer
> I've tried using CiviRules, but Civirules is not respecting double opt -in. It sends e-mail even if user won't confirm subscription.

Try adding a Linked Condition of Field Value Comparison:

* Entity: GroupContact
* Field: Group Contact Status
* Operator: Is equal to
* Compare Value: Added
> 2 votes

---
Tags: groups, mailing, system-workflow-messages
---


# Question
Title: Baffled by Views database error on new install
Hours-old install of CiviCRM 5.25 under Backdrop 1.9. I've gotten as far as putting in the Board of Directors with dummy bio information, which I was trying to use to generate a View with a page display of names and bios. I get this, with various permutations of what table doesn't exist depending on what I'm doing:

`SQLSTATE[42S02]: Base table or view not found: 1146 Table 'B1.civicrm_uf_match' doesn't exist`

Both Backdrop and CiviCRM are using the same mysql user "B1", who has GRANT ALL permissions on the B1 and C5 tables. Obviously, the data is still there when I go back to review it in the Civi interface. What to check next?

# Answer
> 2 votes
Okay, I think I got it. First, start with Pradeep's answer and Laryn's in the comments.

There's a bug in the output text from Administer \>\> System Settings \>\> CMS Integration. It starts the block of text with `$database_prefix = array(` but it still needs the code as listed in the documentation (in an uncopyable screenshot): `$databases['default']['default']['prefix'] = array(`.

Note for those confused if they reused the same name for the database and the user: with databases/users named Backdrop and CiviCRM, "Backdrop" goes under user in the code described by Laryn, but CiviCRM shows up as the prefix in the code copied out of CMS Integration. Aside from the initial line, the rest works as expected.

# Answer
> 3 votes
Try adding cms integration in your backdrop settings.php

CiviCRM \>\> Administer \>\> System Settings \>\> CMS Integration.

Step by step documentation : https://docs.civicrm.org/sysadmin/en/latest/integration/backdrop/views/

---
Tags: permissions, drupal-views, mysql, backdrop
---