# Question
Title: Can you search for only manually added members of a smart group?
Is there any way to search or sort the manually added members of a smart group (versus the smart members)? It seems like there should be, but I don't see any option anywhere. It isn't possible to sort by status when viewing a groups contacts either.

The only workaround I can see is to create a new smart group with the group's criteria, then use an include/exclude search to find the manually added members, but there must be a better way.

# Answer
I have an experimental search extension that provides many missing features, and includes your needs, I believe.

You can try it if you're up to that https://lab.civicrm.org/artfulrobot/keenies but it should be considered alpha, beta at a push! Please see the README for the searches it can do.

It includes a search on the manual added/removed from a group (smart or not), so using this on a smart group basically ignores the criteria.

I built it because if you're using a smart group for a mailing group, it's helpful to be able to search for people who have unsubscribed, but there could be many uses.

It's in early stages, and may be abandoned if/when the core CiviCRM new search project comes to fruition and provides this functionality (but I built this now because that could be a while).

EDIT: for convenience from the README as of 9 July 2020:

> ## Implemented searches
>
> * **Has Activity**: choose activity types; relationship (with/target, assignee, created); date range; subject (exact or pattern); location.
> * **Contact details**: contact type(s); created date range; source field.
> * **Manually added/removed from group**: select group(s) and a status: Added/Removed. e.g. find exceptions for smart groups.
> * **In group**: select group(s). This is like a normal group search, so works for smart and non-smart groups. You can put this criteria in a 'not' wrapper to find people not in a group.
> * **Has clicked a link in a mailing**: date range for the click; select mailing(s) they must have clicked in.
> * **Has opened a mailing**: date range for the open; select mailing(s) they must have clicked in.
> * **Was sent a mailing**: date range and mailing(s) selector.
> * **Has tag(s)**: select one or more tags.
> 4 votes

# Answer
That criterion isn't available in the UI; I've typically identified them by sight in the 'view contacts' list from the Manage Groups section. What are you trying to accomplish in finding them - identifying them so they can be removed? Typically it's more efficient to recreate the smart group but if you need to include the manually added folks for some reason and they don't match the smart group's criteria, one other approach is to create one smart group (group A) with your existing criteria, one manual group (group B) with the contacts who had been added manually previously, and one smart group (group C) that includes members of A and B. A bit fiddly but usually effective.
> 2 votes

---
Tags: search, smartgroups
---


# Question
Title: Adding contacts to group after receiving mail from them
Say, for example that I want to divide my contacts into two groups, an active group (contacts from whom I've received a mail in last few months) and an inactive group (countacts from whom I haven't received an email in the last few months). Is there a way to do this in CiviCRM? I was looking at CiviRules, but couldn't really find what I was looking for.

# Answer
You could use inbound email processing to activities and then a smart group based on that activity in the last 3 months.
> 3 votes

---
Tags: contacts, groups, smartgroups, civirules
---


# Question
Title: Self referential Smart Group - good idea?
An organisation has local campaign groups. Some of these campaign groups belong to a set we call the "core activist network".

I want the core activist network group to contain:

* all these groups that are manually added
* all individuals that are related to a local campaign group which is part of the group.

I've set this up as follows:

1. Search for "name contains 'a'" - anything that will return at least one result.
2. Save the search as a Smart Group.
3. Add at least one local campaign group to this group manually (Add to Group).
4. Edit the smart group criteria, remove the silly 'a' criteria, then go to Relationships, choose "Target Contact(s) in group" and enter the name of **this smart group**!
5. Run the search and from there click Update Smart Group.

Amazingly, this appears to have worked! But is there a reason why this is likely to end up in knots, e.g. some infinite loop? Since calculating the smart group requires...calculating the smart group.

I realise that this is likely to fall foul of SE's "answers likely to be opinion based" but I think this is a valid case. I encourage anyone to upvote any answers that point out potential problems with this situation. Of course, if someone says "I've done this and it works beautifully" then I'll accept that answer as an expression of joy :-). I'm also interested in any answers that are along the lines of "that's daft, but you can do it like this instead:..."

Thanks in advance wonderful Civi community!

# Answer
> 3 votes
I've been reading the code, and I *think* this is pretty safe, at least on server with MySQL 5.7.5+ or MariaDB 10.0.2+ (if your database is older than this, it's pretty old).

The code that updates smart groups has various checks in place to make sure it only does each group once in a request.

All the contacts in a smart group are stored in a "cache" table. (A cache is a temporary store of data that can be recreated as needs be, e.g. when updating the smart group). The cache is entirely separate from the manually added/removed contacts; the cache contains and only contains all the contacts in the group, whether they were included manually or because they match the criteria.

The process is:

1. Delete all the cache records for this group. This is important in the example of this question, since it means the search for "contacts whose related contact is in the group" will only be looking at the related contacts that are *manually* included in the group
2. Creates a temporary table to store new cache entries.
3. Add to the temporary store by running the search, excluding any that are *manually removed*. In this question: this means we'll be adding the individuals that are related to the local campaign groups, unless they have been manually removed from the group for whatever reason.
4. Add to the temporary store a copy of all those *manually added*. Of course these contacts may already be in there (from step 2), but that's fine, it ensures every contact is only included once. By now, the temporary store has a copy of everyone that should be in the group. In our example, it means the temporary store now includes:

* All the local campaign groups (and possibly other contacts) that were manually added to the smart group.
    * All the activists related to the local campaign groups, unless they had been manually removed.

---

But it goes on if this group has any child (sub) groups. This is not relevant to this question but I thought I'd include it for completeness' sake...

4. For each child group, it looks up the contacts in that, exclude any manually excluded from our group, and adds these to our temporary store (again, ignoring any duplicates).

It will also refresh the cache of any child smart groups, so if there was a smart group within the child groups that referenced our main smart group (!) it would not result in an infinite loop because it knows we've just updated \[are updating\] that, but I'm unclear what contacts it would see because:

* if it goes on the *cache* table, that's empty at this point.
    * if it goes on (manually added + cache table) then it will see the manually added contacts only.
5. Finally, it empties our group's cache (again? I wonder why...) and copies all the entries from our temporary store into the cache table, and we're done!

So: I think, miraculously, this should actually work and be safe for the purpose stated in my original question!

Please comment, or post other answers though if you have any experience to share.

---
Tags: smartgroups
---


title: Importing Relationship Data

text:
# Question
Title: Importing Relationship Data
I know this should be straight forward, but somehow I seem to struggle.

Importing a child-parent relationship.

I have 10 children records (External ID, Child Name, Child Surname) and 5 parent records (Parent Name, Parent Surname, Parent Mobile Number, Subtype).

I used https://dmaster.demo.civicrm.org to import the 10 children records first. I then did another import for the 5 parent record:

I got an error message: External ID already exist in the database

So, 0 records were imported.

So, I tried again. This time I selected Update for For Duplicate Contacts

According to the message, 20 records were created or updated. Thus, I ended up with 20 records.

I thought that there should be 15 records. For example, if parent A has two children (Child 1 & 6), then there should only be one record for Parent A and when we click on Parent A, it should show that Parent A is the parent of Child 1 and Child 6.

At the moment there are two records of Parent A. When you click the one record it shows that Parent A is the parent of Child 1 and when you click on the other record of Parent A, it shows that Parent A is the parent of Child 6. The following are the records for the Parents:

When I selected Fill for For Duplicated Contacts, 20 records were created or updated.

Any guidance will be provided or should it be 20 records.

# Answer
Check your individual dedupe rule, change the unsupervised one to first name and last name with weight 10 each and total 20.
> 1 votes

# Answer
Welcome to SE! I'm guessing you're fairly new to Civi and the comments so far, although accurate, may seem a bit cryptic. I'll expand a bit ...

The end result should be 15 contacts: 10 children, 5 parents and 10 parent/child relationships.

You said '... import the 10 children records first. I then did another import for the 5 parent record'. As per Pete's comment, you don't need to do 2 imports. Civi will import both the child and parent records at the same time using the 'child of' mapping shown in your screenshot.

External identifiers have to be unique across all records (not just those in your import). Your first import created child records with ext id's 1-10 and then the second one (first attempt) tried to create additional child records with ext id's 1-10 and failed because of the uniqueness requirement. Switching to 'Update' gets around that problem, but you can avoid it entirely by doing a single import.

You don't need external identifiers at all for this import and unless you need them for other purposes, I'd skip them entirely. Once you get this import done, if you try repeating the process for a different set of data but reusing ext id 1-10 you'll hit problems. The documentation includes an example for importing two parents, and that does need an ext id. (Rereading that, it would benefit from a simple example of importing relational data as well as the more complex one.)

For the parents, Civi will attempt to match those details to an existing contact. If it succeeds it will use that contact, otherwise it will create a new one. Civi determines what is a match using Dedupe Rules. You can find those at `Contacts > Find and Merge Contacts`. You can read about those here. The rule used for deciding if the parent details match is the 'Unsupervised rule', so you need to create a rule based on the data in your import for parents (ie some combination of first name, last name and phone). As Pradeep suggests, you can create a rule matching on first/last name and set that as the unsupervised rule.

If you do that and run the import you should find it creates 15 contacts with the right relationships. Confusingly, the import dialog lets you select a dedupe rule but this seems to be used only for the main contacts of the import (children), not the related contacts (parents) - hence the need to change the overall unsupervised rule.

Once you have done the import, go back and change your unsupervised rule to something narrower. In general, first/last name is not enough for uniqueness.

Alternatively, if you already have the data imported with duplicate parent records but don't want to reimport, you can run a manual dedupe using the 'First/Last' rule. See the link above for more info.
> 1 votes

---
Tags: import, relationships
---


# Question
Title: Do manually added contacts stay in a smart group forever?
If a contact is manually added to a smart group (so has the status of 'Added') do they stay there for ever (until manually removed)? I am about 99.9% certain that this is the case. I've had some questions about contacts that shouldn't have been in a group (and so got an email in error) - and the reason is that they were manually added to the smart group. If true this makes manually adding contacts to a smart group a very bad idea - which I hadn't quite appreciated before. It makes the case for this feature to be optional so it could be turned off.

# Answer
It is answered here: https://docs.civicrm.org/user/en/latest/organising-your-data/smart-groups/#adding-and-removing-smart-group-members-manually

"You can override the criteria by manually adding or removing contacts from the group". So, unless the group is deleted or you remove them, my assumption is yes they will stay 'forever'.
> 1 votes

---
Tags: smartgroups
---


# Question
Title: Why is the receipient count in CiviMail less than the number in the group? No, I mean, specifically!
I have a group of 18495 contacts but when I send them a civimail, it shows only 9560 recipients. I get that it's going to be less due to opt outs, etc., but how can I find out more specifically why?

