title: CV No Longer Works

text:
# Question
Title: CV No Longer Works
I am trying to use the CV command line tool and it is no longer working. I think it sopped working when I upgraded to 5.68.0. I am also running Drupal 9.5.11 on Amazon Linux 2. I have PHP 8 running.

The error is In Drupal8.php line 414: Class "ComposerAutoloaderInitDrupal8" not found.

Looking at the line Drupal8.php you can see it attempt to call the class. On line 416 of the same file there is a comment that says

```
// @Todo: do we need to handle case where $_SERVER has no HTTP_HOST key, ie. when run via cli?

```

Should it be expected that cv does not work any longer? Does anyone know the cutoff for when cv stopped working with CiviCRM if that is the case.

Thanks!

# Answer
> 1 votes
What version of `cv` are you running? You may need to upgrade. The current version (from `cv -V`) is `v0.3.48`

You can download the latest from https://github.com/civicrm/cv

---
Tags: upgrade, cv
---


# Question
Title: Custom Field Groups: "Tab with Table" display style missing
\[Edited from original question\]

When editing a `custom field group` for `Individuals` that allows multiple records, the `Display Style` option changes from `Tab with table` to `Inline`. Seems like a regression/bug.

On two different instances of Civi 5.67.3, when I used the UI to edit one of my custom field groups, it inadvertently changed to `Inline` display style. I was able to revert the display style back by setting `civicrm_custom_group.style` in the db back to `Tab with table`.

The front-end display of the custom field seems to work fine. It's just this backend custom field group edit form that seems to be the issue.

Civi 5.67.3 Shoreditch theme Drupal 10.1.6

---

Update #1

Here's a screenshot of the Edit Custom Field popup screen, showing that the group is set to `allow multiple records` and yet the display option doesn't show `Tab with Table`.

I don't see any javascript errors in the browser console.

I cannot replicate this on dmaster, so perhaps it's a localized issue.

---

Update #2

The weirdness on the edit custom group screen is happening only when there are actual records for that custom group.

Here's a custom group when there are NO records (after initial creation, or after adding and then deleting a custom field entry for an Individual).

And here's the same custom group when I add 1 record to an Individual.

Strange behaviors:

1. It's missing the fields: `maximum number of multiple records`
2. Under Display Style the `Tab with table` option is missing.

The `Tab icon` is missing because in the screenshot below it's set to `Inline` but shows up again if you select `Tab`, so that's working ok.

The edit screen shows the same weird behavior for custom groups allowing multiple records set to the other display styles (Tab, Inline), so it seems the issue is isolated to *custom groups that allow multiple records and have at least one data entry*.

Still trying to make heads or tails of this. I appreciate any insights.

# Answer
> 1 votes
Tab with Table I believe is only an option if you have selected "Does this Custom Field Set allow multiple records?"

Confirmed on dmaster

---
Tags: custom-fields
---


# Question
Title: "Additional Contributions" section is required: why?
The real question here is how to make it optional. Off the top of my head: make "No Thank You" option selected/default choice with a grain of JavaScript. Or https://docs.civicrm.org/dev/en/latest/hooks/hook\_civicrm\_buildForm/ \- however the latter feels a bit of overhead.

**Note** Cheers @petednz-fuzion

So there is a "Membership" section enabled and "Contribution Amounts section enabled" without Price set so "Fixed Contribution Options" is being used and "Allow other amounts" also.

# Answer
> 2 votes
I believe the solution you are looking for is available via Price Sets

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


# Question
Title: relationships no longer working as expected - data corruption?
Yesterday I asked a question that I thought expressed the problem I was having, but this morning as I tried to implement a fix, I realized that this CiviCRM site has a more serious problem. There is a fundamental problem with either or both of relationship data and relationship interfaces on a site I manage.

**Contact Page symptoms:**

1. for "broken" contacts (which is most of them), the relationships tab appears empty even if "employer" field is filled in on the individual contact summary page
2. if I attempt to add the employer relationship on the relationships tab of either the individual or the org, I get an on-screen error saying the relationship exists.
3. if I delete the employer field on the individual contact I can add the relationship on the relationships tab, but it doesn't appear and doesn't work.

I have discovered I can "repair" an organizational contact by creating a new one and merging the old one into it. This seems to read the data and write it properly to the new contact. This has the obvious disadvantages of changing CID and also of being a tedious manual task. This seems to repair the relevant individual contact too, so it seems likely the data problem is in how the relationships are written.

Is there a way to realistically examine the relevant data tables to see if there is a correctable problem? I do not know when the problem started.

There are no visible back end errors in Civi or Apache.

# Answer
> 3 votes
Based on comments the relationship\_cache table is incomplete. Since you've already rebuilt the triggers (missing triggers may have been the cause of it not getting populated), the cache just needs repopulating. Run this from the command line:

```
cv ev 'CRM_Contact_BAO_RelationshipCache::rebuild();'

```

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


# Question
Title: Contribution page not sending receipt for Paypal payment
I activated a contribution page and the PayPal Payflow Pro Integration extension. This is the log of the error

> 2023-12-05 11:49:44+0100 \[error\] CRM\_Contribute\_Form\_Contribution\_Confirm::completeTransaction CRM\_Core\_Exception: DB Error: no such field

in the front end page appear the message failed to update contribution in database

Which is the lost field?

This installation is CiviCRM ver. 5.67.3 on WP

Thank you in advance for the assistance

# Answer
You might want to enable "Display Backtrace" in "Settings - Debugging and Error Handling" - normally, the exact name of a missing DB field name could be found there. Or in apache/php error logs, depending on how your server has been configured.
> 0 votes

---
Tags: contributions, contribution-page
---


# Question
Title: Merge fails with DB Constraint violation
When merging 2 contacts this error appears however when the contact is checked the merge has succeeded:

```
$Fatal Error Details = array:3 [
  "message" => "DB Error: constraint violation"
  "code" => null
  "exception" => CRM_Core_Exception {#1782
    #message: "DB Error: constraint violation"
    #code: -3
    #file: "/var/www/vhosts/xxx.xxx/httpdocs/administrator/components/com_civicrm/civicrm/api/api.php"
    #line: 138
    #cause: null
    -_trace: null
    -errorData: array:8 [
      "error_code" => -3
      "sql" => "INSERT INTO `civicrm_activity` (`activity_type_id` , `subject` , `activity_date_time` , `status_id` , `priority_id` , `parent_id` ) VALUES ( 54 , 'Contact ID 11170 has been merged into Contact ID 41737 and deleted.' ,  20231214131919 ,  2 ,  2 ,  202919 ) "
      "debug_info" => "INSERT INTO `civicrm_activity` (`activity_type_id` , `subject` , `activity_date_time` , `status_id` , `priority_id` , `parent_id` ) VALUES ( 54 , 'Contact ID 11170 has been merged into Contact ID 41737 and deleted.' ,  20231214131919 ,  2 ,  2 ,  202919 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`xxx.xxx`.`civicrm_activity`, CONSTRAINT `civicrm_activity_ibfk_3` FOREIGN KEY (`parent_id`) REFERENCES `civicrm_activity_fudge` (`id`) ON DELETE SET NULL)]"
      "entity" => "Activity"
      "action" => "create"
      "is_error" => 1
      "error_message" => "DB Error: constraint violation"
      "debug_information" => "INSERT INTO `civicrm_activity` (`activity_type_id` , `subject` , `activity_date_time` , `status_id` , `priority_id` , `parent_id` ) VALUES ( 54 , 'Contact ID 11170 has been merged into Contact ID 41737 and deleted.' ,  20231214131919 ,  2 ,  2 ,  202919 ) "
    ]
    trace: {
      /var/www/vhosts/xxx.xxx/httpdocs/administrator/components/com_civicrm/civicrm/api/api.php:138 {
        civicrm_api3(string $entity, string $action, array $params = [])
        › if (is_array($result) && !empty($result['is_error'])) {
        ›   throw new CRM_Core_Exception($result['error_message'], $result['error_code'] ?? 'undefined', $result);
        › }
      }
      /var/www/vhosts/xxx.xxx/httpdocs/administrator/components/com_civicrm/civicrm/CRM/Dedupe/Merger.php:2188 { …}
      /var/www/vhosts/xxx.xxx/httpdocs/administrator/components/com_civicrm/civicrm/CRM/Dedupe/Merger.php:2104 { …}
      /var/www/vhosts/xxx.xxx/httpdocs/administrator/components/com_civicrm/civicrm/CRM/Contact/Form/Merge.php:324 { …}
      /var/www/vhosts/xxx.xxx/httpdocs/administrator/components/com_civicrm/civicrm/CRM/Core/Form.php:622 { …}
      /var/www/vhosts/xxx.xxx/httpdocs/administrator/components/com_civicrm/civicrm/CRM/Core/StateMachine.php:144 { …}
      /var/www/vhosts/xxx.xxx/httpdocs/administrator/components/com_civicrm/civicrm/CRM/Core/QuickForm/Action/Next.php:43 { …}
      /var/www/vhosts/xxx.xxx/httpdocs/administrator/components/com_civicrm/civicrm/packages/HTML/QuickForm/Controller.php:203 { …}
      /var/www/vhosts/xxx.xxx/httpdocs/administrator/components/com_civicrm/civicrm/packages/HTML/QuickForm/Page.php:103 { …}
      /var/www/vhosts/xxx.xxx/httpdocs/administrator/components/com_civicrm/civicrm/CRM/Core/Controller.php:355 { …}
      /var/www/vhosts/xxx.xxx/httpdocs/administrator/components/com_civicrm/civicrm/CRM/Utils/Wrapper.php:98 { …}
      /var/www/vhosts/xxx.xxx/httpdocs/administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php:295 { …}
      /var/www/vhosts/xxx.xxx/httpdocs/administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php:69 { …}
      /var/www/vhosts/xxx.xxx/httpdocs/administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php:36 { …}
      /var/www/vhosts/xxx.xxx/httpdocs/administrator/components/com_civicrm/civicrm.php:121 { …}
      /var/www/vhosts/xxx.xxx/httpdocs/administrator/components/com_civicrm/civicrm.php:40 { …}
      /var/www/vhosts/xxx.xxx/httpdocs/libraries/src/Dispatcher/LegacyComponentDispatcher.php:71 { …}
      /var/www/vhosts/xxx.xxx/httpdocs/libraries/src/Dispatcher/LegacyComponentDispatcher.php:73 { …}
      /var/www/vhosts/xxx.xxx/httpdocs/libraries/src/Component/ComponentHelper.php:361 { …}
      /var/www/vhosts/xxx.xxx/httpdocs/libraries/src/Application/AdministratorApplication.php:143 { …}
      /var/www/vhosts/xxx.xxx/httpdocs/libraries/src/Application/AdministratorApplication.php:186 { …}
      /var/www/vhosts/xxx.xxx/httpdocs/libraries/src/Application/CMSApplication.php:293 { …}
      /var/www/vhosts/xxx.xxx/httpdocs/administrator/includes/app.php:61 { …}
      /var/www/vhosts/xxx.xxx/httpdocs/administrator/index.php:32 { …}

```