It seems like others have asked this question as well:

https://lab.civicrm.org/dev/mail/-/issues/51

# Answer
Here's a piece of sql that answers the question to some degree:

```
select count(distinct(gc.contact_id)), gc.status, e.on_hold, c.do_not_email, c.is_opt_out, c.is_deceased from civicrm_group_contact gc inner join civicrm_email e on gc.contact_id = e.contact_id inner join civicrm_contact c on gc.contact_id = c.id where group_id = the_group_id_you_care_about and e.is_primary = 1 group by status, on_hold, do_not_email, is_opt_out, is_deceased;

```

And here's what I got from it:

```
+--------------------------------+---------+---------+--------------+------------+-------------+
| count(distinct(gc.contact_id)) | status  | on_hold | do_not_email | is_opt_out | is_deceased |
+--------------------------------+---------+---------+--------------+------------+-------------+
|                          10374 | Added   |       0 |            0 |          0 |           0 |
|                           1085 | Added   |       0 |            0 |          1 |           0 |
|                              9 | Added   |       0 |            0 |          1 |           1 |
|                              2 | Added   |       0 |            1 |          0 |           0 |
|                              2 | Added   |       0 |            1 |          1 |           0 |
|                           3792 | Added   |       1 |            0 |          0 |           0 |
|                              1 | Added   |       1 |            0 |          1 |           0 |
|                              3 | Added   |       1 |            0 |          1 |           1 |
|                              1 | Added   |       2 |            0 |          0 |           0 |
|                              1 | Pending |       0 |            0 |          0 |           0 |
|                              2 | Pending |       1 |            0 |          0 |           0 |
|                           2546 | Removed |       0 |            0 |          0 |           0 |
|                            313 | Removed |       0 |            0 |          1 |           0 |
|                              2 | Removed |       0 |            1 |          0 |           0 |
|                              2 | Removed |       0 |            1 |          1 |           0 |
|                             67 | Removed |       1 |            0 |          0 |           0 |
|                              1 | Removed |       1 |            1 |          1 |           0 |
+--------------------------------+---------+---------+--------------+------------+-------------+

```

The pending and removed could be ignored, but it's also nice to see how many people removed themselves from your list.

Note this doesn't give a complete answer, there's still about 800 to go to get down to 9560 receipients, but in this case, it was due to 800 duplicate email addresses. I'd probably need to use a separate sql to show that, but patches welcomed.

Also seems like a civireport to do this might be nice.
> 2 votes

---
Tags: civimail
---


title: Adding a new participant status

text:
# Question
Title: Adding a new participant status
I keep trying to add a new participant status, but the page isn't letting me. I hit save, but nothing happens. I thought it was my browser, so I switched. I thought maybe a bug, so I upgraded to the latest CiviCRM. Still can't save it. I've tried clicking on Save as well as just hitting Enter when in one of the fields. Nothing.

Drupal 7, CiviCRM 5.27.0

Console shows the following error:

```
An invalid form control with name='visibility_id' is not focusable

```

# Answer
I figured it out - I didn't have a Visibility selected. There isn't an asterisk next to it letting you know it is required and no error pops up telling you that you need to choose a visibility. So it is indeed a CiviCRM issue - it's missing the asterisk and a message letting you know that you need to choose one.
> 1 votes

---
Tags: civievent
---


# Question
Title: Drupal 8 / CiviCRM ; Directories that need to be manually created?
I've created a d8/civi site on all three of bionic/eoam/focal and now have worked out the variances between them to the state that I now have an operational

# Answer
> 1 votes
Nevermind....

I was accidentally using the drush-10 and I see that drush-8 is recommended.

That fixed my woes.

composer require drush/drush:^8

---
Tags: civicrm.settings.php, drupal-8
---


title: Receipts for FL donors

text:
# Question
Title: Receipts for FL donors
The state of Florida, USA requires a special statement on contribution acknowledgements & receipts. I am trying to edit the online and offline workflow template so that it will include that statement if the contact.state\_province is FL. Can someone please help me get the code dialed in?

Thanks in advance

```
{if $contact.state_province eq 'FL'}
 <p>A COPY OF THE OFFICIAL REGISTRATION AND FINANCIAL INFORMATION MAY BE OBTAINED FROM THE DIVISION OF CONSUMER SERVICES BY CALLING TOLL-FREE (800-435-7352) WITHIN THE STATE. REGISTRATION DOES NOT IMPLY ENDORSEMENT, APPROVAL, OR RECOMMENDATION BY THE STATE.</p>
{/if}

```

I tried it without the $ first. So... {if contact.state\_province eq 'FL'}

I tried the code below but it put it on all receipts

```
 {assign var="florida" value="{contact.state_province eq 'FL'}{if $florida}<p>A COPY OF THE OFFICIAL REGISTRATION AND FINANCIAL INFORMATION MAY BE OBTAINED FROM THE DIVISION OF CONSUMER SERVICES BY CALLING TOLL-FREE (800-435-7352) WITHIN THE STATE OF FLORIDA. REGISTRATION DOES NOT IMPLY ENDORSEMENT, APPROVAL, OR RECOMMENDATION BY THE STATE OF FLORIDA.</p>
{/if}

```

# Answer
> 3 votes
The state token is a token and not a smarty variable, so it has to just be on its own, and you can't use it in the middle of a smarty `if` statement. You have to `capture` it first into a smarty variable:

```
{capture assign=stateProv}{contact.state_province}{/capture}
{if $stateProv eq 'FL'}
 <p>A COPY OF THE OFFICIAL REGISTRATION AND FINANCIAL INFORMATION MAY BE OBTAINED FROM THE DIVISION OF CONSUMER SERVICES BY CALLING TOLL-FREE (800-435-7352) WITHIN THE STATE. REGISTRATION DOES NOT IMPLY ENDORSEMENT, APPROVAL, OR RECOMMENDATION BY THE STATE.</p>
{/if}

```

---
Tags: civicontribute, message-templates, system-workflow-messages
---


# Question
Title: "MySQL server has gone away" error when attempting upgrade to 5.26
I am attempting to upgrade from 5.24 to 5.27 by stepping through 5.25 and 5.26, however I'm getting weird errors at 5.25.0 -\> 5.26.x. I attempted to see what happened if I just pushed through to 5.27 but that throws the same error.

In the upgrade screen it helpfully tells me there was an "unknown error". The logs indicate there is some kind of MySQL problem, possibly related (but maybe not) to this change.

I also see `DB Error: unknown error` when attempting to enable extensions (I disable them when upgrading).

I've rolled back for now but this is going to become urgent the closer we get to the new WordPress version on 11 August so any suggestions would be greatly appreciated.

**System**

WordPress: `5.4.2`
MySQL: `Ver 14.14 Distrib 5.7.30 for Linux`
OS: `Ubuntu Linux 18.04`

Error log shows:

```
Jul 11 15:41:57  [info] Running task: Finish Upgrade DB to 5.26.0

Jul 11 15:42:07  [error] $Fatal Error Details = Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => handle
        )

    [code] => -1
    [message] => DB Error: unknown error
    [mode] => 16
    [debug_info] => ALTER TABLE `wordpress`.log_civicrm_msg_template ADD   `workflow_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Name of workflow' [nativecode=2006 ** MySQL server has gone away]
    [type] => DB_Error
    [user_info] => ALTER TABLE `wordpress`.log_civicrm_msg_template ADD   `workflow_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Name of workflow' [nativecode=2006 ** MySQL server has gone away]
    [to_string] => [db_error: message="DB Error: unknown error" code=-1 mode=callback callback=CRM_Core_Error::handle prefix="" info="ALTER TABLE `wordpress`.log_civicrm_msg_template ADD   `workflow_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Name of workflow' [nativecode=2006 ** MySQL server has gone away]"]
)

Jul 11 15:42:07  [debug] $backTrace = #0 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(192): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 /var/www/html/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(922): CRM_Core_Error::handle(Object(DB_Error))
#2 /var/www/html/wp-content/plugins/civicrm/civicrm/packages/DB.php(997): PEAR_Error->__construct("DB Error: unknown error", -1, 16, (Array:2), "ALTER TABLE `wordpress`.log_civicrm_msg_template ADD   `workflow_name` varcha...")
#3 /var/www/html/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(575): DB_Error->__construct(-1, 16, (Array:2), "ALTER TABLE `wordpress`.log_civicrm_msg_template ADD   `workflow_name` varcha...")
#4 /var/www/html/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(223): PEAR->_raiseError(Object(DB_mysqli), NULL, -1, 16, (Array:2), "ALTER TABLE `wordpress`.log_civicrm_msg_template ADD   `workflow_name` varcha...", "DB_Error", TRUE)
#5 /var/www/html/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1925): PEAR->__call("raiseError", (Array:7))
#6 /var/www/html/wp-content/plugins/civicrm/civicrm/packages/DB/mysqli.php(935): DB_common->raiseError(-1, NULL, NULL, "ALTER TABLE `wordpress`.log_civicrm_msg_template ADD   `workflow_name` varcha...", "2006 ** MySQL server has gone away")
#7 /var/www/html/wp-content/plugins/civicrm/civicrm/packages/DB/mysqli.php(405): DB_mysqli->mysqliRaiseError()
#8 /var/www/html/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1231): DB_mysqli->simpleQuery("ALTER TABLE `wordpress`.log_civicrm_msg_template ADD   `workflow_name` varcha...")
#9 /var/www/html/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(2696): DB_common->query("ALTER TABLE `wordpress`.log_civicrm_msg_template ADD   `workflow_name` varcha...")
#10 /var/www/html/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(1829): DB_DataObject->_query("ALTER TABLE `wordpress`.log_civicrm_msg_template ADD   `workflow_name` varcha...")
#11 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(421): DB_DataObject->query("ALTER TABLE `wordpress`.log_civicrm_msg_template ADD   `workflow_name` varcha...")
#12 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(1473): CRM_Core_DAO->query("ALTER TABLE `wordpress`.log_civicrm_msg_template ADD   `workflow_name` varcha...", FALSE)
#13 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Logging/Schema.php(450): CRM_Core_DAO::executeQuery("ALTER TABLE `wordpress`.log_civicrm_msg_template ADD   `workflow_name` varcha...", (Array:0), TRUE, NULL, FALSE, FALSE)
#14 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Logging/Schema.php(529): CRM_Logging_Schema->fixSchemaDifferencesFor("civicrm_msg_template", (Array:3))
#15 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Logging/Schema.php(284): CRM_Logging_Schema->fixSchemaDifferencesForAll()
#16 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Upgrade/Form.php(790): CRM_Logging_Schema->fixSchemaDifferences()
#17 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Upgrade/Page/Upgrade.php(165): CRM_Upgrade_Form::doFinish()
#18 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Upgrade/Page/Upgrade.php(65): CRM_Upgrade_Page_Upgrade->runFinish()
#19 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(312): CRM_Upgrade_Page_Upgrade->run((Array:2), NULL)
#20 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(68): CRM_Core_Invoke::runItem((Array:13))
#21 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(36): CRM_Core_Invoke::_invoke((Array:2))
#22 /var/www/html/wp-content/plugins/civicrm/civicrm.php(1535): CRM_Core_Invoke::invoke((Array:2))
#23 /var/www/html/wp-includes/class-wp-hook.php(287): CiviCRM_For_WordPress->invoke("")
#24 /var/www/html/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters("", (Array:1))
#25 /var/www/html/wp-includes/plugin.php(478): WP_Hook->do_action((Array:1))
#26 /var/www/html/wp-admin/admin.php(254): do_action("toplevel_page_CiviCRM")
#27 {main}

```

If I turn off logging, that looks like it fixes the problem. However that's not actually true, because when I go to turn it back on I get a similar error:

```
Jul 12 15:57:46  [error] $Fatal Error Details = Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => handle
        )

    [code] => -14
    [message] => DB Error: no database selected
    [mode] => 16
    [debug_info] => SELECT VERSION() [nativecode=2006 ** MySQL server has gone away]
    [type] => DB_Error
    [user_info] => SELECT VERSION() [nativecode=2006 ** MySQL server has gone away]
    [to_string] => [db_error: message="DB Error: no database selected" code=-14 mode=callback callback=CRM_Core_Error::handle prefix="" info="SELECT VERSION() [nativecode=2006 ** MySQL server has gone away]"]
)

Jul 12 15:57:46  [debug] $backTrace = #0 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(192): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 /var/www/html/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(922): CRM_Core_Error::handle(Object(DB_Error))
#2 /var/www/html/wp-content/plugins/civicrm/civicrm/packages/DB.php(997): PEAR_Error->__construct("DB Error: no database selected", -14, 16, (Array:2), "SELECT VERSION() [nativecode=2006 ** MySQL server has gone away]")
#3 /var/www/html/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(575): DB_Error->__construct(-14, 16, (Array:2), "SELECT VERSION() [nativecode=2006 ** MySQL server has gone away]")
#4 /var/www/html/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(223): PEAR->_raiseError(Object(DB_mysqli), NULL, -14, 16, (Array:2), "SELECT VERSION() [nativecode=2006 ** MySQL server has gone away]", "DB_Error", TRUE)
#5 /var/www/html/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1925): PEAR->__call("raiseError", (Array:7))
#6 /var/www/html/wp-content/plugins/civicrm/civicrm/packages/DB/mysqli.php(935): DB_common->raiseError(-14, NULL, NULL, "SELECT VERSION() [nativecode=2006 ** MySQL server has gone away]", "2006 ** MySQL server has gone away")
#7 /var/www/html/wp-content/plugins/civicrm/civicrm/packages/DB/mysqli.php(390): DB_mysqli->mysqliRaiseError(-14)
#8 /var/www/html/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1231): DB_mysqli->simpleQuery("SELECT VERSION()")
#9 /var/www/html/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(2696): DB_common->query("SELECT VERSION()")
#10 /var/www/html/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(1829): DB_DataObject->_query("SELECT VERSION()")
#11 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(421): DB_DataObject->query("SELECT VERSION()")
#12 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(1550): CRM_Core_DAO->query("SELECT VERSION()", TRUE)
#13 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Utils/SQL.php(168): CRM_Core_DAO::singleValueQuery("SELECT VERSION()")
#14 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Utils/SQL.php(150): CRM_Utils_SQL::getDatabaseVersion()
#15 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Core/Lock.php(169): CRM_Utils_SQL::supportsMultipleLocks()
#16 /var/www/html/wp-content/plugins/civicrm/civicrm/Civi/Core/Lock/LockManager.php(68): CRM_Core_Lock->acquire(NULL)
#17 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Utils/Cache/SqlGroup.php(107): Civi\Core\Lock\LockManager->acquire("cache.CiviCRM-20Session__CRM_Admin_Form_Setting_Miscellaneous_74f5d2c2d697bc4...")
#18 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/Cache.php(294): CRM_Utils_Cache_SqlGroup->set("_CRM_Admin_Form_Setting_Miscellaneous_74f5d2c2d697bc4ca6fb62aa04d3c992_241_co...", (Array:5), 172800)
#19 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Core/Session.php(517): CRM_Core_BAO_Cache::storeSessionToCache((Array:2), TRUE)
#20 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Utils/System.php(1428): CRM_Core_Session::storeSessionObjects()
#21 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(981): CRM_Utils_System::civiExit(1)
#22 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(207): CRM_Core_Error::abend(1)
#23 /var/www/html/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(922): CRM_Core_Error::handle(Object(DB_Error))
#24 /var/www/html/wp-content/plugins/civicrm/civicrm/packages/DB.php(997): PEAR_Error->__construct("DB Error: no database selected", -14, 16, (Array:2), "ALTER TABLE `wordpress`.log_civicrm_msg_template ADD   `workflow_name` varcha...")
#25 /var/www/html/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(575): DB_Error->__construct(-14, 16, (Array:2), "ALTER TABLE `wordpress`.log_civicrm_msg_template ADD   `workflow_name` varcha...")
#26 /var/www/html/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(223): PEAR->_raiseError(Object(DB_mysqli), NULL, -14, 16, (Array:2), "ALTER TABLE `wordpress`.log_civicrm_msg_template ADD   `workflow_name` varcha...", "DB_Error", TRUE)
#27 /var/www/html/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1925): PEAR->__call("raiseError", (Array:7))
#28 /var/www/html/wp-content/plugins/civicrm/civicrm/packages/DB/mysqli.php(935): DB_common->raiseError(-14, NULL, NULL, "ALTER TABLE `wordpress`.log_civicrm_msg_template ADD   `workflow_name` varcha...", "2006 ** MySQL server has gone away")
#29 /var/www/html/wp-content/plugins/civicrm/civicrm/packages/DB/mysqli.php(618): DB_mysqli->mysqliRaiseError(-14)
#30 /var/www/html/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(2666): DB_mysqli->rollback()
#31 /var/www/html/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(1829): DB_DataObject->_query("ROLLBACK")
#32 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(421): DB_DataObject->query("ROLLBACK")
#33 /var/www/html/wp-content/plugins/civicrm/civicrm/Civi/Core/Transaction/Frame.php(153): CRM_Core_DAO->query("ROLLBACK")
#34 /var/www/html/wp-content/plugins/civicrm/civicrm/Civi/Core/Transaction/Manager.php(103): Civi\Core\Transaction\Frame->finish()
#35 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Core/Transaction.php(127): Civi\Core\Transaction\Manager->dec()
#36 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Core/Transaction.php(114): CRM_Core_Transaction->commit()
#37 /var/www/html/wp-content/plugins/civicrm/civicrm/Civi/API/Subscriber/TransactionSubscriber.php(169): CRM_Core_Transaction->__destruct()
#38 /var/www/html/wp-content/plugins/civicrm/civicrm/vendor/symfony/event-dispatcher/EventDispatcher.php(184): Civi\API\Subscriber\TransactionSubscriber->onApiException(Object(Civi\API\Event\ExceptionEvent), "civi.api.exception", Object(Civi\Core\CiviEventDispatcher))
#39 /var/www/html/wp-content/plugins/civicrm/civicrm/vendor/symfony/event-dispatcher/EventDispatcher.php(46): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch((Array:1), "civi.api.exception", Object(Civi\API\Event\ExceptionEvent))
#40 /var/www/html/wp-content/plugins/civicrm/civicrm/Civi/Core/CiviEventDispatcher.php(98): Symfony\Component\EventDispatcher\EventDispatcher->dispatch("civi.api.exception", Object(Civi\API\Event\ExceptionEvent))
#41 /var/www/html/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(86): Civi\Core\CiviEventDispatcher->dispatch("civi.api.exception", Object(Civi\API\Event\ExceptionEvent))
#42 /var/www/html/wp-content/plugins/civicrm/civicrm/api/api.php(131): Civi\API\Kernel->runSafe("setting", "create", (Array:22))
#43 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Admin/Form/SettingTrait.php(346): civicrm_api3("setting", "create", (Array:22))
#44 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Admin/Form/Setting.php(102): CRM_Admin_Form_Setting->saveMetadataDefinedSettings((Array:23))
#45 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Admin/Form/Setting.php(82): CRM_Admin_Form_Setting->commonProcess((Array:23))
#46 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php(484): CRM_Admin_Form_Setting->postProcess()
#47 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Core/StateMachine.php(144): CRM_Core_Form->mainProcess()
#48 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Next.php(45): CRM_Core_StateMachine->perform(Object(CRM_Admin_Form_Setting_Miscellaneous), "next", "Next")
#49 /var/www/html/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Next->perform(Object(CRM_Admin_Form_Setting_Miscellaneous), "next")
#50 /var/www/html/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Admin_Form_Setting_Miscellaneous), "next")
#51 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php(335): HTML_QuickForm_Page->handle("next")
#52 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Utils/Wrapper.php(98): CRM_Core_Controller->run()
#53 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(285): CRM_Utils_Wrapper->run("CRM_Admin_Form_Setting_Miscellaneous", "Misc (Undelete, PDFs, Limits, Logging, Captcha, etc.)", (Array:0))
#54 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(68): CRM_Core_Invoke::runItem((Array:16))
#55 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(36): CRM_Core_Invoke::_invoke((Array:4))
#56 /var/www/html/wp-content/plugins/civicrm/civicrm.php(1535): CRM_Core_Invoke::invoke((Array:4))
#57 /var/www/html/wp-includes/class-wp-hook.php(287): CiviCRM_For_WordPress->invoke("")
#58 /var/www/html/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters("", (Array:1))
#59 /var/www/html/wp-includes/plugin.php(478): WP_Hook->do_action((Array:1))
#60 /var/www/html/wp-admin/admin.php(254): do_action("toplevel_page_CiviCRM")
#61 {main}