Running CiviCRM 5.68 , PHP 8.1 , Joomla 4.4.1

# Answer
> 0 votes
According to this:

```
Cannot add or update a child row: a foreign key constraint fails
(`xxx.xxx`.`civicrm_activity`, CONSTRAINT `civicrm_activity_ibfk_3`
FOREIGN KEY (`parent_id`) REFERENCES `civicrm_activity_fudge`
(`id`) ON DELETE SET NULL)]

```

you may want to check the `civicrm_activity` table structure, discover where the `civicrm_activity_fudge` has come from and edit or remove this reference.

# Answer
> 0 votes
Run below query

```
ALTER TABLE civicrm_activity_contact DROP FOREIGN KEY civicrm_activity_ibfk_3;

ALTER TABLE civicrm_activity_contact
ADD CONSTRAINT `FK_civicrm_activity_contact_activity_id` FOREIGN KEY (`activity_id`) REFERENCES `civicrm_activity` (`id`) ON DELETE CASCADE;

```

Note: Take db backup before running query

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


title: Scheduled Reminders: From Email Address

text:
# Question
Title: Scheduled Reminders: From Email Address
Quick question: where does the Scheduled Reminders job get its "from" email address from? Ours is sending the upcoming activity reminders using an old domain and I can't figure out where I can change that. I've changed all the main emails of things I know (the from email addresses list, the main org contact email, the admin/org contact page, etc).

# Answer
It's on each of the individual scheduled reminders. Admin - communications - scheduled reminders.
> 1 votes

---
Tags: scheduled-reminders
---


title: Parent-Child Membership

text:
# Question
Title: Parent-Child Membership
In my organization, parents can register their child for a membership. If a parent registers more than one child for a membership, the parent should be billed for 2 memberships instead of one. The membership role is then given to both parents and the child. I figured I can use inheritance/relationships to set up sharing the membership. But, is there a good way to charge the parents based off how many children (and thereby memberships) they have a relation with? I'm on the latest civicrm using wordpress if that helps.

# Answer
> 0 votes
The simplest way would probably to create a price set for the membership that asks the parent how many children they are registering and sets that as the quantity.

This wouldn't be foolproof (a parent could fill in the number 1 for the price set and still register 3 children for the price of one), but a small amount of custom code could take care of validation to ensure that doesn't happen.

---
Tags: civimember, formbuilder
---


# Question
Title: Upgrade To PHP 8.1 Prevented By WordPress CiviCRM Plugin
WordPress v6.4.2 CiviCRM v5.68.0

My hosting provider stated, "The issue with \[my website\] is caused due to the plugin civicrm. It seems that the version of the plugin is not fully compatible with PHP 8.1."

So, I keep being told to update to PHP 8.1 but cannot. What do I need to do?

Thanks!

# Answer
I removed my acceptance of my answer of changing the {0} to \[0\] because I fear it might misguide others. The correct answer is a combination of @Coleman statement of updating the extension which is ALWAYS the proper way, if available, and that @bgm has updated the numerical hierarchy in order to accomplish this. I thank both parties for their time and effort and simply want the record to reflect their tireless efforts!
> 2 votes

# Answer
CiviCRM v5.68.0 *is* fully compatible with PHP 8.1.

However, some extensions you may be using for CiviCRM might not be. You should ask your hosting provider for clarification about the specific incompatibility they are referring to.
> 1 votes

# Answer
Changed {0} to \[0\] in line 246 and solved everything. Got the idea from here: civicrm.org/blog/bgm/php-8-support-civicrm-extensions
> 0 votes

---
Tags: wordpress, php8
---


# Question
Title: How do I create a SearchKit report that segments data based on a multi-valued custom field?
I have a custom field that allows users to select multiple options using a checkbox input.

The custom field has:

* Option A
* Option B
* Option C
* ...

The user can pick one or more of these, e.g. A+B or A+C or B+C+D etc.

I want to create a report that shows for example:

| Selected option | Number of contacts |
| --- | --- |
| A | 12 |
| B | 7 |
| C | 22 |
| ... |  |

I've tried to create a search display using SearchKit by grouping on the custom field but instead of grouping on the individual options, this groups on the combined options that the user has selected.

I get something like this instead, which is not what I want:

| Selected option | Number of contacts |
| --- | --- |
| A+B | 9 |
| A+C | 1 |
| B+C+D | 4 |
| ... |  |

Any suggestions?

# Answer
I was able to achieve something very similar to your request using multiple Data Segments, with the following steps:

1. Create a Data Segment for each of your option values (e.g. if the options are A, B & C you will create 3 data segments:
2. For each segment, you'll create one default option (No) followed by an option (Yes) that checks whether the field contains the given value (order matters here - the default needs to come first):
3. Create a search that includes all data segments as columns, and aggregates them using SUM(). For aggregation, you want to group all contacts into a single row, so group by something they all have in common (you can group by "contact type" or "contact is deleted"). In this example I gave one contact A+B and a second contact B+C and it correctly gives sums for all 3:
> 3 votes

# Answer
Initially, I thought of creating a DataSegment with values like:

* **A**: `[your_custom_field, CONTAINS, A]`
* **B**: `[your_custom_field, CONTAINS, B]`
* **C**: `[your_custom_field, CONTAINS, C]`

However the nature of DataSegments is that it stops looking after the first true condition is reached, so items with A+B would be listed as "A" only, B+C would be "B" only, etc.

Instead I think you need to create one Data Segment per option, with one option per segment. You could then create a search, grouped by Contact Id, and add each segment as a column (this gives you a pivoted version of your example, but at least you will have the data).
> 1 votes

# Answer
If you are using CiviCRM's out of the box multivalue checkbox then all the solutions are likely to be a hack and not performant due to that field type being an 'SQL antipattern'.

It may not be feasible in your case, but, I would consider switching to storing the data in a custom dataset that allows multiple rows per entity (this is currently only possible for contacts but should become available for all in early 2024). This would open up the option to do the query 'properly'.

Though note: if your plan is to collect this info from the public on a form builder form then you may need or want to improve the UI for presenting multi-value custom data as depending on your use case, this might look fairly clunky.

In the mean time, aside from what Coleman has suggested, another approach that might be worth exploring is using the EntitySet API which allows you to do unions. I am not sure if / how well that is supported that in Searchkit but a union of single row queries that each gives a count for `where field like '%A%` might work. If there aren't too many rows and they don't change too often.
> 1 votes

---
Tags: custom-fields, searchkit
---


# Question
Title: Why would related contact deletion keeps a Relationship active?
Have just discovered ( and confirmed on https://wpmaster.demo.civicrm.org ) that Relationships of a deleted Contact are continue to be active and are displayed as such.

Not quite sure if it is a bug or a feature? Why would Relationships with deleted Contacts be kept active? Shouldn't the system at least disable them?

# Answer
> 2 votes
Interesting question ... if they were disabled, it would make restoring the contacts a bit more complicated since it would need to figure out which relationships to re-enable. But disabling certainly seems reasonable.

As a workaround, you could write custom code using `hook_civicrm_post` to disable them, or probably do something with CiviRules.

It's probably worth creating an issue to get wider discussion.

# Answer
> 4 votes
It looks like that changed when the contact summary "Relationships" tab was replaced with a SearchKit version.

I've submitted this PR to fix it and hide deleted contacts from that tab.

---
Tags: relationships, delete
---


# Question
Title: How can I record a partial refund for a membership?
A user has just renewed their membership, and inadvertently opted for the default amount (60) rather than the correct amount for their particular situation (30). The contribution page offers two price options.

We've actioned the partial refund to address the overpayment, but I need to make a record in CiviCRM of this partial refund.

Right now it looks like the simplest option is to create a new manual contribution record with a negative value, assuming that's do-able, but it's far from ideal. Is there a better way that enables me to keep the membership and the record of the credit card payment already made?

# Answer
Yes you can create refund of overpayment transaction using edit line item extension
> 3 votes

# Answer
Why would you not use the 'Record refund' link on the contribution page? This keeps the history nice and tidy.
> 0 votes

---
Tags: civicontribute, civimember, contributions, refund
---


title: add language after installation

text:
# Question
Title: add language after installation
I succesfully installed Civicrm 5.68.0 on Joomla 4.41. I tried to install the Dutch language as instructed: unzipping languagetarball, creating new subdirectory in components/com\_civicrm/civicrm. I do not see the last subdirectory anymore (it was there in older joomla/civi versions). Only two different subdirectories: /elements and /views??

Checked the documentation, searched the answers in StackExchange: found no information on this.

What do I need to do to add a new language?? Install the l10n directory inside administrator??

Cheers, Paul

# Answer
> 0 votes
The l10n-directory resides in **\[JOOMLA ROOT\]/media/civicrm/l10n**.
I strongly recommend to use the Update Language Files Extension.
I tested it on Joomla 4.4.2 and CiviCRM 5.68.0 and can confirm that it works.

---
Tags: joomla, language
---


# Question
Title: How can I see a contact's date of birth?
How can I see a contact's date of birth?

I know it's entered because it's a mandatory field in the event sign-up form, but when I view the contact, I just see very limited data. How do I see ALL the contact's fields? This is using WP+CiviCrm (newest version 5.68.0).

# Answer
> 1 votes
Your screenshot is a customized layout rather than the standard one. The standard layout would show birth date, but one of 2 customizations on your site is hiding it:

1. You might be using the Contact Layout Editor extension. If so, you should edit the layout to include the "Demographics" section.
2. You might have disabled the panes in your Display Preferences. To fix it, go to **Administer -\> Customize Data & Screens -\> Display Preferences** in the menubar and ensure "Demographics" is enabled

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


# Question
Title: Uploading Documents for Members/Contacts
What is the easiest way to allow contacts (in our case, faculty) to upload information related to published articles or publications they've written to be viewed by a generic audience?

# Answer
> 0 votes
Have you tried the Documents extension https://civicrm.org/extensions/documents

---
Tags: civimember
---


# Question
Title: How can I identify the hard contributions/contributors that lead to a soft credit?
I have just upgraded from 4.4 to 4.7.19 and can't seem to identify a certain group of contacts now that the "In honour of" functionality has been subsumed into Soft credits.

When admin processes a membership, if the box "Record Payment from a Different Contact?" is ticked you can record that the payment for the membership was made by someone other than the member and send the receipt to the "other" rather than the member.

This results in the actual contribution being recorded against the "other" contact and a soft credit being recorded for the member.

I need to create a smart group of all the "paid for someone else" contacts for a certain soft credit type.

In Advanced Search with results displayed as contacts, when defining contribution search criteria the options for the **Contributions OR Soft Credits?** field are:

* Contributions only
* Soft credits only
* Soft credits with related Hard credit
* Both

(With the last three options a box that lets you specify soft credit type appears.)

Based on the names of the options, my plan was to create groups of contacts from "Soft credits only" and "Soft credits with related Hard credit\** searches and use the include/exclude custom search to create the "related hard credit contacts" group. But it doesn't work.

I would have thought **Soft credits with related Hard credit** should have given me a list of both the contacts getting a soft credit and the contacts who made the contributions that lead to the soft credits. However the results for **Soft credits with related Hard credit** are the same as the results for **Soft credits only** AND the results for **Both** are also the same.

This is true whether I am displaying results as contacts or as contributions.

So, I am not sure how the last three options differ from each other and I am no closer to being able to identify those people/organisations who paid for someone else's membership.

I did look at Search Builder also, but it does not seem to recognize any of the soft credit fields.

Does anyone have any suggestions?

# Answer
> 2 votes
I just published an extension called Soft Credit Custom Fields. As a side effect of what it does, it also allows you to search for soft credit type even when returning hard contributions, which should solve this issue.

# Answer
> 0 votes
Note that with SearchKit you can avoid Advanced Search malfunction.

```
[
  [
    "SavedSearch",
    "save",
    {
      "records": [
        {
          "name": "Fundraisers_P2P",
          "label": "Fundraisers P2P",
          "api_entity": "Contact",
          "api_params": {
            "version": 4,
            "select": [
              "id",
              "sort_name",
              "contact_type:label",
              "contact_sub_type:label",
              "GROUP_CONCAT(DISTINCT Contact_ContributionSoft_contact_id_01.soft_credit_type_id:label) AS GROUP_CONCAT_Contact_ContributionSoft_contact_id_01_soft_credit_type_id_label"
            ],
            "orderBy": [],
            "where": [
              [
                "Contact_ContributionSoft_contact_id_01.soft_credit_type_id:name",
                "=",
                "pcp"
              ]
            ],
            "groupBy": [
              "id"
            ],
            "join": [
              [
                "ContributionSoft AS Contact_ContributionSoft_contact_id_01",
                "INNER",
                [
                  "id",
                  "=",
                  "Contact_ContributionSoft_contact_id_01.contact_id"
                ]
              ]
            ],
            "having": []
          }
        }
      ],
      "match": [
        "name"
      ]
    }
  ]
]

```

---
Tags: contributions, search, soft-credit
---


# Question
Title: How can I create a group of everyone who gave in honor of a specific person?
I can see a list of everyone who gave in honor of a specific person by looking at that contact's Contributions tab (under Soft Credits). However, I can't figure out how to put these folks into a group, or even generate a report on them to see their contact info. How do I do this?

# Answer
I wrote an extension Soft Credit Custom Fields which, amongst other things, adds a "Soft Creditee's Name" field to the Advanced Search.
> 4 votes

# Answer
With SearchKit it's possible to create the smart group without the help of the extension:

```
[
  [
    "SavedSearch",
    "save",
    {
      "records": [
        {
          "name": "Fundraisers_P2P",
          "label": "Fundraisers P2P",
          "api_entity": "Contact",
          "api_params": {
            "version": 4,
            "select": [
              "id",
              "sort_name",
              "contact_type:label",
              "contact_sub_type:label",
              "GROUP_CONCAT(DISTINCT Contact_ContributionSoft_contact_id_01.soft_credit_type_id:label) AS GROUP_CONCAT_Contact_ContributionSoft_contact_id_01_soft_credit_type_id_label"
            ],
            "orderBy": [],
            "where": [
              [
                "Contact_ContributionSoft_contact_id_01.soft_credit_type_id:name",
                "=",
                "pcp"
              ]
            ],
            "groupBy": [
              "id"
            ],
            "join": [
              [
                "ContributionSoft AS Contact_ContributionSoft_contact_id_01",
                "INNER",
                [
                  "id",
                  "=",
                  "Contact_ContributionSoft_contact_id_01.contact_id"
                ]
              ]
            ],
            "having": []
          }
        }
      ],
      "match": [
        "name"
      ]
    }
  ]
]

```
> 1 votes

---
Tags: civicontribute, soft-credit
---


title: Cost for Setup and implementation

text:
# Question
Title: Cost for Setup and implementation
Hi can anyone give me a rough figure please? If I were to pay a developer to set up Civi CRM into Wordpress and just get it up and running, we host it ourselves and maintain it ourselves, but they do the initial setup and train us how to use it? And is there anyone here that can offer that service? Many thanks

# Answer
You may want to consider checking out CiviCRM Spark, see https://civicrm.com/ .

It is a hosted version with flat rate pricing. Very reasonable to start with.

One limitation is that there's not a default connection to WordPress. But, if you sign up and like it, there are partners who are Spark migration experts that can help you move to a full featured CiviCRM website using WordPress.
> 1 votes

---
Tags: installation, developer, setup
---


# Question
Title: Auto-responder with Scheduled Reminder emails
When sending an email via Civimail, it is possible to have any replies receive an auto-responder message saying that the email address is unattended or not monitored. Is this possible for Scheduled Reminders?

I've just discovered that members have been replying to our membership renewal reminders and we haven't been checking that email account.

# Answer
> 0 votes
You might consider resetting/customizing your reminder. You can then define the use of an auto-reply message in the tab "reactions" in CiviMail.

---
Tags: civimail, scheduled-reminders
---


# Question
Title: CIVICRM: Custom Field that uses financial type id
I'm new to Civicrm PHP and extension development so I'm sorry if this is a dumb question. ^-^

I'm making an extension that creates a new custom field group, the custom field group is meant to replicate the fields of a contribution *(so it has payment method, amount, currency type, ETC).*

The problem is the financial type id field, unlike payment method there isn't an option group that I can link the custom field to.

I've made a work around by creating an option group, updating the values inside to copy any changes made to the financial type table, while it's somewhat functional it's messy, breaks my site sometimes and has caused me hours of work fixing it *(I've had to make checks in install, uninstall, enable, disable, postCommit hooks)*

Is there a way I can add it to cause less bugs/errors like the contribution form, or should I just stick with my current work around and optimize it?

Help would be appreciated! I've been working on this extension for nearly a month atp haha ^-^

# Answer
> 1 votes
Handling `install, uninstall, enable, disable` is exactly what `hook_civicrm_managed()` is for! While this is an admittedly strange use for it and I have to wonder whether reproducing contributions using custom fields is really the best way to approach whatever problem your extension is trying to solve... that aside, it can be done!

1. Upgrade your copy of `civix` to the latest version.
2. Find the id of the option group you've already created to represent financial types (let's say it's `99`).
3. From within your extension's directory, run the command `civix export OptionGroup 99`
4. This will generate a new `.mgd.php` file in your extension's `managed` directory.
5. The file consists of 1 declaration of the optionGroup, plus a declaration for each option value. Leave the first one, and you'll convert the option values to a `foreach` loop:
6. In the `.mdg.php` file, you can call the api to fetch all financial types, then loop through them to add to the return value.

---
Tags: custom-fields, extension, api, contributions, php
---


# Question
Title: civicrm membership sync module for backdrop
I have downloaded and installed the above module for backdrop, but when I try to set an association to a membership role, I get an error of:

Error array\_keys(): Argument #1 ($array) must be of type array, null given

It doesn't give me any information and I need it to work. Any help is appreciated

# Answer
Answered here by @Pradeep Nayak:

> Regression from recent changes in https://github.com/civicrm/civicrm-backdrop/pull/150

> Fix: https://github.com/civicrm/civicrm-backdrop/pull/169/files

> Patch: https://patch-diff.githubusercontent.com/raw/civicrm/civicrm-backdrop/pull/169.patch
> 0 votes

---
Tags: backdrop
---


# Question
Title: DB Error: constraint violation on anonymous user event registration after 5.8.2 -> 5.9.0 update
After updating from 5.8.2 to 5.9.0, anonymous users suddenly get the above error when trying to register for an event.

Anyone a good hint how to resolve that? Thanks

Debug log shows

Datenbank-Errorcode: Cannot add or update a child row: a foreign key constraint fails (`db_local`.`civicrm_acl_contact_cache`, CONSTRAINT `FK_civicrm_acl_contact_cache_user_id` FOREIGN KEY (`user_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE), 1452 Zusätzliche Details:

Array ( \[callback\] =\> Array ( \[0\] =\> CRM\_Core\_Error \[1\] =\> handle )

```
[code] => -3
[message] => DB Error: constraint violation
[mode] => 16
[debug_info] => INSERT INTO civicrm_acl_contact_cache ( user_id, contact_id, operation ) VALUES(0, 0, 'View') [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`db_local`.`civicrm_acl_contact_cache`, CONSTRAINT `FK_civicrm_acl_contact_cache_user_id` FOREIGN KEY (`user_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]
[type] => DB_Error
[user_info] => INSERT INTO civicrm_acl_contact_cache ( user_id, contact_id, operation ) VALUES(0, 0, 'View') [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`db_local`.`civicrm_acl_contact_cache`, CONSTRAINT `FK_civicrm_acl_contact_cache_user_id` FOREIGN KEY (`user_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]
[to_string] => [db_error: message="DB Error: constraint violation" code=-3 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_acl_contact_cache ( user_id, contact_id, operation ) VALUES(0, 0, 'View') [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`db_local`.`civicrm_acl_contact_cache`, CONSTRAINT `FK_civicrm_acl_contact_cache_user_id` FOREIGN KEY (`user_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]"]

```

)

# Answer
> 2 votes
I could solve the problem... I had disabled the Mail module of CiviCRM as I do yet not use it. After reenabling it, the error was gone. Looks like that even disabled modules leave remnants in the database causing possible trouble.

# Answer
> 2 votes
This pull request seems relevant to the database error you encountered: (dev/core#660) Address regression whereby Anonymous users can no longer register for an event if they have ACLs to see a contact. This fixes an issue that was I believe introduced in Civi 5.9.0 and fixed in 5.9.1 .

See also related issue Fatal DB Error: already exists on event registration/contribution pages when profile has user creation.

# Answer
> 0 votes
We recently upgraded a CiviCRM installation from 4.6 to 5.9.0 and encountered the same issue when trying to register for a membership (contribution page) as anonymous user.

Disabling/enabling the CiviCRM Mail Component didn't fix this.

I removed the foreign keys in the database as a temporary fix:

`alter table civicrm_acl_contact_cache drop foreign key FK_civicrm_acl_contact_cache_user_id` `alter table civicrm_acl_contact_cache drop foreign key FK_civicrm_acl_contact_cache_contact_id`

# Answer
> 0 votes
I encountered this when I had a particular customization in place, but it revealed what I think is the core issue.

This error occurs when you have "view my contact" and/or "edit my contact" permission on the anonymous user - who, by definition, does not have a contact.

I'm submitting a patch, so hopefully this is a non-issue in CiviCRM 5.70+ or so, but you can fix it now by changing your CMS's user permissions.

---
Tags: error, database
---


title: Is it possible to archive civi events?

text:
# Question
Title: Is it possible to archive civi events?
Does anyone know of a way to archive old civi events? We're starting to build up quite a number and being able to archive some so that the current or at least relatively recent events were all that showed in our events list would be great.

Thanks

Jamie

# Answer
I recommend to "separate" past events by **creating a new/additional category for them,** named i.e. "archived".
In backend events management, you only see present and upcoming events (default). In frontend-calendars, you can exclude past events from being displayed or exclude categories ("archived"). In the frontend list-views, only present and upcoming events are displaying.
Further advantage of a using a category: you can create a CiviRule to automatically assign/unassign the respective categories once the event is x days/hours/months in the past.
> 1 votes

# Answer
I think you should find that all events archive themselves, provided that you have either entered an end date in each instance, or that each has been marked as disabled. You can find the controls in /civicrm/events/manage events. Hope this helps.
> 0 votes

---
Tags: civievent
---


# Question
Title: cv core:install throws an exception in Drupal 10
I use Drupal 10.2.0 fresh installed. I downloaded CiviCrm 5.68 with the commands

```
composer require civicrm/civicrm-{core,packages,drupal-8}
composer require civicrm/cli-tools

```

This installed civicrm/cv version v0.3.6

When I want to install CiviCRM with custom options the cv core:install command throws an exception:

```
[Symfony\Component\Debug\Exception\FatalThrowableError]
Class "Symfony\Cmf\Component\Routing\RouteObjectInterface" not found

```

Any help appreciated.

# Answer
I'm not sure why it would have installed such an old version of cv - you need a newer one for drupal 9/10 - but in general you will have better results using the phar download of cv rather than trying to get it with composer.
> 0 votes

---
Tags: drupal
---


# Question
Title: Mosaico - can emailed templates be copied to appear in Mosaico template option
Users have created some Mosaico based emails but have created and saved them only within an email, and have not used the 'Mosaico Templates' option. Some are newsletters that it would be useful to just update rather than redevelop. Is it possible to now copy those developed templates from the emails so they appear in the 'Mosaico Templates' option? This would make them more easily reusable. Using 5.67.3 with Drupal 7.

# Answer
You can make a copy of the Mailing and re-use the mosaic template
> 0 votes

---
Tags: mosaico, message-templates
---


# Question
Title: WordPress Site Health critical issues - CiviCRM 5.68.1 WordPress 6.4.2
I am getting two critical issues in the WordPress Site Health section. These are:

1. **An active PHP session was detected**

A PHP session was created by a session\_start() function call. This interferes with REST API and loopback requests. The session should be closed by session\_write\_close() before making any HTTP requests.

2. **The Rest API encountered an error**

The REST API is one way that WordPress and other applications communicate with the server. For example, the block editor screen relies on the REST API to display and save your posts and pages.

When testing the REST API, an error was encountered:

REST API Endpoint: https://www.example.org/wp-json/wp/v2/types/post?context=edit REST API Response: (http\_request\_failed) cURL error 28: Operation timed out after 10001 milliseconds with 0 bytes received.

...

There were similar reports three/four years ago, and the conclusion then was that it was nothing to worry about as the WordPress Core does not use sessions, whereas CIVICRM does use them. Is this still the case?

Some of the discussion about this is in this thread:

WordPress Site Health contains critical errors unless CiviCRM is disabled

and through the links found on the page.

If it is nothing to worry about, perhaps something could be added to the installation documentation about this known issue, so newbies like myself are pre-warned.

Thanks

Neil

# Answer
CiviCRM 5.28.2 triggering "critical issue" in WordPress 5.5 Site Health

This is not an issue with CiviCRM. It's a failure of Site Health to consider that other plugins may use sessions
> 2 votes

---
Tags: wordpress
---


# Question
Title: cron job with error php deprecation - str_replace(): Passing null to parameter
I'm curing a Joomla instance CiviCRM. Just updated from Joomla 3 to joomla 4.4.1 with CiviCRM 5.68.1.
Updated too the server debian version from 11 to 12.
configured cron task with cv version v0.3.48

`/opt/cv api job.execute --user=XXXX --quiet --cwd=/var/www/html/XXXX/htdocs`

Got this message :

> \[PHP Deprecation\] str\_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated at /var/www/html/XXXX/htdocs/administrator/components/com\_civicrm/civicrm/CRM/Utils/System/Joomla.php:525

How can I get rid of this error ?

# Answer
You could replace line 525 with `return $locale ? str_replace('-', '_', $locale) : NULL;`

I don't know enough about joomla to tell you why it can't determine your language. Possibly this is normal if it has no default, or maybe it is not set in your joomla site/user settings.
> 0 votes

---
Tags: php, cron-job, deprecated
---


# Question
Title: Database failures on activities after upgrade from 5.52 to 5.68.1
Upgraded from Civi 5.52 to Civi 5.68.1 on Drupal 7, PHP 7.3.13, Mysql 5.74. The errors are all revolving around activities. Anywhere in the UI that involves showing activities is returning a DB error in the UI and failing entirely. So, for example,

* Viewing a contact fails
* Viewing any report that involves activities fails

The error I see in ConfigAndLog is always the same:

```
Unexpected result from getcountArray ( [error_code] => -2 [sql] => [debug_info] => SELECT count(*) as c FROM civicrm_activity a LEFT JOIN civicrm_case_activity actjoin_case_id ON (actjoin_case_id.activity_id = a.id) WHERE (((`a`.`activity_type_id` Array))) AND (a.id IN (SELECT activity_id FROM civicrm_activity_contact WHERE contact_id = "412")) AND (actjoin_case_id.case_id IS NULL) AND (a.is_current_revision = "1") AND (a.activity_type_id IN ("1", "2", "3", "61", "49", "66", "50", "56", "51", "58", "59", "9", "5", "6", "7", "8", "4", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "44", "45", "46", "47", "48", "52", "53", "54", "55", "57", "60", "62", "63", "64", "65", "67", "68", "69", "70", "71", "72", "74", "76", "78", "80", "82")) AND (a.is_test = "0") AND (a.is_deleted = "0") [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Array))) AND (a.id IN (SELECT activity_id FROM civicrm_activity_contact WHERE ' at line 4] [entity] => Activity [action] => get [is_error] => 1 [error_message] => DB Error: syntax error [debug_information] => )

```

So it's the long list of activity types that seems to be throwing a SQL error.

Looking through ConfigAndLog, I don't see any errors showing throughout the upgrade process itself. And the rest of the site functions fine.

I have tried:

* Looking at the list of activities. There are none that are disabled or anything like that.
* Recreating reports that throw the error. That doesn't do anything. And anyway the error occurs even when viewing a contact.
* Searching here for any instances of the error `nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Array` but I don't see anything.
* Tried searching through the CiviCRM issues log for anything related to activities. Anything that is listed there looks like it got rolled into 5.68.1 though.
* Disabling CiviCase, because I saw a note in the issues log about CiviCase and activities for administrators. That did not do anything.

I'm stumped and not sure where to go from here.

Any suggestions welcome.

EDIT: Adding more fulsome log message with backtrace

```
2024-01-01 15:55:02-0800  [warning] Expected array of selectWhereClauses for civicrm_activity.activity_type_id, instead got "Array" Caller: Civi\API\SelectQuery::getAclClause
Array
(
    [civi.tag] => deprecated
)

2024-01-01 15:55:03-0800  [error]
$Fatal Error Details = array:3 [
  "message" => """
    Unexpected result from getcountArray\n
    (\n
        [error_code] => -2\n
        [sql] => \n
        [debug_info] => SELECT count(*) as c\n
    FROM civicrm_activity a\n
    LEFT JOIN civicrm_case_activity actjoin_case_id ON (actjoin_case_id.activity_id = a.id)\n
    WHERE (((`a`.`activity_type_id` Array)))\n
      AND (a.id IN (SELECT activity_id FROM civicrm_activity_contact WHERE  contact_id = "412"))\n
      AND (actjoin_case_id.case_id IS NULL)\n
      AND (a.is_current_revision = "1")\n
      AND (a.activity_type_id IN ("1", "2", "3", "61", "49", "66", "50", "56", "51", "58", "59", "9", "5", "6", "7", "8", "4", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "44", "45", "46", "47", "48", "52", "53", "54", "55", "57", "60", "62", "63", "64", "65", "67", "68", "69", "70", "71", "72", "74", "76", "78", "80", "82"))\n
      AND (a.is_test = "0")\n
      AND (a.is_deleted = "0")\n
     [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Array)))\n
      AND (a.id IN (SELECT activity_id FROM civicrm_activity_contact WHERE ' at line 4]\n
        [entity] => Activity\n
        [action] => get\n
        [is_error] => 1\n
        [error_message] => DB Error: syntax error\n
        [debug_information] => \n
    )\n
    """
  "code" => null
  "exception" => CRM_Core_Exception {#3870
    -errorData: array:5 [
      "error_code" => 0
      "entity" => "Activity"
      "action" => "getcount"
      "is_error" => 1
      "error_message" => """
        Unexpected result from getcountArray\n
        (\n
            [error_code] => -2\n
            [sql] => \n
            [debug_info] => SELECT count(*) as c\n
        FROM civicrm_activity a\n
        LEFT JOIN civicrm_case_activity actjoin_case_id ON (actjoin_case_id.activity_id = a.id)\n
        WHERE (((`a`.`activity_type_id` Array)))\n
          AND (a.id IN (SELECT activity_id FROM civicrm_activity_contact WHERE  contact_id = "412"))\n
          AND (actjoin_case_id.case_id IS NULL)\n
          AND (a.is_current_revision = "1")\n
          AND (a.activity_type_id IN ("1", "2", "3", "61", "49", "66", "50", "56", "51", "58", "59", "9", "5", "6", "7", "8", "4", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "44", "45", "46", "47", "48", "52", "53", "54", "55", "57", "60", "62", "63", "64", "65", "67", "68", "69", "70", "71", "72", "74", "76", "78", "80", "82"))\n
          AND (a.is_test = "0")\n
          AND (a.is_deleted = "0")\n
         [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Array)))\n
          AND (a.id IN (SELECT activity_id FROM civicrm_activity_contact WHERE ' at line 4]\n
            [entity] => Activity\n
            [action] => get\n
            [is_error] => 1\n
            [error_message] => DB Error: syntax error\n
            [debug_information] => \n
        )\n
        """
    ]
    #cause: null
    -_trace: null
    #message: """
      Unexpected result from getcountArray\n
      (\n
          [error_code] => -2\n
          [sql] => \n
          [debug_info] => SELECT count(*) as c\n
      FROM civicrm_activity a\n
      LEFT JOIN civicrm_case_activity actjoin_case_id ON (actjoin_case_id.activity_id = a.id)\n
      WHERE (((`a`.`activity_type_id` Array)))\n
        AND (a.id IN (SELECT activity_id FROM civicrm_activity_contact WHERE  contact_id = "412"))\n
        AND (actjoin_case_id.case_id IS NULL)\n
        AND (a.is_current_revision = "1")\n
        AND (a.activity_type_id IN ("1", "2", "3", "61", "49", "66", "50", "56", "51", "58", "59", "9", "5", "6", "7", "8", "4", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "44", "45", "46", "47", "48", "52", "53", "54", "55", "57", "60", "62", "63", "64", "65", "67", "68", "69", "70", "71", "72", "74", "76", "78", "80", "82"))\n
        AND (a.is_test = "0")\n
        AND (a.is_deleted = "0")\n
       [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Array)))\n
        AND (a.id IN (SELECT activity_id FROM civicrm_activity_contact WHERE ' at line 4]\n
          [entity] => Activity\n
          [action] => get\n
          [is_error] => 1\n
          [error_message] => DB Error: syntax error\n
          [debug_information] => \n
      )\n
      """
    #code: 0
    #file: "/var/www/html/sites/all/modules/civicrm/api/api.php"
    #line: 138
    trace: {
      /var/www/html/sites/all/modules/civicrm/api/api.php:138 {
        civicrm_api3(string $entity, string $action, array $params = [])
        › if (is_array($result) && !empty($result['is_error'])) {
        ›   throw new CRM_Core_Exception($result['error_message'], $result['error_code'] ?? 'undefined', $result);
        › }
      }
      /var/www/html/sites/all/modules/civicrm/CRM/Activity/BAO/Activity.php:900 { …}
      /var/www/html/sites/all/modules/civicrm/CRM/Contact/BAO/Contact.php:2651 { …}
      /var/www/html/sites/all/modules/civicrm/CRM/Contact/Page/View/Summary.php:434 { …}
      /var/www/html/sites/all/modules/civicrm/CRM/Contact/Page/View/Summary.php:255 { …}
      /var/www/html/sites/all/modules/civicrm/CRM/Contact/Page/View/Summary.php:83 { …}
      /var/www/html/sites/all/modules/civicrm/CRM/Core/Invoke.php:322 { …}
      /var/www/html/sites/all/modules/civicrm/CRM/Core/Invoke.php:69 { …}
      /var/www/html/sites/all/modules/civicrm/CRM/Core/Invoke.php:36 { …}
      /var/www/html/sites/all/modules/civicrm/drupal/civicrm.module:472 { …}
      /var/www/html/includes/menu.inc:527 { …}
      /var/www/html/index.php:21 { …}
    }
  }
]

2024-01-01 15:55:03-0800  [debug] $backTrace = #0 /var/www/html/sites/all/modules/civicrm/CRM/Core/Error.php(443): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 /var/www/html/sites/all/modules/civicrm/CRM/Core/Invoke.php(39): CRM_Core_Error::handleUnhandledException(Object(CRM_Core_Exception))
#2 /var/www/html/sites/all/modules/civicrm/drupal/civicrm.module(472): CRM_Core_Invoke::invoke((Array:3))
#3 /var/www/html/includes/menu.inc(527): civicrm_invoke("contact", "view")
#4 /var/www/html/index.php(21): menu_execute_active_handler()
#5 {main}

```

EDIT 2: Updating the ActivityType ACL extension fixed the issue. Thank you @Demerit because without your timely comment I wouldn't have posted the latest backtrace and that's where I noticed the reference to ActivityType ACL...I've been staring at backtraces for the last 3 hours without noticing that. Thank you!

# Answer
> 1 votes
This issue ended up being with the ActivityType ACL extension. Once I upgraded that extension to its latest version the errors went away.

Lessons learned:

* Since I could not find any discussion about this error either here or in the CiviCRM core github or gitlab, that should have clued me in to the fact that this is something unique to my environment - and the most unique thing is actually the extensions.
* Since I was doing my first upgrade in ~1 year, it stands to reason that many extensions would break. Updating extensions first before updating Civi might have been a better strategy.
* When I saw error messages about activities, rather than work hard to decipher the big backtrace and try to understand why the SQL statement was failing (which is where I went to) I should have immediately suspected an extension and looked at which extensions relate to activities.
* Another simple step I did not take would have been to disable any extension related to activities -- or even just keep disabling extensions one at a time to find if any of them were the problem.

This community is amazing. Thank you so much @Demerit for all of your rapid, timely help!

---
Tags: upgrade, database
---


# Question
Title: Preventing some users from viewing/editing a specific sub-contact type?
I am using CiviCRM v5.66 on WordPress v6.4.2, and using using the WordPress Access Control.

I have created a new Individual sub-type contact called MySubType. I have created a new WordPress role called MySubType\_Role (duplicate of subscriber role).

For users that have some or all of "add/edit/view/delete contacts", I want to prevent these users from accesssing MySubType contacts (add/edit/view/delete), and only grant access to users if I assign the WordPress MySubType\_Role to them.

Is there a way to do this with code from my custom extension I already have installed? I am using Traditional Hooks... not sure if this would use any Database hook or Form hook as well as some of the Permission hooks: https://docs.civicrm.org/dev/en/latest/hooks/list/

I do not know the proper code to use, so this is just an example of the logic of the code:

```
if ( user_has_permission_to(add/edit/view/delete contacts) ) {
  if ( contact_sub_type == "MySubType" ) {
    if ( current_user_has_wp_role == "MySubType_Role" ) {
      grant_access(add/edit/view/delete this contact); //GRANT accesss to sub-contact type
    } else {
      deny_access(add/edit/view/delete this contact); //DENY access to sub-contact type
    }
  }
}

```

# Answer
> 0 votes
As you probably are aware, ACLs are inherently complex, usually more than you realise before digging into them.

A non-code approach might be to create a smart group on the subtypes, and then use the acl ui configuration tools to try and limit access, but that might be a lot more clumsy than you want.

Preventing access is usually broken down in to permissions to edit, delete, view and list. So you might want people to list them but not see details, etc.

One challenge with the requirements you have described is that contact data can be exposed in multiple ways, e.g. using profiles, or even cms tools (e.g. drupal), so your solution will probably have to depend on balancing the likely hood of various tools being in use vs. how important it is to prevent access.

But, to accomplish your goal in the way you're describing, I believe you'd want to implement this hook:

https://docs.civicrm.org/dev/en/latest/hooks/hook\_civicrm\_aclWhereClause/

---
Tags: contacts, permissions, acl
---


title: CiviCRM installation fails on Drupal 10

text:
# Question
Title: CiviCRM installation fails on Drupal 10
I am installing CiviCRM on a new server, new Drupal 10. Per instructions, I ran the following commands:

```
cd /var/www/drupal
composer require civicrm/civicrm-{core,packages,drupal-8}
composer require civicrm/cv -W

```

Also tried per this post

```
composer config minimum-stability dev
composer require 'drush/drush:12.*'

```

Got the following error:

```
 Your requirements could not be resolved to an installable set of packages.
  Problem 1
    - civicrm/cv dev-master requires symfony/process ^4 -> found symfony/process[v4.0.0-BETA1, ..., 4.4.x-dev] but these were not loaded, likely because it conflicts with another require.
    - civicrm/cv[v0.1.0, ..., v0.1.1] require symfony/console ~2.3 -> found symfony/console[v2.3.0, ..., 2.8.x-dev] but these were not loaded, likely because it conflicts with another require.
    - civicrm/cv[v0.1.2, ..., v0.2.1] require symfony/console ~2.8 -> found symfony/console[v2.8.0-BETA1, ..., 2.8.x-dev] but these were not loaded, likely because it conflicts with another require.
    - civicrm/cv[dev-colemanw-patch-1, v0.2.2, ..., v0.3.13] require symfony/console ~2.8|^3 -> found symfony/console[v2.8.0-BETA1, ..., 2.8.x-dev, v3.0.0-BETA1, ..., 3.4.x-dev] but these were not loaded, likely because it conflicts with another require.
    - civicrm/cv[v0.3.14, ..., v0.3.48] require symfony/console ^4 -> found symfony/console[v4.0.0-BETA1, ..., 4.4.x-dev] but these were not loaded, likely because it conflicts with another require.
    - Root composer.json requires civicrm/cv * -> satisfiable by civicrm/cv[dev-master, dev-colemanw-patch-1, v0.1.0, ..., v0.3.48].

You can also try re-running composer require with an explicit version constraint, e.g. "composer require civicrm/cv:*" to figure out if any version is installable, or "composer require civicrm/cv:^2.1" if you know which you need.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

```

```
PHP 8.2.9
Drupal 10.2.0
Amazon Linux 2023
Apache 2.4.5.8
Composer 2.6.6

```

# Answer
**UPDATE**: Instructions have been fixed, although I still personally think you'll get better results with the phar, and `cv` is generally something you want to install for all the sites on the server so only needs one copy.

---

I know the instructions say it but I wouldn't try to install cv this way for drupal 9/10. Use the phar download of cv rather than trying to get it with composer.
> 2 votes

# Answer
Instead of

```
composer require civicrm/cv -W

```

use

```
composer require civicrm/cli-tools

```

as in the updated Installation Guide (see post of @Demerit above). Then, you have to add your `vendor/bin` directory to `$PATH`. This worked for me recently.
> 1 votes

---
Tags: drupal, installation
---


# Question
Title: Word replacement of word "Check" with "Cheque" does not work everywhere
CIVICRM 5.67 Wordpress 6.4.2 Example: In membership renewal, payment section most occurences are replaced but "Check Number" is not. My question is: do I need to add replacements for the complete string such as "Check Number" with "Cheque Number" or is current situation a bug. This is not in anyway high priority

# Answer
> 2 votes
I can see in the en\_GB translations it hasn't been translated yet: https://lab.civicrm.org/dev/translation/-/blob/b5f52d09f30de9ce51e90400fa4b524f1fc4a879/po/en\_GB/common-base.po#L12313. (Well, technically it has been translated, but it was probably auto-filled from the en\_US. If it hadn't been translated yet you'd see a blank for the msgstr.) The right way to do this is to update it in transifex: https://lab.civicrm.org/dev/translation/-/wikis/home#translate-civicrm, and then eventually it will get included in the civi translation files.

In the meantime you could try using en\_AU which appears to have it translated: https://lab.civicrm.org/dev/translation/-/blob/b5f52d09f30de9ce51e90400fa4b524f1fc4a879/po/en\_AU/common-base.po#L12304

---
Tags: translation
---


# Question
Title: One person registers multiple people to an event, but CiviCRM stores all registrations to one person
We're seeing event sign-ups for multiple (non-member) participants that are made by one (non-member) person - in our case, a parent registering two children to two different swim trainings. They correctly get individual registration-confirmation emails, stating their individual names, but in our system **it looks like only one participant** booked two different events. The other person is completely missing in CiviCRM. **Is this a bug?**

For context, this is the (currently newest) version 5.68.0 on (currently newest) WP 6.4.2, and the event registrations contain a mandatory field for email address. Obviously in this scenario, the parent will use the same email address for both registrations.

This answer to a closely related question indicates that the "*default unsupervised rule says individuals with matching email addresses are the same person*". Our events are indeed set up using that rule "Email address (reserved) unsupervised" but the wording of this is confusing me.

Should we simply blank out the rule field, and **not use any deduplication rule?** should we use name+email? Supervised or unsupervised; what does that even mean? I really don't understand the event documentation about this, nor the deduplication documentation.

We don't actually care whether we end up with duplicates in our system. Each event is separate, and each participation is separate. We do not need to know whether some participant might have participated before.

**Side note:** if it turns out that we need to change the dupe setting, how can we do that for 20+ events at once, rather than having to manually edit each one separately?

# Answer
**Status:** It looks like the default behaviour of CiviCRM prevents the use of the same email address for multiple participants.

1. If an event specifies no rule, then the default applies: that is **"Email (unsupervised)"** and yes, that prevents the use of the same email address for multiple participants.
2. There's a rule **"Name and Email (supervised)"** which sounds good (because the name would be different while allowing the email address to be reused), but "supervised" means that it's only available for admins and **this can't be used** for public sign-up pages used by non-members.
3. There's a rule **"Name and address (general)"** which apparently doesn't care about the value of the email address. Maybe that's useful, I don't know.
4. It's unclear to me why the registration-confirmation emails are sent out with correct individual names. Apparently the problematic deduplication only happens after sending the email. (Side note: the payment processing also shows the deduplicated name, not the expected individual names. **This appears to be a bug** and needs to be reported via established channels (I don't know what those channels are).

**Solution:**

1. First, determine whether "Name and address (general)" might be used and if so then continue with step 5 below; otherwise create a new rule as follows:
2. In CiviCRM, navigate to **Contacts \> Find and merge duplicate contacts**.
3. Under **Person rules**, click **Add New Person Rule**.
4. Enter a rule name, then select first name + last name + birth date (not email address). Then give each field a weight of 1. Then enter the sum (3) as threshold value. Save.
5. In CiviCRM, navigate to **Events \> Manage events**.
6. Edit every event by clicking **Configure \> online registration**, then choose your new duplicate matching rule, then Save.
> 1 votes

---
Tags: civievent, duplicate-contacts, online-registration
---


# Question
Title: CiviCRM Spark updates fail due to lack of read permissions on directory
I am using CiviCRM Spark. I don't believe I can change permissions on directories (?). These are the errors:

```
Error: Your extensions directory (/var/aegir/platforms/civicrm-d7/web/sites/atcni.civicrm.org/modules/extensions) is read-only.If you would like to perform downloads or upgrades, then change the file permissions.

This system uses PHP version 8.0.30. This meets the minimum recommendations and you do not need to upgrade immediately, but the preferred version is 8.1.0.

```

This is the joblog:

```
2024-01-03 14:00:10 CiviCRM Update Check
Entity: Job Action: version_check
Summary
Finished execution of CiviCRM Update Check with result: Failure, Error message: File not writable
Details

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

Full message:
Finished execution of CiviCRM Update Check with result: Failure, Error message: File not writable

Scheduled Job CiviCRM Update Check is failing. Error was: Finished execution of CiviCRM Update Check with result: Failure, Error message: File not writable
CiviCRM Patch Available

```

# Answer
There are actually three separate alerts here. I don't think any of these is really a problem and you can safely ignore all three of them.

CiviCRM Spark is a managed system and is deliberately configured so that users are unable to alter directory permissions or install/update extensions.

The message about the PHP version is just saying that PHP 8.1 is preferred. CiviCRM will run fine on PHP 8.0.

The job log is indicating that it was not possible to check for updates. Note that this is just a check to see if there is a new update available it isn't actually performing the update.

Updates are managed by CiviCRM Spark so there is nothing that you need to do (or can do) in any case.
> 2 votes

---
Tags: directory, civicrm-spark, php8
---


title: Integration with the Webflow platform

text:
# Question
Title: Integration with the Webflow platform
I have experience with CiviCRM and am considering it for a new client. They have multiple websites and constituent databases. Their primary website is built on Weblow with a Shopify subdomain. Will CiviCRM play nice with Webflow?

# Answer
CiviCRM doesn't integrate directly with Webflow. As Demerit has said it only integrates directly with WordPress, Drupal, Joomla and Backdrop.

However, this isn't necessarily a problem. There are many organisations that host their CRM separately from the main website. Any integration can be performed via the API and/or with the help of some of these extensions:
> 0 votes

# Answer
You can only install it with the cms's listed at https://docs.civicrm.org/installation/en/latest.

Depending on what you need, you don't have to really do anything with that cms except set up users in it, and then you could use one of a couple remote options to connect data. See e.g. How can I connect my website to CiviCRM on a remote server?

Not sure if you need to integrate with shopify at all but see also https://lab.civicrm.org/extensions/shopify
> 1 votes

---
Tags: cms-integration
---


# Question
Title: Installing CiviCRM on Localhost with Windows and XAMPP for WordPress
Question: How can I successfully install CiviCRM on my localhost running Windows with XAMPP and integrate it seamlessly with WordPress?

Explanation: I am currently working on a local development environment for a WordPress website using XAMPP on a Windows machine. I am interested in incorporating CiviCRM for enhanced constituent management and engagement. However, I am facing challenges with the installation process. I would appreciate detailed guidance on the steps required to install CiviCRM on my localhost and integrate it effectively with my WordPress setup. Any insights into potential pitfalls or best practices for this specific configuration would be highly beneficial.

Background Research: I have try but still can not.

Spec:

* PHP version: 8.0.30
* Apache/2.4.41 (Win64) OpenSSL/1.1.1c PHP/8.0.30
* PHPMyAdmin Version information: 5.2.1 (up to date)
* CiviCRM Version 5.65 WordPress

# Answer
> 1 votes
From the error message (`Fatal error: Uncaught error: Class "IntlDateFormatter" not found`), it looks like you don't have the PHP Internationalisation module installed, which is a requirement of CiviCRM.

You can find a detailed list of the requirements in the installation documentation.

This related question might help you to install this module: https://stackoverflow.com/questions/6242378/fatal-error-class-intldateformatter-not-found

---
Tags: wordpress, civicrm-buildkit, install, windows, local
---


# Question
Title: Civicrm upgrade fails to update the database
I've run into an odd CiviCRM upgrade problem and am looking for leads on what to try.

Civi 5.61.3 is running within Wordpress 6.2.x, PHP 7.4, mysql 5.7.41 I want to move it to the latest editions of Civi, PHP, and mysql.

The upgrade procedure all goes smoothly BUT, when I go to the update database step: (.../admin.php?page=CiviCRM&q=civicrm/upgrade&reset=1) It displays the update page, reminds to make a backup, and asks if I want to proceed. When I click it to proceed, it sends me immediately to the home page of the web site with NO database update performed, nor any error messages displayed in the usual locations.

Since this is a hosted site, I cloned the site to my local sandbox for further testing. On the sandbox the upgrade takes place as usual with no problems.

Back on the hosted site, I turned Wordpress debug on, but the upgrade throws no errors nor do any appear in the apache2 logs. I've tried moving PHP and mysql to newer editions beforehand but that too did nothing to resolve the problem. I even switched from the site's usual theme to a standard one but that too did nothing.

So... I'm running low on ideas for why the upgrade works fine on my sandbox but fails on the public hosted site without providing any feedback on what may be causing the failure.

I don't think it's a permissions issue because the site works fine within the older editions and prior site upgrades never caused a problem.

Have you seen this before? How did you resolve it?

# Answer
Have seen this on a few small "local" hostings overconserned by "server security" (in their equivalent of understanding it). The main issue here is always to get **the real** output from the webserver, PHP and (sometimes) mysql **error** logs - for this you may want to have a few rounds with 1st level support engineers and, if unlucky, a few rounds with the 2nd level support engineers. Once you get the proper logs, all turns to be really simple ;-)

The below might worth trying as well (try this in various places, index.php or civicrm.settings.php):

```
ini_set('display_errors', 1);
error_reporting(E_ALL);

```
> 0 votes

---
Tags: wordpress, upgrade, failure
---


title: Form Builder Not updaing details

text:
# Question
Title: Form Builder Not updaing details
I have created a form in Form builder to enable a logged in user to update some details we have stored for them (their Gift Aid status). This displays via a short code in a wordpress page (\[civicrm component="afform" name="afformGiftAid" hijack="0"\])

If I am logged in as an administrator it updated the record. If I am logged in as a "general user" it does not update the record. I am guessing this is a permission issue - Can anyone advise what permissions need to used in Civi/ Wordpress to ensure the record gets updated - I have tried a few and no success.

We are getting the following errors in the Log files

\[debug\] Silently ignoring exception in Afform processGenericEntity call: Authorization failed \[debug\] $API Request Authorization failed = #0 /.../wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(153): CRM\_Core\_Error::backtrace("API Request Authorization failed", TRUE)

Wordpress 6.4.1 CivCRM 5.65.2

# Answer
> 2 votes
I was experiencing a similar issue, the difference for me is I have a public facing form that allows non-logged in users to submit the form to create individuals in Civi. Located on the Form Settings tab, I had the Form's Permission set to *Generic: Allow all users (including anonymous)* but experienced the same Authorization Failed error.

My solution was to change each of the form's "entities" *Security* from **User-Based** to **Form-Based** which then used the Form's Permissions mentioned above. To find this setting:

1. Edit your form and find the Form Settings tab (should be selected by default).
2. Each of the tabs to the right is what I'm calling an "entity". You may only have one or many depending on your form.
3. On each of these tabs, about half way down, directly under the *Options* header is the **Security** drop down. This is what I changed to Form-Based.

I hope this helps you.

---
Tags: permissions, formbuilder
---


# Question
Title: Do strings used in API version 4 need to be escaped?
When running something like this:

```
$result = civicrm_api4('Event', 'get', [
    'select' => ['id'],
    'where' => [
        ['OR', [
                ['title', 'LIKE', $keyword],
                ['summary', 'LIKE', $keyword],
            ]
        ],
    ],
    'checkPermissions' => false,
]);

```

Should the `$keyword` variable be escaped or is it something done internally by the API?

# Answer
Yes, all strings will be escaped automatically by the CiviCRM code.
> 4 votes

---
Tags: wordpress, api, apiv4
---


# Question
Title: Is it possible to archive or delte old draft/unsent mailings?
We've been using an online version of civi (5.39.1 on a Drupal install) which has been great but after nearly a year we have almost 160 draft mailings that were never sent. I think the users who were new created quite a lot of them when just getting used to the system. In any case I'd like to be able to simply delete a whole bunch of these or archive them as the list of drafts is becoming a bit much. I can't add an extension as it's an online service with limited scope for extensions. Is there a way that i can do this?

# Answer
The best way is to use the Delete Draft/Unscheduled Mailings periodically extension and set the number of days the draft mailing should be deleted in the Delete Unscheduled Mailings scheduled job. The provider should be OK with adding this extension in.

You can manually delete with the permission `CiviMail: delete in CiviMail` . I'm wondering on your access level, you should see if it is not full CiviCRM Admin / have this permission?

I don't know what online service you are using but it needs to be updated to the latest security release as well.
> 0 votes

---
Tags: mailing
---


# Question
Title: API4 GroupContact does not update Subscription History?
When I use the API4 GroupContact update I do not have the option to change the date of the change (which is kept in civicrm\_subscription\_history). Also, when I use the update to set the status to Removed, the status in the group contact is changed indeed but nothing is added to the civicrm\_subscription\_history.

Am I missing something or is this a bug? (CiviCRM version 5.41.2)

# Answer
> 1 votes
APIv4's `GroupContact` was updated circa 5.49 to auto-update the `SubscriptionHistory` (https://github.com/civicrm/civicrm-core/pull/22419 \- contemporaneously with the question here).

---
Tags: groups, apiv4
---


# Question
Title: CiviCase Timelines based on specific values of fields
I’m new here, so sorry if I’m asking something too obvious, but I couldn’t find an answer in Civi manual to it. The manual stats that “…if one of the activities in your standard timeline is a medical evaluation, you could have 2 or more timelines that outline different schedules of medical treatment and add one of these to the case depending on the outcome of the original medical evaluation.” However, I couldn’t find anywhere how to I set a timeline which is dependent on another field value. Thanks

Edit: Could I do it with CiviRules, maybe? Or any other better option?

Edit 2: Yes, was able to do it with CiviRules

# Answer
> 0 votes
It's maybe unclear but when it says "and add one of these to the case depending on the outcome of the original medical evaluation" it means the case manager would manually add the appropriate timeline after assessing the situation. Not based on the value of a field but on a variety of factors requiring professional evaulation.

---
Tags: civicase, civirules, activity
---


title: Civimail stats being thrown off

text:
# Question
Title: Civimail stats being thrown off
Is anyone else seeing mailing stats being completely thrown out by what I assume is a security product? We are routinely seeing some. .ac.uk and .ie addresses which record a click and a separate open for every single link in a mailing. I am assuming that some mail scanning software is scanning every link, for every separate recipient on an email domain, every time, before delivering the email to the recipient.

We sent a recent mailing that appeared to have 3100 clicks. After removing all duplicates, the figure remaining was 135!

# Answer
This can indeed happen if the recipient uses some kind of screening / security application that "checks" links contained in emails (we have seen that with some MS products as well). Afaik there is nothing in CiviCRM "out of the box" to prevent that. You could of course build some script / query etc. that identifies and deletes those but it would probably become a bit fuzzy.
> 1 votes

---
Tags: civimail, civireport
---


# Question
Title: Is there a way to import both type of contact types together (Individual and Organisation)?
I am looking for a solution where I can just do importing contact together for both individual and organisation contact types. Please assist me.

# Answer
> 1 votes
I don't think there is any way to mix up different contact types on import, who have different fields from each other.

---
Tags: extension, import, data-import
---


# Question
Title: Merge Contacts throw an error: DB Error: no such table
Enabling the debug mode, I got more details:

> Error Field Error Value Type DB\_Error Code -18 Message DB Error: no such table Mode 16 UserInfo UPDATE civicrm\_afform\_submission SET contact\_id = 123 WHERE contact\_id = 456 \[nativecode=1146 \** Table 'wordpress.civicrm\_afform\_submission' doesn't exist\] DebugInfo UPDATE civicrm\_afform\_submission SET contact\_id = 123 WHERE contact\_id = 456 \[nativecode=1146 \** Table 'wordpress.civicrm\_afform\_submission' doesn't exist\]

It looks like this table is created by the Form Builder extension. I tried to enable it but the table is still not created.

# Answer
Can you uninstall the extension and re-install?

i.e Disable \>\> Uninstall \>\> Install

Or you can run below query

```
CREATE TABLE `civicrm_afform_submission` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Unique Submission ID',
  `contact_id` int unsigned,
  `afform_name` varchar(255) COMMENT 'Name of submitted afform',
  `data` text COMMENT 'IDs of saved entities',
  `submission_date` timestamp DEFAULT CURRENT_TIMESTAMP,
  `status_id` int unsigned NOT NULL DEFAULT 1 COMMENT 'fk to Afform Submission Status options in civicrm_option_values',
  PRIMARY KEY (`id`),
  CONSTRAINT FK_civicrm_afform_submission_contact_id FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact`(`id`) ON DELETE SET NULL
)
ENGINE=InnoDB ROW_FORMAT=DYNAMIC;

```
> 2 votes

---
Tags: wordpress, contacts
---


# Question
Title: CiviCase: Activities duplicated when filed
Recently, when filing an Activity to a Case file, the Activity is being duplicated; one copy is filed as expected, the other is not filed and a prefix "Filed on Case XXX" is added to the Subject field.

Case-filed Activities are configured to be visible in general Activity views.

This change in behaviour occurred about two months ago, I think.

Is this expected behaviour, and merely a configuration issue I have missed? Or is it a bug?

Running CiviCRM / CiviCase version 5.65.2.

# Answer
It's expected. See lab ticket https://lab.civicrm.org/dev/core/-/issues/4220 and PR https://github.com/civicrm/civicrm-core/pull/26091
> 0 votes

---
Tags: civicase, activities
---


# Question
Title: Installation (5.69.1) fails: Server 500 Error (Joomla 5.02)
I just wanted to update from an older version (I gues it was 5.63 or so) to the current 5.69.1, but the installation runs into a red screen with a Server 500 error.

This is what I see after turning on debugging and trying to launch CiviCRM: https://i.imgur.com/CuFfNbd.jpg

Any idea, what I can do?

My Joomla is 5.02, PHP is 8.1.27

Stefan

# Answer
> 0 votes
Hi Stefan
Return to the URL **\[DOMAIN\]/administrator/index.php**
Navigate to **components/civicrm**.
In the main menu of CiviCRM navigate to **Administer \> Administration Console \> System status**.
There you should find an error message with a link to execute the necessary database-upgrade. Once executed/finished successfully, the error no longer shows up.
Alternatively, you can execute the upgrade directly via the link **\[DOMAIN\]/administrator/?option=com\_civicrm&task=civicrm/upgrade&reset=1**.

---
Tags: joomla, installation
---


# Question
Title: AdminUI Display of Groups is Cluttered - How can we improve?
AdminUI comes bundled with CiviCRM - when enabled, it does a pretty great job on most pages - but on groups - I hate it. (I do like the search functionality though)

* It ignores hierarchy (parents, sub parents, children, etc) are all mixed in together - We have about 20 active parent groups at any given time - with maybe 100 active groups total. Parent groups are helpful to be organized or to see all related groups in one place.
* When searching for parent groups - it searches for all groups - not just ones listed as parents (or those that have "children"). Users have to remember the exact name of the parent group.
* ~~It breaks breadcrumbs. *CiviCRM \> CiviCRM \> FormBuilder \> Edit Form \> Manage Groups* \- though this seems to be an issue throughout AdminUI. TBH the original breadcrumb wasnt that useful anyways, (it was just *CiviCRM*) but at least it wasn't misleading.~~

# Answer
I agree that we need hierarchical display but it's not yet possible in SearchKit.

However, if you prefer the old implementation, it's quite easy to disable the new one (and keeping AdminUI) by changing the page route (url) of the corresponding FormBuilder :
> 1 votes

# Answer
Great! That's why we created AdminUI rather than putting things directly into core - so you can kick the tyres and we can improve the new searches before they replace core functionality.

Many setups don't use parent/child groups at all. For others such as yours, they are a significant feature.

There are a couple of ways you can help:

1. Ideally, install a copy of master (so you have the latest SearchKit/FormBuilder/AdminUI), make changes to the Groups search and create a PR.
2. If you don't want to create a PR yourself, see the notes at the top of the AdminUI tracking issue
3. If you can't get implement the changes you'd like to see then create a gitlab issue and describe how you think it should work. It is more useful to specify positively what it should do rather than just "It's a mess":-). Note that we don't have expanding hierarchy functionality yet so things we can implement with its current abilities are more likely to happen soon.
> 0 votes

---
Tags: groups, formbuilder, admin, ui
---


# Question
Title: mysqli_real_escape_string error preventing CiviCRM from starting after upgrading from 5.66.2
This may well be just my environment but I am currently unable to upgrade from CiviCRM 5.66.2 to anything later (I worked backwards from 5.69). The headline error is:

```
TypeError: mysqli_real_escape_string(): Argument #2 ($string) must be of type string, array given in mysqli_real_escape_string() (line 872 of /var/www/html/vendor/pear/db/DB/mysqli.php).

```

Here is a Gist of the full trace: mysqli\_real\_escape\_string error

I cannot see anyone else with this issue but just wanted to check before I did hours of investigation. Seems to be linked with getting case types? We do have a few custom ones and some are disabled.

We are on Drupal 10.x, MySQL 8..x, Apache 2.4.x and PHP 8.1.2

# Answer
> 1 votes
Reading through your backtrace, I see where the error is happening but I'm not sure of the underlying cause. Perhaps you are using an extension or some custom code that implements ACLs for CiviCase? That's where the backtrace seems to point to.

At any rate, here is a fix for you which would avoid the crash and allow you to upgrade: https://github.com/civicrm/civicrm-core/pull/28957

---
Tags: upgrade, error
---


# Question
Title: How to allow multiple work address for individual contacts
I would like to know if a contact person has the Work and Billing address already in his profile how he can add a new Billing or Work or Home address again on CiviCRM. at the moment it only allow to add 1 address type only.

# Answer
> 0 votes
A contact can have multiple addresses of the same type ('location') - eg Work,Home. That can be done via the contact summary tab. If you are using a form or profile to update the records then the limitation is in how that is configured.

---
Tags: joomla
---


# Question
Title: Is it possible to change the message about registration being closed for an event?
Right now if you visit an event page before an event starts - it says

> Registration is closed for this event

Ideally it would say

> Registration is closed for this event and will open on December 5th at 12PM.

or

> Registration opens on December 5th at 12PM.

Anything indicating to come back essentially.

# Answer
The wording is hardcoded in template file, you can change it by altering the template file or writing a JS or hook via extension to replace the wording.
> 0 votes

---
Tags: civievent
---


# Question
Title: User creation feature is no longer visible
We are using CiviCRM 5.68.1 on WordPress 6.4.2

Until recently, we were able to allow users to create their own WordPress userprofiles while filling out a Civi profile form. These features are still enabled, but the username creation field is no longer visible at the top of the form. Is this a bug with the new release of CiviCRM? See screenshots below that confirm the features are enabled as they should be.

Thank you\

Civi/Profile/Form.php Starting at line 698

```
public function buildQuickForm(): void {
$this->add('hidden', 'gid', $this->_gid);
$this->assign('deleteRecord', $this->isDeleteMode());

switch ($this->_mode) {
  case self::MODE_CREATE:
  case self::MODE_EDIT:
  case self::MODE_REGISTER:
    CRM_Utils_Hook::buildProfile($this->_ufGroup['name']);
    break;

  case self::MODE_SEARCH:
    CRM_Utils_Hook::searchProfile($this->_ufGroup['name']);
    break;

  default:
}

```

# Answer
This is a Core regression bug, I have pushed a fix https://github.com/civicrm/civicrm-core/pull/28970

Can you please apply the \[patch\]\[1\] and test?

```

wget https://patch-diff.githubusercontent.com/raw/civicrm/civicrm-core/pull/28970.patch

patch < 28970.patch

```

diff --git a/CRM/Profile/Form.php b/CRM/Profile/Form.php index e20bd8d40b..f156b131d2 100644 --- a/CRM/Profile/Form.php +++ b/CRM/Profile/Form.php @@ -889,10 +889,10 @@ class CRM\_Profile\_Form extends CRM\_Core\_Form { $this-\>setDefaultsValues();

```
 $action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, NULL);

```
* $this-\>assign('showCMS', FALSE); if ($this-\>\_mode == self::MODE\_CREATE || $this-\>\_mode == self::MODE\_EDIT) { CRM\_Core\_BAO\_CMSUser::buildForm($this, $this-\>\_gid, $emailPresent, $action); }

* $this-\>assign('showCMS', FALSE);

$this-\>assign('groupId', $this-\>\_gid);

```

  [1]: https://patch-diff.githubusercontent.com/raw/civicrm/civicrm-core/pull/28970.patch

```
> 3 votes

---
Tags: wordpress, account-creation, userprofile
---


# Question
Title: wordpress: signup form not displayed on Frontpage
I’m using a CIVICRM Form block (type create) to provide a form to the users to subscribe to a newsletter. I want to have this block on the frontpage of my wordpress site. I use the twentyseventeen Theme, which includes other pages on the frontpage as "hovering" blocks. I'm using the "Blocks for CiviCRM" Plugin to add the Form to the page. But using the "\[\]" Syntax makes no difference. I've tried several options to get the form to display:

```
[civicrm component="profile" mode="live" hijack="0" gid="14"]
or
[civicrm component="profile" mode="live" hijack="1" gid="14"]

```

I now created a page with just the CiviCRM block in it. When I just display this page, the form is displayed. However when the page is included as a block on the frontpage, nothing is displayed, the civicrm-div is just empty.

I think that I’m missunderstanding something about how the civicrm integration in wordpress is working, but I can’t find out what… Can you help me?

Screenshot of the page in the editor:

screenshot of the single page view

emtpy block on the frontpage

Thank you for your help!

# Answer
> 0 votes
Thank to Christians comment, I was able to find a workaround:

I modified inc/template-tags.php of the twentyseventeen theme, and "faked" being in the loop. Based on Christians description I do not expect any side-effects, as it's only used on the front-page.

```
    global $wp_query; // we need the global wp_query to fake being in the loop

    if ( get_theme_mod( 'panel_' . $id ) ) {
        $wp_query->in_the_loop = true; // fake the loop for CiviCRM to work correctly
        $post = get_post( get_theme_mod( 'panel_' . $id ) );

```

This way, the civicrm shortcode get properly executed. Thank you.

# Answer
> 2 votes
The TwentySeventeen theme's "Homepage Sections" functionality isn't implemented using the WordPress Loop so attempts to invoke CiviCRM are caught by this code which is intended to prevent "double-invoke" situations caused by content-preprocessing plugins e.g. when JetPack & Yoast try to create OpenGraph previews etc. This is vital because invoking CiviCRM more than once will cause a fatal error.

Unfortunately, there don't appear to be any appropriate hooks in the TwentySeventeen theme whereby you might be able to trick CiviCRM into rendering during the Sections pseudo-loop.

If you're using ACF Pro, what you could do is create the form using ACF Extended and CiviCRM Profile Sync. Alternatively you could use Caldera Forms and the CiviCRM integration plugin.

Lastly, perhaps there's a way to create the form using FormBuilder and embed it with the CiviCRM Shortcode? The `[civicrm component="afform"]` Shortcode doesn't invoke CiviCRM so won't be subject to the same limitations and should render as expected.

---
Tags: wordpress, forms
---


# Question
Title: Passing exclude list to the Update Membership Statuses scheduled job
We added a special pending memberhsip status for a client, but because it is not one of the default statuses, it is not getting excluded when the Update Membership Statuses scheuled job runs and is therefore getting processed. I noticed that the scheduled job *should* be able to take a parameter with an *array* of ints to tell the job what statuses to ignore, but it appears that the input parameter doesn't actually take an *array* of ints, but only a single one (which isn't helpful). Here is the error the gets returned when I run the scheduled job with the param:

*Summary: Finished execution of Update Membership Statuses with result: Failure, Error message: exclude\_membership\_status\_ids is not a valid integer*

Here is the parameter I added to the scheduled job.

*exclude\_membership\_status\_ids=\[4,5,6,7,8\]*

I also tried it without the square brackets:

*exclude\_membership\_status\_ids=4,5,6,7,8*

What am I missing? Is this a bug in the code? How can I exclude my new membership status from being processed (and being set to New even though it is a special Pay Later pending status)?

# Answer
I think it should work if you change 'ids' to 'id' as per below

exclude\_membership\_status\_id=\[4,5,6,7,8\]

I tried on a local copy, executed the job and it did process - details below

```
Parameters raw (from db settings):
exclude_membership_status_id=[4,5]

Parameters parsed (and passed to API method):
a:2:{s:7:"version";i:3;s:28:"exclude_membership_status_id";s:5:"[4,5]";}

Full message:
Finished execution of Update Membership Statuses with result: Success (Processed 26 membership records. Updated 0 records.)

```

Hope that will work for you too.
> 2 votes

---
Tags: civimember, scheduled-job, status
---


# Question
Title: Database error when exporting Activities: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535
I've reviewed the other related tickets here, but the solutions either don't seem applicable or are things we've already got in place - file format and character encoding are what they need to be I think.

This problem `Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535`  only appears when we are doing an export to csv. Our database is MySQL8.0 in AWS Aurora RDS. I *think* I understand the problem, but I'm hoping to get confirmation of that.

We have - frankly - an absurd amount of custom fields, and this particular export has most of them in it. We first saw the problem when we increased the size of one of the select fields because the export was being truncated. The field was varchar(255), but some of the select options were long sentences, so as I understand it, the temporary table prepared for the export used that varchar(255) for it's length causing the exports to get cut off for that field. We increased that varchar to 400, and they were no longer cut off. When we do the full export though, we now get the above database error.

The confirmation question: Is that description of how the exports work accurate? Temporary table with the column size set by the size of the select element (rather than anything to do with the size of the options)?

This problem is only showing up in exports, which isn't *really* all that important. The solution that I have in mind is just have users split this export into two parts... I think that will work. But, is this a growing problem that we'll eventually see in normal use?

# Answer
You will need to convert all the CiviCRM tables to utf8mb4 or as a workaround convert civicrm\_contact table to utf8mb4 by running below query.

```
ALTER TABLE civicrm_contact CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

```

Alternatively, you could build the search using searchkit with all the columns you need and export the results in CSV
> 1 votes

---
Tags: database, export
---