```

# Answer
> 1 votes
Try turning logging off (administer - system settings - misc) and then doing the upgrade and then turning logging back on again. It seems like the log table definitions/triggers are getting out of sync for some reason.

# Answer
> 1 votes
So @demerit gave me the clue here. Several `log_civicrm_xxx` tables were corrupted **before** the upgrade (i.e. in my existing database), and `log_civicrm_msg_template` had some kind of corruption that caused it to disconnect the entire DB when mySQL tried to access it - even just `CHECK TABLE` flaked out, let alone OPTIMIZE.

Since I don't really care about the logging tables the simple fix was to drop the offending ones and turn off logging. I tested turning logging back on and then off again after upgrading and everything seems to be ok.

---
Tags: wordpress, upgrade, error
---


title: Regenerating UF Match

text:
# Question
Title: Regenerating UF Match
I started with a fresh install of Drupal 8 and did a migration of about 5K users. I am trying to force a recreation of the UF Matches. I cannot find a way to get CiviCRM to do this so I wrote the following code but this is not working either. Currently it delete the UFMatch from the table but it does not finish the final API call that creates the new match.

```
\Drupal::service('civicrm')->initialize();
$q = \Drupal::entityQuery('user');
$q->accessCheck(FALSE); //This is ran under cron
$q->sort('created', 'DESC');
$q->range(0,1);//Testing
$users = $q->execute();
foreach ($users as $uid) {
    $drupal_user = \Drupal\user\Entity\User::load($uid);
    $user_email = $drupal_user->getEmail();
    $result = civicrm_api3('UFMatch', 'get', [
        'sequential' => 1,
        'return' => ["contact_id", "uf_id"],
        'uf_name' => $user_email,
    ]);
    print $user_email;
    if ($result['is_error'] == 0) {
        foreach ($result['values'] as $value) {
            $uf_id = $value['uf_id'];
            $contact_id = $value['contact_id'];
            $uf_match_table_id_result_array = civicrm_api3('UFMatch', 'get', [
                'sequential' => 1,
                'return' => ["id"],
                'contact_id' => $contact_id,
            ]);
            $uf_match_table_id = $uf_match_table_id_result['id'];
            if ($uf_match_table_id_result_array['is_error'] == 0) {
                foreach ($uf_match_table_id_result_array['values'] as $uf_match_table_id_result) {
                    $delete = civicrm_api3('UFMatch', 'delete', [
                        'id' => $uf_match_table_id,
                    ]);

                    if ($result['is_error'] == 0) {
                        $create_match = civicrm_api3('UFMatch', 'create', [
                            'uf_id' => $uf_id,
                            'uf_name' => $user_email,
                            'contact_id' => $contact_id,
                        ]);
                    }
                }
            }
        }
    }
}

```

I think the issue might be the $uf\_id variable that I am getting from the contact and using in the UFMatch create API call.

Any ideas how to do this better or help with the code is greatly appreciated.

Thanks, Steve

# Answer
Did you try 'Synchronize Users-to-Contacts' from UI? You need to make sure you have unsupervised dedupe rule for individual set to email only before running 'Synchronize Users-to-Contacts'
> 1 votes

---
Tags: drupal, contacts
---


# Question
Title: Price Set Option still publically visible when visibility set to 'Admin'
Civi 5.26.1/Drupal 7.72

When I added an option 'Complimentary' to a pre-existing price set with an amount of '0.00' and set visibility to 'Admin', the option was still visible to anonymous users. Testing, I find that setting the 'Admin' option makes no difference to the existing options either.

The 'edit event participants' permission is switched off for anonymous users.

Could this be because the price set is already in use? Any similar experiences or hints for a work around?

# Answer
This belongs as a comment, but I'm bending the rules because I wanted to include screenshots.

I was unable to replicate this. See my attached screenshots from a demo site. The first screenshot is while logged in as an admin, the second is as an anonymous user on the same page. Since you're able to replicate this on the demo server, we must be setting up the page differently. Could you please edit your question to detail the exact steps you took to set this up? Or perhaps link to a video?

### As admin

### As anonymous
> 1 votes

---
Tags: civievent, price-sets
---


# Question
Title: There is so much old stuff on the interweb.... D8 and CiviEntities / Calendar integrations?
Just did a D-8.9.2 w/ CiviCRM and am struggling with the some very very old documentation.

Is civi entity still a valid module to help with crossing civi data --\> drupal 8?

I tried to composer require it and it failed.

The goal is to show a calendar on the Drupal page that was created in Civi.

Thanks

# Answer
Did you try installing and configuring Event Calendar extension? It provides UI to configure the calendar and these calendar can be exposed in front end as well. You read the installation guide on how to setup a calendar for your site.
> 0 votes

---
Tags: civievent, drupal-8
---


# Question
Title: How do I isolate the amount of a recurring contribution in CiviRules?
I want to use CiviRules to add new recurring donors to a group when they sign up, depending on how much they give per month.

I could set up the trigger to look at the value of each new contribution, but that will activate the rule every month.

My thought was to have the rule triggered on new membership (we are using iATS to generate memberships based on recurring contributions), and use the Membership Recurring Contribution field to evaluate the amount, but apparently that is simply an id number.

How can I find the value of a recurring contribution and add users to a group depending on the amount, but only when they first sign up?

CiviCRM 5.24.6, CiviRules 2.5

Thanks!

# Answer
You can use search builder using condition shown in image to create a smart group.

You can add more filter based on your payment processor to limit the result to first payment, for that you will need to diff between first payment and second payment in civicrm\_contribution table. For example if you using paypal for recurring contribution than the first contribution has invoice\_id set but the subsequent ones are set to NULL so you can use filter like Invoice reference not null, for Smart debit you can use contribution source eg contribution source like %Membership form%.
> 2 votes

---
Tags: civicontribute, civirules
---


# Question
Title: How can I create a mailing report with drupal views?
I would like to give access mailing report to one of my user that was sent to specific GROUP. from drupal permission I am not able to figure out an option to facilitate that. Therefore drupal views might be a way to go. Has anyone tired to create a drupal views for mailing report?

# Answer
> 2 votes
You can create list of mailing using views but you can't filter the results based on groups it was sent. To achieve this you will need to implement the handler or alter the query to filter result via hook.

Alternate method is to create a Mailing Summary civireport giving access to the specific report from the 'access' tab of the report.

You can create your own drupal permission via hook or custom permission extension and than selecting the permission from the access tab.

---
Tags: civimail, drupal-views, reports, mailing, custom-reports
---


# Question
Title: Does version 5.27 break links to live and test-drive pages for contribution pages?
Just upgraded a WP site to Civi 5.27.1. From 'Manage Contribution Pages' the links as given to Live and Test Drive for a given contribution page appear broken - i.e. they create a white screen indicative of a fatal error. The URLs provided are:

Live Page: https://www.example.org/wp-admin/admin.php?civiwp=CiviCRM&q=civicrm%2Fcontribute%2Ftransact&reset=1&id=1

and

Test Drive: https://www.example.org/wp-admin/admin.php?civiwp=CiviCRM&q=civicrm%2Fcontribute%2Ftransact&reset=1&id=1&action=preview

If I edit these URLs to replace "civiwp" with "page" they work fine.

Bug, or am I doing something wrong?

Seems to be related to this announcement: https://civicrm.org/blog/kcristiano/civicrm-526-and-wordpress-important-notice

Update: nothing in the Civi log.

# Answer
Enabling Cleaner URLs, as described here: https://docs.civicrm.org/sysadmin/en/latest/install/wordpress/#enabling-cleaner-urls-for-wordpress

appears to resolve this problem.
> 3 votes

---
Tags: civicontribute, ipn
---


title: How to become an CIVICRM AMBASSADOR

text:
# Question
Title: How to become an CIVICRM AMBASSADOR
i hope you are well. i just want to know how to become an ambassador of civicrm in my countr

Best regards

# Answer
> 1 votes
There is this blog post describing it: https://civicrm.org/blog/josh/community-ambassadors-needed

I would go to https://chat.civicrm.org and in the Community channel post a message to Josh.

---
Tags: community
---


# Question
Title: CiviMail adding ?civiwp=CiviCRM to all links - causing links to be bad
Using Mosaico 2.3 (2.4 does not work for us) & traditional civimail. CiviCRM 5.27.1 WordPress 5.4.2

All url's in civimail append ?civiwp=CiviCRM - causing errors when linking to wordpress pages. example.org becomes example.org/?civiwp=CiviCRM - This is fine for most URLs but causes issues with wordpress urls.

# Answer
You are correct. That is a bug. here is the report - https://lab.civicrm.org/dev/core/-/issues/1865

It's been fixed https://github.com/civicrm/civicrm-core/commit/bcbfa93e255ee15d9bd9e0f812b2a5a617458d73 and is planned for the next 5.27 release
> 2 votes

---
Tags: wordpress, civimail, mosaico
---


# Question
Title: Recurring contribution (monthly) with 'Pay Later'
Using 5.24.6 on Drupal - I have a contribution page for donations with the possibility to 'pay later' (bank transfer) or to pay by credit card (PayPal), and the possibility for choosing monthly payments (Recurring contribution). When a user chooses both monthly and pay later, they get the error 'You cannot set up a recurring contribution if you are not paying online by credit card.'

How can I allow people to 'declare' that they intend to make a monthly donation by bank transfer?

# Answer
This extension solves your use case and was designed for that purpose and several other related ones:

https://github.com/adixon/ca.civicrm.contributionrecur

For example, you can track recurring offline payments (whether by bank transfer or other form of recurring payments that don't have a civi extension) by configuring it to auto-generate contributions for those offline payments. Then you just have a monthly reconciliation task to weed out the ones that didn't go through.

It supports both credit card and bank transfer offline recurring payments (using separate 'placeholder' type payment processors).
> 3 votes

# Answer
That error message is misleading! Payment Processors which implement Direct Debit can do recurring Contributions. iATS Payments extension (both legacy and 1stPay) implement recurring ACH. In addition there is a make it happen for Stripe extension that’s well on it’s way to get ACH implemented.

Here's a screenshot of a monthly donation by bank transfer - this is a CiviCRM native Contribution page.
> 2 votes

# Answer
I have Offline recurring extension forked into my github account that supports for latest version of Civi. This extension allows one to create Contribution recur offline for check/cash payments/bank transfer etc. I think the same extension can also be supported to capture online pay later recurring contribution.
> 2 votes

---
Tags: recurring-contributions
---


# Question
Title: Can you use a theme with side bar items with shoreditch?
I'm experimenting with the latest version of Shoreditch on Drupal and it looks great with a theme like Seven (that has no sidebars).

It seems to work with Bootstrap - which does have side bars. But, the sidebars in bootstrap seem to push everything to far to the right.

Is this a bug? Or is shoreditch designed to take up the whole width of the screen and I should try to use it and have sidebars?

# Answer
I just tested Adminimal on a site with shoreditch, and while not pretty, i did get a sidebar
> 1 votes

# Answer
I wrote an extension that is not a clean fix by any means, shoreditchwpworkarounds, but it might help. I had written it for WordPress, but it should work for Drupal8 also.

Personally I think that removing sidebars is the better option. They use a lot of screen space, and the Recent Menu Items or kamlanguage extensions can help expose features that were previously blocks.
> 1 votes

---
Tags: drupal, theme, shoreditch
---


# Question
Title: How do i get the contribution table entries?
I want to get all the contribution table entries as a list which are equivalent to a given ID.

My contribution table has 4 entries and the contact ID for all the four contribution is 2.

I'm using the below method to get the details, but which takes the given ID as contactID and return the entries when contactID = contributionID..

```
foreach ($values as $key => $value){

        $contributionID = $values[$key]; //contribution IDs are 1,2,3,4,5

        // get the details for all selected contacts
        list($contributionDetails) = CRM_Utils_Token::getTokenDetails(array($contributionID),
          $this->_returnProperties,
          NULL, NULL, FALSE,
          $this->_allTokens
        );

```

Mean this only returns a row where contribution ID = contact ID = 2..but i want to get all the raw where contribution id is equal to 1,2,3,4 and 5.. how should i get it?

Thanks in advance!

# Answer
You can use CRM\_Contribute\_BAO\_Contribution::getContributionTokenValues() function to get details of contribution based on contribution id.

To get all data of contribution you can use api

```
$contributionData = civicrm_api3('Contribution', 'getsingle', ['id' => $contributionId]);

```
> 3 votes

---
Tags: civicontribute
---


# Question
Title: Why are deleted contacts showing in search results?
I just upgraded a Drupal site to `5.27.1` and am noticing that when I do a search for contacts, contacts that are in the trash are also showing up in results (which did not happen before). I was able to reproduce this on the official demo server as well (reporting `5.29.alpha1`) by deleting a contact and then running a search with that deleted contact's name -- they still show up in the results.

When I click on the contact record it still does show correctly that the contact is deleted.

# Answer
I think this is already reported on git lab and has fixed at https://github.com/civicrm/civicrm-core/pull/17798

The fix is available in 5.27.2 version of Civi. Try upgrading Civi to 5.27.2
> 3 votes

# Answer
Ah, found this: Advanced Search returns contacts in Trash even if 'Search in Trash' not ticked which links to this pull:
> 1 votes

---
Tags: search, delete
---


title: Shortcodes unavailable with Divi

text:
# Question
Title: Shortcodes unavailable with Divi
I use the DIVI template to build my pages and integrate CiviCRM. I don't see the "Civi Shorthcodes" button neither with Divi nor with Gutenberg.

How can I access the shortcodes?

Thanks to everyone.

# Answer
I'm not sure about Divi but with Guttenberg you can use either the shortcode block or paragraph block.

Just paste the code in there e.g. \[civicrm component="event" action="info" id="1"\]
> 2 votes

---
Tags: wordpress
---


# Question
Title: Is it possible to set "Do not mail" -- but only for a time
I was asked an interesting question the other day: is it possible to set time-bound privacy settings? (Such as "Do not email for 3 months" or similar). Perhaps an extension that is out there?

# Answer
> 2 votes
https://civicrm.org/extensions/do-not-contact-until

May not be compatible with latest version of CiviCRM as it hasn’t been updated for a number of years.

# Answer
> 0 votes
I dont think this is available yet in community via extension but its a good very feature to implement a cron job via as extension.

---
Tags: privacy
---


# Question
Title: Thank-you letters WYSIWYG vs html source content
Drupal 7.72 Civi 5.24.5

I recently added an IF statement to our receipts and Thank-You letters to comply with Florida Charity Regulations. The state of FL requires us to have a statement on our receipts for donors from FL. So I did a IF 'FL' then... It works with the System Workflow Templates for online and offline receipts. However, for checks we send a Thank-You Letter as a receipt. That kinda works. The difference I see is, the Thank-You letter has a WYSIWYG with it but the System Workflow Template online/offline does not. The WYSIWYG shows {if $stateProv eq 'FL'} but the html source has {if $stateProv eq & #39;FL& #39;} (I added spaces so it displays without converting to ') If I change the html source to {if $stateProv eq 'FL'} it works but even though we check "Update Template" it still needs to have this changed every time we use the Thank-You letter template.

1. How do I fix the Thank-You letter?
2. Where do I find the WYSIWYG settings in CiviCRM? I tried to find where to disable that or even find what WYSIWYG we are using so I could Google a fix to make '' stick.

# Answer
You can turn off html encoding for CKeditor through UI

Navigate to Administer \>\> Customize Data and Screens \>\> Display preferences

Scroll down until you see `Configure CkEditor` button. Click on it to view all the settings. Under Advance options add `entities` option as `False`(as shown in image) and save the form.

**Note: You will need to clear your browser cache to reflect the changes(and CiviCRM caches).**

If you want to turn off the ck-editor completely for whole site than you can switch to text area. You need to navigate it to CiviCRM \>\> Administer \>\> Customize Data and Screens \>\> Display preferences. Change value for Wysiwig Editor from ckeditor to text area.

HTH

Pradeep
> 2 votes

---
Tags: system-workflow-messages, wysiwyg
---


# Question
Title: CiviMail doesn't save when using Checksum event links
Running CiviCRM 5.10.4 and Drupal 7.65.

Trying to send out a bulk email through CiviMail using a checksum link for an event registration.

However when I insert the checksum link, I get an error message when CiviMail tries to autosave, or when I try to manually save:

```
Sorry an error occurred and your information was not saved

```

This is the checksum link I'm trying to insert

```
https://DOMAIN.com/civicrm/event/register?reset=1&id=89&cid={contact.contact_id}&{contact.checksum}

```

I've also tried with:

```
https://DOMAIN.com/civicrm/event/register?reset=1&id=89&{contact.checksum}&cid={contact.contact_id}

```

Have tried testing to save with every move I make when making the email, and have isolated the issue to only happening when I try to use these links (whether it's an image linked to this URL, or text).

I've checked and that is the correct event ID in the URL. I've tried inserting the link in the source code and in the WYSIWYG editor but neither are allowing me to save. I've tried writing out the URL in notepad and copying over from there in case any formatting is being pulled through somehow, but again no luck.

Any idea on where we're going wrong or how to fix this?

Cheers

EDIT: On more investigation, it allows me to save the email when I use the following link. However this creates an extra "cs=" in the URL so the checksums don't work....

The URL I've used this time is:

```
https://DOMAIN.com/civicrm/event/register?reset=1&id=89&cid={contact.contact_id}&cs={contact.checksum}

```

# Answer
> 1 votes
I just had this exact same problem. (I'm on Version 5.25.0, posting over a year later, so an upgrade would not have been the answer)

What "fixed" my problem was to change the order of the parameters so that the checksum parameter was first after the ?

https://DOMAIN.com/WEBFORM?{contact.checksum}&cid1={contact.contact\_id}

instead of:

https://DOMAIN.com/WEBFORM?cid1={contact.contact\_id}&{contact.checksum}

It is odd that the checksum token inserts "cs=" before it, which breaks the URL validation.

---
Tags: civimail, checksum
---


# Question
Title: DB Error: no such field Died during callApi - Error with civicrm_status_pref table
**System:** WordPress 5.3.2, CiviCRM 5.20.2, PHP 7.1.33

**Problem:** Since 1/1/2020 at 12:00am, every time our cron job runs on the hour I get an email notification that says

DB Error: no such field Died during callApi

In looking at the error log (shown below), the error is in an UPDATE statement on the civicrm\_status\_pref table, saying that the is\_active field doesn't exist. But it does:

I am not getting any other errors. System Status says that I'm a little behind with the PHP version and CiviCRM (but the error has persisted through one civi update). All extensions are up to date. And as near as I can tell, everything in CiviCRM is working fine.

What am I missing? Why am I getting this error? Thanks!

Error Log:

```
Feb 17 16:00:02  [error] $Fatal Error Details = Array
    (
        [callback] => Array
            (
                [0] => CRM_Core_Error
                [1] => exceptionHandler
            )

        [code] => -19
        [message] => DB Error: no such field
        [mode] => 16
        [debug_info] => UPDATE  civicrm_status_pref  SET domain_id = 1 , name = 'checkLastCron' , ignore_severity = 0 , check_info = '1581987602' , is_active = 1   WHERE (  civicrm_status_pref.id = 1 )   [nativecode=1054 ** Unknown column 'is_active' in 'field list']
        [type] => DB_Error
        [user_info] => UPDATE  civicrm_status_pref  SET domain_id = 1 , name = 'checkLastCron' , ignore_severity = 0 , check_info = '1581987602' , is_active = 1   WHERE (  civicrm_status_pref.id = 1 )   [nativecode=1054 ** Unknown column 'is_active' in 'field list']
        [to_string] => [db_error: message="DB Error: no such field" code=-19 mode=callback callback=CRM_Core_Error::exceptionHandler prefix="" info="UPDATE  civicrm_status_pref  SET domain_id = 1 , name = 'checkLastCron' , ignore_severity = 0 , check_info = '1581987602' , is_active = 1   WHERE (  civicrm_status_pref.id = 1 )   [nativecode=1054 ** Unknown column 'is_active' in 'field list']"]
    )

    Feb 17 16:00:02  [debug] $backTrace = #0 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(921): CRM_Core_Error::backtrace("backTrace", TRUE)
    #1 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(922): CRM_Core_Error::exceptionHandler(Object(DB_Error))
    #2 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/packages/DB.php(987): PEAR_Error->__construct("DB Error: no such field", -19, 16, (Array:2), "UPDATE  civicrm_status_pref  SET domain_id = 1 , name = 'checkLastCron' , ign...")
    #3 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(575): DB_Error->__construct(-19, 16, (Array:2), "UPDATE  civicrm_status_pref  SET domain_id = 1 , name = 'checkLastCron' , ign...")
    #4 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(223): PEAR->_raiseError(Object(DB_mysqli), NULL, -19, 16, (Array:2), "UPDATE  civicrm_status_pref  SET domain_id = 1 , name = 'checkLastCron' , ign...", "DB_Error", TRUE)
    #5 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1920): PEAR->__call("raiseError", (Array:7))
    #6 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/mysqli.php(933): DB_common->raiseError(-19, NULL, NULL, "UPDATE  civicrm_status_pref  SET domain_id = 1 , name = 'checkLastCron' , ign...", "1054 ** Unknown column 'is_active' in 'field list'")
    #7 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/mysqli.php(403): DB_mysqli->mysqliRaiseError()
    #8 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1229): DB_mysqli->simpleQuery("UPDATE  civicrm_status_pref  SET domain_id = 1 , name = 'checkLastCron' , ign...")
    #9 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(2416): DB_common->query("UPDATE  civicrm_status_pref  SET domain_id = 1 , name = 'checkLastCron' , ign...")
    #10 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(1318): DB_DataObject->_query("UPDATE  civicrm_status_pref  SET domain_id = 1 , name = 'checkLastCron' , ign...")
    #11 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(560): DB_DataObject->update()
    #12 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/StatusPreference.php(86): CRM_Core_DAO->save()
    #13 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/JobManager.php(93): CRM_Core_BAO_StatusPreference::create((Array:3))
    #14 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/api/v3/Job.php(134): CRM_Core_JobManager->execute(FALSE)
    #15 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/Civi/API/Provider/MagicFunctionProvider.php(101): civicrm_api3_job_execute((Array:2))
    #16 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(168): Civi\API\Provider\MagicFunctionProvider->invoke((Array:9))
    #17 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(99): Civi\API\Kernel->runRequest((Array:9))
    #18 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/api/api.php(23): Civi\API\Kernel->runSafe("Job", "execute", (Array:2), NULL)
    #19 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/bin/cli.class.php(122): civicrm_api("Job", "execute", (Array:2))
    #20 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/bin/cli.php(32): civicrm_cli->callApi()
    #21 {main}

```

# Answer
DO you have DB logging turned on? If so turn it off & back on again - the log\_civicrm\_status\_pref table might be missing the field
> 2 votes

# Answer
I had the same, the table was missing, I added it using

https://gist.github.com/xurizaemon/ac3d5bbc90712348d79a8d56bdd0b5ca

```
CREATE TABLE `civicrm_status_pref` (

     `id` int unsigned NOT NULL AUTO_INCREMENT  COMMENT 'Unique Status Preference ID',
     `domain_id` int unsigned NOT NULL   COMMENT 'Which Domain is this Status Preference for',
     `name` varchar(255) NOT NULL   COMMENT 'Name of the status check this preference references.',
     `hush_until` date   DEFAULT NULL COMMENT 'expires ignore_severity.  NULL never hushes.',
     `ignore_severity` int unsigned   DEFAULT 1 COMMENT 'Hush messages up to and including this severity.',
     `prefs` varchar(255)    COMMENT 'These settings are per-check, and can\'t be compared across checks.',
     `check_info` varchar(255)    COMMENT 'These values are per-check, and can\'t be compared across checks.'
,
        PRIMARY KEY (`id`)

    ,     INDEX `UI_status_pref_name`(
        name
  )

,          CONSTRAINT FK_civicrm_status_pref_domain_id FOREIGN KEY (`domain_id`) REFERENCES `civicrm_domain`(`id`)
)  ENGINE=InnoDB DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci  ;

```

and disabling the foreign key check.
> 1 votes

---
Tags: wordpress, error
---


title: How can I find out our civicrm sitekey?

text:
# Question
Title: How can I find out our civicrm sitekey?
I need to find out the sitekey for our developers. Not sure where to find this. Any advice appreciated!

# Answer
It's found in `civicrm.settings.php` and will be generated by the installer (or set manually depending on how your CiviCRM instance was configured). You're looking for a line that looks like this:

```
define( 'CIVICRM_SITE_KEY', "your.site.key.is.here");

```
> 6 votes

---
Tags: civicrm.settings.php
---


title: Anyone using Aegir to manage sites?

text:
# Question
Title: Anyone using Aegir to manage sites?
Not really a Civi specific question but someone here might have suggestions on the best place to discuss.

Got the basics working. Now I need to figure out how to best add in or update modules and themes

# Answer
> 0 votes
There are definitely folks using Aegir with Drupal 8/CiviCRM, and more using Drupal 7/CiviCRM. You can connect with them on https://chat.civicrm.org in the ~sysadmin channel.

---
Tags: civicrm-home, drupal-8, aegir
---


# Question
Title: Contribution/membership receipt - unable to disable
I did have a look around already but thus far without much luck.

We recently turned off the 'Email Receipt to Contributor?' option on a membership join page. I did check the ContributionPage settings and they show that the 'is\_email\_receipt' is off:

```
"values": [
    {
        "id": "5",
        "title": "Join xxx",
        "is_email_receipt": "0"

```

However new members joining are added as

```
 "contact_id": "14971",
    "currency": "EUR",
    "contribution_recur_id": "4696",
    "receive_date": "2020-07-06 00:51:41",
    "contribution_source": "Join xxx"

  "id": "4696",
        "contact_id": "14971",
        "amount": "10.00",
        "currency": "EUR",
        "frequency_unit": "year",
        "frequency_interval": "1",
        "start_date": "2020-07-06 00:51:38",
        "is_email_receipt": "1",**
        "contribution_type_id": "2",

```

Now I appreciate that for contacts that joined before switching off the receipts I would have to update the 'civicrm\_contribution\_recur' table to stop those but I cannot find a reason why new contacts are still being added with the "is\_email\_receipt": "1"

We use Stripe as the payment processor and the 'Allow Stripe to send a receipt for one-off payments?' for settings is disabled.

We are also using the nz.co.fuzion.transactional extension so I can see the receipt that goes out on the contact record (the Civi one).

Can anyone shed some light for me?

Civi 5.24.4/Drupal 7

Thank you!

# Answer
I'm looking right at the relevant line in the Stripe extension and I'm not seeing how to arrive in the state you're in.

The relevant line is in `api/v3/StripeSubscription.php` and reads:

```
    'is_email_receipt' => !empty($params['is_email_receipt']) ? 1 : 0,

```

Since `0` is considered "empty" in the line above, you should never have `is_email_receipt` set to `1` on your recurring contributions. I recommend placing debug statements above and below that line to ensure that a) this code is the correct code to look at, b) the values line up with what's expected.
> 0 votes

---
Tags: contribution-page, receipts
---


# Question
Title: What is the recommended/supported version of Webform CiviCRM module for Drupal 7?
What are the differences between Webform CiviCRM versions 7.x-4.x and 7.x-5.x?

# Answer
> 4 votes
The recommended/supported version is 7.x-5.x

If you're on 7.x-4.x (or below...) you are strongly encouraged to upgrade. The newer 7.x-5.x branch includes many bug fixes along with improvements in the code base, e.g. many direct database queries have been replaced by API calls.

Next week we will be going through the drupal.org webform-civicrm issue queue and we will be closing issues as outdated if they are against 7.x-4.x or below.

---
Tags: webform-civicrm
---


# Question
Title: How to attach a .pdf certificate to an email?
I have an insurance certificate that I want to send to specific member, manually or automatically as a .pdf attachment. How can I do this? My question seems stupid but I don't find the way.

With Search contacts, I can find the contact I've identified previously and within "Action:" I can Print/Merge documents but then I download a .pdf when I want to send it instead. I can also send an email using my HTML template with the right Fuzion tokens but it generates no .pdf attachment. So is there a way to combine both?

I saw these posts: how-can-i-attach-a-pdf-certificate-for-a-membership-payment but it's from 2015 and didn't seem successful and print-pdf-and-send-to-contact. I'm wondering if there is a simple way to get it done with CiviCRM 5.13.4.

Have I missed something really obvious?

# Answer
You could do this with the PDF Creation API extension: https://civicrm.org/extensions/pdf-creation-api

This extension allows you to send a PDF attached to an email.
> 1 votes

# Answer
How about saving yet more steps and make it a self-service: i.e. allowing Members to download their own PDF Certificate? I've detailed all the steps on how to do that with Drupal Views in this post:

How can Members download their own Membership Certificate/Card?
> 2 votes

# Answer
Hope I'm understanding your question correctly. I'm assuming that you have the PDF document saved somewhere else and that it doesn't require to be amended to suit the individual concerned.

Search for the individual to whom you wish to send the PDF.

In the Actions facility, there is an option to send an email. Select that and when it's loaded, you'll find an attachments section right at the bottom. In there you can browse to the appropriate place where your document is saved and attach it to the email.

If you wanted to send it to many individuals and by using CiviMail, there is a similar Attachment facility tab in there to enable the same thing.

If the certificate does require amendment to suit the individual, then you could create a template to include the whole certificate and use tokens to personalize it.

Hope this helps.
> 0 votes

---
Tags: pdf
---


# Question
Title: Webform Select List using Existing Contact
I have used "Existing Contact" Field in the Webform.

I want to list few contacts using select box instead of AutoComplete using Filter.

Edit Field show different Widget to show the contacts, one of theme is 'Select List'.

Once you save the 'Select List' Display format, front end form does not display/generate select element and its options.

I am using Laster Webform CiviCRM module under Drupal 8.

Anybody have idea of this, I tried same thing D7, its not working there too.

# Answer
This looks like a bug! Can you/Skvare help put a PR together to fix this issue?
> 1 votes

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


# Question
Title: Contact Summary Layout based on relationship
There is an extension called "Contact Summary Editor" by colemanmw which enables users to see specific parts of contact based on the group the user belongs to. During editing you can enable which ACL group is able to see which Contact Summary Layout.

I am wondering if there is a way to overwrite this extension to be able to choose which relationship enables certain Contact Summary Layout. For example, if the user is the relationship with the "Contact A" and this relationship is called "Owner of", then the user can see the most informations regarding "Contact A" and so on.

Have any one stumbled upon Contact views based on relationships?

# Answer
> 0 votes
How about creating a Smart group for each relationship type or so and having the layout available to group of contact. If not using Apiwrapper hook you can alter the filters of 'ContactLayout' entity.

# Answer
> 0 votes
You could try using the Permissioned Relationship extension to provide the control over contact A seeing Contact B but not Contact C. And then also add Contact A (and all similar contacts) in to a Group and use that Group and Contact Layout to control what they actually see on the Contacts Summary screen

---
Tags: relationships, contact-summary-editor
---


# Question
Title: Custom Fields used for Participants and then used in a Profile are not displayed
I have created specific custom fields for Participants. These are viewable in Preview mode under Custom Data. When these fields are used in a Profile they are not displayed in Preview mode.

I notice that the Profile I have created does not have anything shown in the "Type" column - whereas all the other profiles do have an entry - such as "individual, Contact". I cannot see where this "Type" entry is derived from when creating the profile. If its the Field Type (from the Custom Field) - then its not linking to Participants nor Events.

# Answer
Clearing the cache has resolved the problem. Thank your for your prompt responses.
> 2 votes

---
Tags: custom-fields, profile
---


title: Invalid Argument WebForm

text:
# Question
Title: Invalid Argument WebForm
I'm getting two error messages:

Warning: Invalid argument supplied for foreach() in wf\_crm\_get\_fields() (line 910 of /home3/site/public\_html/sites/all/modules/webform\_civicrm/includes/utils.inc).

Notice: Undefined index: caseRoles in wf\_crm\_get\_fields() (line 910 of /home3/site/public\_html/sites/all/modules/webform\_civicrm/includes/utils.inc).

when I try to enter information on Drupal 7 using a webform.

What could be causing this issue? Is there a way that I can work around this issue?

Thanks!

# Answer
Please see -\> What is the recommended/supported version of Webform CiviCRM module for Drupal 7?

First step would be to move to the supported version for D7WFC -\> 7.x-5.x

Your error message tells me you're on 7.x-4.x https://github.com/colemanw/webform\_civicrm/blob/7.x-4.x/includes/utils.inc#L910
> 2 votes

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


title: CiviCRM is defaulting to uppercase path

text:
# Question
Title: CiviCRM is defaulting to uppercase path
Somehow CiviCRM is wanting to use the path /CiviCRM (notice the case) instead of all lowercase civicrm. This has been fine until I upgraded to Civi 5.27 and now the civicrm?civiwp implementation results in a 404. I can change the case manually and it will work but the automatically generated URLs use all lowercase.

For example: https://www.domain.org/civicrm?civiwp=CiviCRM&q=civicrm%2Fevent%2Fregister&reset=1&id=24 == 404 Not Found

https://www.domain.org/CiviCRM/?civiwp=CiviCRM&q=civicrm%2Fevent%2Finfo&reset=1&id=24 == working

This is also breaking images in my Mosaico templates.

Example of a Mosaico image: https://www.domain.org/civicrm?civiwp=CiviCRM&q=civicrm%2Fmosaico%2Fimg&src=https%3A%2F%2Fwww.domain.org%2Fwp-content%2Fuploads%2Fcivicrm%2Fpersist%2Fcontribute%2Fimages%2Fuploads%2Fdcs\_e1de5c0ee5de2a85bb86821132d2aaba.png&method=resize&params=166%2Cnull

If you change the link to /CiviCRM?civiwp=CiviCRM.... it works.

I have verified that the permalink on the page is lowercase as well as the CMS Database Integration in Civi. Has anyone seen this behavior or have any suggestions for how I can correct it?

**UPDATE:**

Adding the following lines to my htaccess fixes this as a workaround. Still not sure why it is defaulting to CiviCRM instead of civicrm. Hopefully if this is happening to you, you can use this patch.

```
RewriteCond %{REQUEST_URI} !^/wp-content/
RewriteRule ^(.*)/civicrm(.*)$ /$1/CiviCRM/$2 [R,L]

```

# Answer
> 0 votes
This is a .htaccess workaround but I have tested and verified that it works. Please the following in your root .htaccess file or httpd-app.conf:

```
RewriteCond %{REQUEST_URI} !^/wp-content/
RewriteRule ^(.*)/civicrm(.*)$ /$1/CiviCRM/$2 [R=301,L]

```

If someone from the community cares enough to look into why this is defaulting to CiviCRM when everything is set to civicrm, please do. Otherwise this band-aid will have to do.

# Answer
> 0 votes
Can you check the CMS Settings `https://yoursite.org//wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fadmin%2Fsetting%2Fuf&reset=1` and see what you see?

I suspect it looks like:

Can you also check the WP Page 'CiviCRM' I suspect the slug is not 'civicrm' lowercase. These values must match in order for the urls to resove.

---
Tags: wordpress, links, redirect
---


title: Member as chapter and company

text:
# Question
Title: Member as chapter and company
So I know that the Organization contact type is sort of used for two purposes. One it can be a chapter of the primary org that the CiviCRM is setup for and it can also be used for a company that a member is an employee for. What I don't know is how do you setup a contact to be part of your chapter and also set their employer? Do we need to add a custom field to the summary view so that we can create this extra relationship?

Our client, whom we are setting CiviCRM up for, has some chapters/sub-orgs under the main Non-profit org and a member could be part of that org. But when adding the member, if they want to provide the company they work for, we would need to allow for this as well.

The OTB setup only has the employer which is the org lookup field, so not really sure if the chapter use is intended to be an extra custom field or not.

# Answer
You would normally handle this with multiple relationships on the "Relationships" tab.

I suspect an unspoken requirement is that the Chapter relationship should be on the "Summary" tab. You can do that with the Relationship Block extension, perhaps paired with Contact Layout Editor to position it where you want.
> 2 votes

---
Tags: contacts, organization
---


# Question
Title: french Installation of civicrm 5.27.2 on drupal 8
i want to install civicrm in french in my drupal 8.9.2 website. after following the instruction in this website https://lab.civicrm.org/dev/translation/-/wikis/Administrator-Guide. it's not work for me. please show me the best method install cheers

# Answer
> 2 votes
If you've already installed civi and you're able to get to the administer - localization - languages page, then the following is probably the simplest at this point:

In civicrm.settings.php (in web/sites/default), add this line to point to the l10n folder:

`define('CIVICRM_L10N_BASEDIR', '/full/path/to/l10n');`

OR

Move your l10n folder into vendor/civicrm/civicrm-core.

The first is slightly better because you can put l10n somewhere that won't get deleted when you upgrade, so then I'd also move l10n somewhere completely outside civi.

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


# Question
Title: Permissions error message using Profile (gid=12) in Online Registration
The following Message is returned when Users click on the Link to register for an Event.

"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.

The requested Profile (gid=12) is disabled OR it is not configured to be used for 'Profile' listings in its Settings OR there is no Profile with that ID OR you do not have permission to access this profile. Please contact the site administrator if you need assistance."

The Permissions for Anonymous users have been set to allow "register for events" and "view event info". Using the Registration (test drive) the profile is accessed OK. When I also test by sending myself the link by email it also works OK. However for another user (with Data Manager role) the error message is returned.

The Profile (ID=12) is a standard profile - "Your Registration Info" setup for Events. So I am not sure the message is describing the problem sufficiently. Any suggustions?

# Answer
> 1 votes
It sounds like you need to give anonymous and Data Manager users the 'CiviCRM: profile create' permission, and likely 'CiviCRM: profile edit' and/or 'CiviCRM: profile view' additionally.

---
Tags: civievent, profile, online-registration
---


# Question
Title: What is the purpose of logs for activities in civicrm_log table?
I am struggling with a large database and try to find ways to reduce data mess. I really wonder why there is no scheduled job to delete old log entries from civicrm\_log but this is not my question. Diving into this data I found out that there log entries created everytime an activity was created or updated. But it seems to me that these logs are never shown to admin in the backend?! For contacts there is a tab for the logs but for activities I could not find any page where the logs for an activity are listed.

Is there a way to avoid log creation for activities? Is there any way to list these logs to users or what is the reason to create these logs?

# Answer
> 1 votes
Under Administer - CiviReport - Create Report From Template there is one called "Database Log Report". That shows you more or less what's in civicrm\_log.

For advanced logging (at Administer - System Settings - Misc - Logging), which I don't think is what you're talking about but just in case, the lack of an activity report is a known issue. The advanced logging *Contact* logging report does not always show proper logs for *non-Contact* records.

---
Tags: activities, logs, logging
---


# Question
Title: How can I link E-Mail greetings/Postal greetings to "formal" or "informal" communication style?
is there a way to link a defined E-Mail greeting or Postal greeting if the communication style "formal" or "informal" is selected?

I thought it could work with CiviRules but we don't have it installed so far. So is there another way? I already tried it with the following token:

```
{if"{contact.communication_style}=="formell"}Sehr geehrte Damen und Herren

```

But it doesn't work. If I select "formell" there is still another greeting selected.

Thank you for any help Tina

# Answer
> 1 votes
If you're talking about CiviMail message templates I think this is very similar to this question, maybe even a duplicate. You need to use `{capture}` and then put the captured variable in your `if` statement.

---
Tags: contacts, email, tokens, civirules, addresses
---


# Question
Title: set standard recurring unit on contribution site
is there a way to set a standard for the dropdown of the recurring units (yearly, monthly, etc.) on a civi contribution site? We would like to have "yearly" instead of "monthly".

I tried to find sth in the configuration but apparently there is no easy way to do so.

Thanks for your help in advance.

# Answer
> 2 votes
The recurring configuration is present on contribution page under amount tab. There you can select the units that you want user to select when doing donation or payment.

The units supported by Civi are Year, Month, Week and Day

Doc: https://docs.civicrm.org/user/en/latest/contributions/online-contributions/#amounts-tab

---
Tags: civicontribute, contribution-page, recurring-contributions
---


title: Need help with profile removal question

text:
# Question
Title: Need help with profile removal question
It's these two items at the bottom. It came from when I was trying to set up profiles. Can someone tell me how to get rid of them? "who do you vote for" and "individual"

# Answer
They are custom fields, You should see them under Administer \>\> Customize Data and Screens \>\> Custom Fields
> 1 votes

---
Tags: civievent
---


# Question
Title: How do I hide a div tag for a specific event or contribution page?
I would like to hide a specific `div` tag for a specific event or contribution page ID. I am not good with JS. So prefer CSS `display:none;` method. Any help would be appreciated. Thanks

# Answer
I was doing this the other day. Have a look for the contribution page id div which wraps the form.

The following hides a section in the contribution page with id=2, but no other contribution pages...

> div.crm-contribution-page-id-2 div.editrow\_custom\_8-section { display: none; }
> 2 votes

---
Tags: civievent, contribution-page, css
---


# Question
Title: How to resolve Array to string conversion error
1. I'm sending a .ods file name into the makeFileName method to get a unique string value for the file name. but it return a file name which is not ending in .ods instead it end with `.unknown`.

Ex: `template_ods_65c986571c9c2737fff370ce4a745015.unknown`

but i need a file name like `template_65c986571c9c2737fff370ce4a745015.ods`.
2. Other thing is when i assign a returned string value into a variable, it gives me the array to string conversion error. **code**

$newName = CRM\_Utils\_File::makeFileName($value\['name'\]);

**Error**

> Array to string conversion in /var/www/html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php on line 554
>
> Warning: htmlspecialchars() expects parameter 1 to be string, array given in /var/www/html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php on line 556

I confused with these two error, i'll appreciate if someone could help me to resolve it

# Answer
For the first question you can go to Administer - System Settings - Safe File Extensions and add `.ods` to the list there.

For the second one is `$value['name']` actually a string or is it an array?
> 1 votes

---
Tags: error
---


# Question
Title: Activity Details report filter missing tags
The Activity Details report filter is missing the 'Tags' filter. The last filter is 'Groups' and just before that is 'County' which is where 'Tags' should be. The criteria for this field is 'Is one of' and the selection hint is 'Choose state first' - and is unselectable. The previous criteria to that is also 'County' which is working OK. This is a UK installation, at 5.26.2 and I have another installation at this same level where the 'Tag' filter shows OK. Very odd - I've disabled extensions, checked localisation, settings etc etc. I upgraded to 5.27.3 but exactly the same.

# Answer
> 4 votes
Only bare tags (tags not part of an activity set) trigger the field to appear.

The issue seems to be partly how the report retrieves tags where it calls getTags which only returns bare tags unless you give it a parent id for a tag set.

I think the report should be updated to match how it's done elsewhere. Where I've seen it it's usually done as two separate fields.

---
Tags: civireport, tags
---


title: How to default a pdf print template

text:
# Question
Title: How to default a pdf print template
Is there a way to set a default Template on the Print/Merge Document screen? I have a common workflow which uses a customised search, which then goes to the Print/Merge Document action (or a clone thereof) and I would like this to default to the correct template.

I have tried using Javascript to change the Select box, but it seems to have timing problems and sometimes the Template just does not appear.

With thanks, Tony

# Answer
I finally got a JavaScript delay to work with the following code. It's pretty ad hoc (to use a polite term) but does seem to work. Cycles until it can see that the ckEditor header has loaded, then waits another half second for luck and selects the required template.

Regards, Tony

```
jQuery(document).ready(function(){

function checkBold (rep) {
    // console.log('Bold: ' + $('#cke_24').is(':visible') );
    // Waits for the Bold button in the CKEditor to appear
    if ($('#cke_24').is(':visible') ) {
        setTimeout(function(){
            $('.crm-contact-task-pdf-form-block select#template').val('71').change();
        }, 500);
        return;
    }
    if (rep > 0) {setTimeout(() => checkBold(rep-1), 100);}
}

checkBold(100);                 // Limit of 10 seconds

});

```
> 2 votes

# Answer
The timing issue is probably ckeditor hasn't finished loading yet so it can't fill in the message body. Is your javascript wrapped in `.ready()`?

Otherwise you could try using the buildForm() hook in an extension and look up the template html for that template and then call setDefaults()

```
$result = civicrm_api3('MessageTemplate', 'get', array(
  'id' => 66, // or whatever the id is
));

$form->setDefaults(
  array(
    'subject' => $results['values']['msg_subject'],
    'html_message' => $results['values']['msg_html'],
  )
);

```
> 1 votes

---
Tags: message-templates
---


# Question
Title: Links inserted in Civimail are not redirecting and require a log-in
This seems to have started with CiviCRM 5.27.0 on a Joomla installation. When using Civimail to send out an e-mail to our users, the link no longer redirects to the initial destination but goes to the Joomla Administrator log-in page. If you are logged in as an administrator, then the link works properly on the redirect. I've upgraded to 5.27.2 with the same result.

# Answer
This is a bug. It has been resolved by https://github.com/civicrm/civicrm-core/pull/17760
> 2 votes

---
Tags: civimail, joomla
---


# Question
Title: What is the proper way to update to the recommended/supported version of Webform CiviCRM module for Drupal 7?
Here is what I'm trying to do. I'm trying to update to the latest version of the Webform CiviCRM, however, for right now the only way for me to update is to deactive the module and unistall it. I don't want to go that route.

What would be the best way for me to do it?

Thank you, Kevin

# Answer
> 3 votes
Excellent :-)

You will want to find out where your module lives -\> determine whether it lives in /sites/all/modules or in /sites/default/modules

Download a copy of the latest 7.x-5.x from our drupal.org project page: https://www.drupal.org/project/webform\_civicrm

Unpack that tar.gz

Then replace what you have in /sites/all/webform\_civicrm or /sites/default/modules/webform\_civicrm with that new copy you just downloaded/unpacked using sftp or scp (depending on your access to your site)

Running database updates is a good idea - always do that after you update any module. You can do that by typing /update.php behind your base URL in the browser - or go to Reports -\> Status Report and follow link (it should be reporting to you whether there are any pending database updates).

---
Tags: webform-civicrm
---


# Question
Title: How to set the main email account to send emails?
I'm switching my SMTP gateway to send emails from CiviCRM but for now I still have both. And even though I thought everything was sent from the newly configured service in `https://domain.net/civicrm/admin/setting/smtp?reset=1` I can see in logs that automatic reminders are still sent from the previous gateway and not from the new one.

Have I missed something? Do I need to configure an account elsewhere in CiviCRM for automatic reminder or any transactional email or is this just a normal delay?

Any ideas?

Guillaume

# Answer
it seems that there's a kind of delay for scheduled reminders because now all emails are sent from the right smtp account.
> 1 votes

# Answer
Have you set the default from email? https://domain.net/civicrm/admin/options/from\_email\_address?reset=1
> 0 votes

---
Tags: smtp
---


# Question
Title: How do I request an issue to be moved to the paid issue queue when I did not create the issue?
I'm wanting to move this issue to the paid issue queue from gitlab.

I'm not exactly sure what the steps are since I have not started the issue.

https://lab.civicrm.org/dev/core/-/issues/1400

Are only users who have created an issue allowed to move it to the paid issue queue?

Do I need to recreate this as a new issue?

# Answer
At this link it says send an email to info@civicrm.org: https://civicrm.org/about/core-team

It also says you can hire any of the experts.

On the particular civicase issue there are a couple tangled up issues with closed cases (https://lab.civicrm.org/dev/core/-/issues/1401) but maybe this one (which is listed in there) could be dealt with without getting too tangled. I have it on my own todo list to someday look closer at the proposal referenced in there about the more general issue, which may or may not intersect with this one.
> 2 votes

---
Tags: civicase
---


# Question
Title: New Install "MYSql Server Has Gone Away"
Good evening, I'm new here and trying to get CiviCRM installed for the first time (volunteer sysadmin for a non-profit).

I think I have gone through all of the steps to troubleshoot but I suspect I am missing something.

Relevant Versions:

* CiviCRM - 5.27.3
* WordPress - 5.4.2 (Multi-Site enabled but only primary site exists)
* Azure MySQL instance - 5.7.29-log
* Linux (Separate from MySQL) - "Ubuntu 18.04.4 LTS"
* PHP - PHP 7.2.24-0ubuntu0.18.04.6 (cli) (built: May 26 2020 13:09:11) ( NTS )
* NGINX - nginx/1.14.0 (Ubuntu)

Attempted adjustments:

1. Initially ran into SSL issues (Had MySQL set to SSL Enforce) Found some requests to adjust CiviCRM to accommodate this but in the meantime turned off enforcement to try and get the install to work. (This got me to the error below, all other changes listed have had no impact)
2. Ran as admin user
3. Updated MySQL config options (Timeouts, Innodb, max sizes, etc.)
4. Updated php.ini settings (timeouts, reconnect, etc.)
5. Repaired/Optimized Wordpress DB
6. Manually ran in civicrm.mysql to create tables
7. Followed XKCD Flowchart (https://xkcd.com/627/) regarding "MySQL Server has gone away"
8. Searched for install logs to try and find what was causing the error (failed to locate)
9. Ended up here, the results from the check seem to contradict (connection works well for all things EXCEPT knowing if the server is there)

Thanks for any ideas/direction.

# Answer
+1 for the xkcd reference.

There's some work being done on SSL but for the "server exists" error this is a known issue for azure. See https://lab.civicrm.org/dev/core/-/issues/1206

Briefly, just comment out the body of the check it mentions and instead make it always return TRUE: https://github.com/civicrm/civicrm-core/blob/5.16.2/install/index.php#L1036
> 3 votes

---
Tags: wordpress, installation, mysql, nginx, mysql-5.7
---


# Question
Title: How to set a Task or Communication in Compucorp new CiviCase
After creating new **Activity Type** either **Task** or **Communication**, I cannot see them in the Option for new Task or Communication. Even after the Caches cleared, the Task remains empty and Communication shows the 4 basic options (Email, Follow Up, Meeting and Phone Call). Is there something to add in the database ? Thanks for the help using this great new CiviCase ;-)

# Answer
Silly of me. I forgot about the very clever and granular way that CiviCRM is built. Just creating a new Activity Type was not enough to have it activated in the right CiviCase. After creating a new Activity Type (either Task or Communication), we must add these new Activities to the right Case Type that can be customised. And voilà, it's set !
> 1 votes

---
Tags: civicase, activity
---


# Question
Title: Where is the documentation for installing CiviCRM with Drupal 8 or for upgrading a Drupal 7 system with Civi to Drupal 8
This question is being asked so that it becomes the go to Answer for documentation / installation / migration questions hopefully.

# Answer
> 3 votes
Currently the primary location for documentation is

* Installation
* Migration of a CiviCRM system from D7 to D8 (tbc)

---
Tags: drupal, drupal-8, documentation
---


# Question
Title: How to import groups of contact and make it a new group
I am new in the CiviCRM community! As I am accustomed to closed-source CRM platforms, I have issues finding an answer to my need: I would like to import a group of contacts, and then make it automatically a new group so that I could email them.

It is possible and how?

Thanks, Mathilde

# Answer
You can import contacts and assign them to a group as you are importing. See https://docs.civicrm.org/user/en/latest/common-workflows/importing-data-into-civicrm/#preparing-to-import-data

When creating the Group check the box for "Mailing List" otherwise it won't be available as a group when you go to CiviMail - New Mailing.
> 2 votes

---
Tags: groups
---


# Question
Title: Filter in report mixing is one of and is not one of
Is there a way in any report to have more than one Tag or Group filter? For instance it would be useful to to create a report with filter is of "this tag" and is not of "this other tag".

Any idea?

# Answer
> 3 votes
You could use the include exclude custom search to get the data you've described. If you wanted to include only those in a report then probably you could create a smart group from the results and use that in the group of choice.

---
Tags: civireport
---


# Question
Title: Tracking completed transactions on CiviCRM in Google Analytics
We have a Drupal site using CiviCRM and I would like to track how many times users go to our membership, subscription, and donation pages and then complete those respective transactions. In setting up a Google Analytics conversion goal, we successfully set up one for when someone lands on the pages, but apparently did not set it up correctly for the completion.

We set up three goals, with each counting how many people landed on a thank-you page (civicrm/contribute/transact?\_qf\_ThankYou\_display=true) after coming from either the membership, subscription, or donation CiviContribute page respectively, as such:

But we're getting the exact same number for each goal, suggesting it's just counting how many times someone ends on the Thank-you page regardless of where they come from. As you can see from the third screenshot below, we are getting 135 for the Thank-you pages (Goal 4, 5, or 6 Completions), regardless of it being a Join, Subscribe, or Donate page that got them there. That number is close to what I'm seeing in Civi, though not exactly.

Any advice on how to fix that would be helpful.

# Answer
> 1 votes
It sounds like you're looking for the webtracking extension.

---
Tags: civicontribute, google
---